There are some tricks to make… 1 is to use a cubemap instead, then you can define all directions, or use multitexture and a small 2 pixel texture, one black and one white pixel, and set up the texture generation for that textureunit so that it cast the white pixel forward and the black backwards and moduate with the first texture.
The cubemap technique takes a bit of memory ( 6times as much) but should be easest to implement, and you have much more freedom. look at nvidias site for examples.
i have read the the Nvidia CubeMap documentation, and i think i have not used the good words to explain my problem (english is not my mother tongue, sorry). Because i don’t know how CubeMap can solve my problem.
I would better to use “projected texture” instead of “projective texture”.
I want to project a texture like a movie in a cinema. I don’t want to use reflection.
My problem is that my projector project my texture in front of and behind the projector, as you can see in this picture:
[This message has been edited by greg2 (edited 09-18-2003).]
I can’t tell you a general solution for the problem, as I have little experience with it. However, I can tell you the cause.
Behind the projector, you are getting texture coords with negative r and negative q components.
For lookup purposes, the final texcoord will be (s/q;t/q;r/q) (interpolated w plays a role, too, but let’s keep it simple).
That means behind the projector, you’ll get the image in front of the projector (r/q>0), and flipped. This is an inherent problem of cubemap addressing with homegenuous coordinates.
You can try the modulation trick to black out textures behind the projector.
You can also try a user clip plane.
It might also be possible to play with the texture projection matrix to always output a constant, small positive z (just a wild idea). If that actually works, it would prevent the front-to-back flipping when w crosses zero.
Oh, sorry, got confused about that one. I somehow thought you were using cubemaps.
As I said, I don’t have much practical experience with this stuff.
If you don’t use cubemaps, the “constant positive z” trick will not work.
A clip plane should be fine