dudv maps

Started by
2 comments, last by HellRaiZer 18 years, 2 months ago
okay ive got a dudv map, as i want to do water reflections and refractions. now a few questions. 1) are dudv maps used for reflections? i know they are used for refrections. 2) what does the dudv map mean? 3) how do i use it? knowing 2 may help with this :)
Advertisement
Hi...

I think i can answer 2.

There are two ways to see it.
In the NV_texture_shader world (ps1.0 - ps1.3), dudv maps store an offset vector for adding it to a texture coordinate per-pixel in case to read an other texture. It's something like this :

float2 dudv = tex2D(dudvMap, texCoord);float2 newTexCoord = texCoord + dudv;float4 texSample = tex2D(diffuseTex, newTexCoord);


The above thing happens automatically with texture shaders.

On the other hand, in the ARB_fragment_program world (ps2.0 and ps3.0) dudv is just a texture with 2 16-bit channels. You can store whatever you like in it, and use it however you like.

Hope that helps.

HellRaiZer
HellRaiZer
do i need to do something else with them, as i have been using them as you've suggested, and it seems rather okay, except my reflections/refractions are skewing out the the right as i get close to the water:

http://www.users.on.net/~firefox/fab/water0.jpg
http://www.users.on.net/~firefox/fab/water1.jpg
I'm not sure what may be wrong but i don't think that dudv texture is the problem. There may be a problem with the matrix you are using for projecting the reflection. I say that because as long as you get the disturbance on the surface, the dudv texture is ok.

Sorry but i haven't implemented planar texture reflection yet so i can't help you with the details of the projection. I'm sure someone else can help you more.

HellRaiZer

EDIT :
Or there maybe a problem with the quad's tesselation. How many quads are there? If it's only one, try to subdivide it more to see what will happen.
HellRaiZer

This topic is closed to new replies.

Advertisement