Sign in to follow this  

conversion of textures coordinates from max to direct3d

This topic is 4358 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

something strange occurs when I apply tiling (and not offset) to maps in 3ds max: the texture gets "cut" like it has some offset. When I export to direct3d with my 3ds loader, it doesn't happens: the texture is applied without offset. Does anyone knows why this happens??? Take a look: 1-> no tiling applied: Under direct3D9 description of your image Under Max Renderer: Free Image Hosting at www.ImageShack.us 2-> tiling U = 2.0: Under Direct3D9 Free Image Hosting at www.ImageShack.us Under Max Renderer: Free Image Hosting at www.ImageShack.us 3-> tiling U = 3.0 Direct3D9: Free Image Hosting at www.ImageShack.us Max Renderer: Free Image Hosting at www.ImageShack.us 4-> tiling U = 4.0 Direct3D9: Free Image Hosting at www.ImageShack.us Max Renderer: Free Image Hosting at www.ImageShack.us PS: I recall that there's no offset applied to the U coordinate of the map and the max rederer keeps rendering like it does. All I wanna know is what's the logic behind max texture coordinates and the differences to direct3d texture coordinates. [Edited by - ashade on January 11, 2006 12:55:43 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by ashade
something strange occurs when I apply tiling (and not offset) to maps in 3ds max: the texture gets "cut" like it has some offset. When I export to direct3d with my 3ds loader, it doesn't happens: the texture is applied without offset. Does anyone knows why this happens???

Hmm, bare in mind that 3DSMax is a more general-purpose graphics package and some of its features won't map directly to Direct3D. It could also be that it stores the tiling differently - and you need to set up the tiling in D3D (there are various texture addressing modes).

Quote:
Original post by ashade
PS: it would be easier to explain the problem if I could show pictures to you, but I don't know how to post images in this forum.

How do I put links/quotes/images/code/smileys in my posts?

hth
Jack

Share this post


Link to post
Share on other sites
If I understand this correctly (a lot of things about the Max internals are 'difficult' to understand [wink]), Max will not bake UV tiling into the texture coordinates. Instead, the material applies that scaling at render-time. This means that whenever you alter the tiling, the UV coordinates themselves don't change. So you could have a titling of 7.0, and the coordinates would remain the same.

I have worked with mesh APIs that export the UV tiling values along with the other material properties, so that you can apply them in your shader, like Max does. (If you need some samples of UV tiling in shaders, check the Nvidia SDK). However, I'm not sure if X stores them. You probably want to check the Material structures that it loads, and see if there are any pertinent fields.

Alternatively, you could try to find a Modifier in 3ds Max that will bake in the final tex coords for you. I remember there being a handful of UV Modifiers, so perhaps you can find something.

Share this post


Link to post
Share on other sites
i've just solved this problem making the conversion: d3dU = 0.5*maxU - 0.5 and d3dV = -(0.5*maxV - 0.5). It solved the problem, now it's perfect. It seems that max texture coordinate system is very weired.

Actually you're right: max doesn't output texture coords for tiling and offset. Instead, it outputs tiling/offset values in the material info and you have to make the changes by yourself.

Share this post


Link to post
Share on other sites

This topic is 4358 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