Skip to main content
gamedev.net
🔒 Locked

projective textures

Started by supagu Oct 30, 2004 at 11:35 PM 2 replies 850+ views
Original Post
supagu
supagu
i've just got shadow maps working with projective texturing, the problme is: i can project the texture on to a scene with no other materials easily. The problem becomes how do i project a texture on to a mesh but render the mesh using the material i have also? because i currently use texture matrices, multitexturing etc? my initial idea is to offset my materials being rendered eg: i have a material that uses 2 textures they would use texture units 0 and 1, now i want to project another texture on to the mesh, so i would do: projective texture uses unit 0, offsetting the other textures to 1 and 2, then i would just some how set the output pixel from texture 0 to go to texture 1.... does this sound like how most people do it?
silvermace
silvermace
if you have more than two multitexture units (gf3+ and not a gf4mx) you can just set the shadow map to texture unit 3, or 4 etc.

if not, rendering the scene with out the shadow map (normaly) then enable blending and do another pass with multitexturing disable and with the shadowmap bound to MTU-0

that should work..
supagu
supagu
should it not go in the lower texture units? because if i do some blending operations its gonna screw things up, also if different materials use different amount of texture units, it makes things difficult also.
MARS_999
MARS_999
Quote:
Original post by supagu
should it not go in the lower texture units? because if i do some blending operations its gonna screw things up, also if different materials use different amount of texture units, it makes things difficult also.


If you have so many textures and need to use all the available texture units, you can create the shadowmap and then store it in a texture object and bind it later or modulate it with another texture if at all possible. Also you might have to do multipass, multitexturing to use them all...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.