hawk
06-15-2005, 03:39 PM
I am seeing some weird visual anomalies in a projected texture spotlight simulation. At certain orientations, the spotlight projection becomes grossly misshapen with a bulge or a long shaft extruded from it, or disappears altogether (see normal.jpg (http://members.optusnet.com.au/~m.hawkes/projtex/normal.jpg) and anomaly.jpg (http://members.optusnet.com.au/~m.hawkes/projtex/anomaly.jpg) ). Moving the spotlight just slightly away from these problem positions will return the correct spotlight pattern.
I reproduced this problem by modifying the demo projtex.c to include a "wall" object consisting of a large polygon perpendicular to the line of sight. The problem does not occur in the standard scenarios (cube, dodecahedron, sphere) but is readily seen in the "wall" scenario by carefully moving the spotlight around using the right mouse button. Note that the "wall" is in the same plane as the back wall of the cube scenario. The only obvious difference I can see is that all the standard scenario objects fit inside the viewport, but the "wall" does not.
Can anyone help explain the anomalies? The texture has a black border, so I don't think that is the issue. Also, experiments show the texgen is behaving OK, so it must be a result of the texture matrix projection. I don't think it is related to back projection because the problem can be demonstrated with the spotlight close to the line of sight.
Here is a copy of projtex.c modified to demonstrate the effect on startup: projtex.c (http://members.optusnet.com.au/~m.hawkes/projtex/projtex.c) . I have been running the modified projtex.c on an SGI Onyx2 with IR2 graphics and Irix 6.5.18f. Running on an SGI O2 also produces some weird (although different) effects. I haven't tried it out on a PC.
I reproduced this problem by modifying the demo projtex.c to include a "wall" object consisting of a large polygon perpendicular to the line of sight. The problem does not occur in the standard scenarios (cube, dodecahedron, sphere) but is readily seen in the "wall" scenario by carefully moving the spotlight around using the right mouse button. Note that the "wall" is in the same plane as the back wall of the cube scenario. The only obvious difference I can see is that all the standard scenario objects fit inside the viewport, but the "wall" does not.
Can anyone help explain the anomalies? The texture has a black border, so I don't think that is the issue. Also, experiments show the texgen is behaving OK, so it must be a result of the texture matrix projection. I don't think it is related to back projection because the problem can be demonstrated with the spotlight close to the line of sight.
Here is a copy of projtex.c modified to demonstrate the effect on startup: projtex.c (http://members.optusnet.com.au/~m.hawkes/projtex/projtex.c) . I have been running the modified projtex.c on an SGI Onyx2 with IR2 graphics and Irix 6.5.18f. Running on an SGI O2 also produces some weird (although different) effects. I haven't tried it out on a PC.