Sign in to follow this  

dudv maps

This topic is 4335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this