View Full Version : clipping backface projection in projected textures
04-11-2003, 01:53 AM
Any ideias on how to do this ?
I was thiking in using a cubemap, all faces white, with one single face black, so that everything behind the projector is clipped., but i'm having some problems using a cubemap while multitexture is enabled..
Any other ideias ?
Cubemaps and multitexture should work just fine, but else use a vertexprogram that just flips texturecords from 0 to 1 when the normal faces from the light and use a 1*2 texture with one white and one black pixel.
04-11-2003, 02:13 AM
Well, can you spot something wrong with this setup ? tex1 for cubemap, tex0 for projected texture.
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB);
[This message has been edited by Bruno (edited 04-11-2003).]
04-11-2003, 02:26 AM
Originally posted by Bruno:
I was thiking in using a cubemap, all faces white, with one single face black, so that everything behind the projector is clipped.
You would need a cubemap which is half black, not 1/6th black. The back half of the side faces has to be black as well.
However, if I were you I would forget about the cube map altogether and go with Mazy's suggestion of using a 1x2 texture, making sure that everything behind the camera maps to the black texel.
Reflection mapping? and texturecoords enabled?
shouldnt you generate coords from the normals (GL_NORMAL_MAP_ARB i think) and make use of the texturematrix to rotate the cube to the correct angle?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.