Archived

This topic is now archived and is closed to further replies.

Renus

Strange d3d texture uv mapping behaviour

Recommended Posts

Having funny problems with the output of my texture mapping. If I specify texture coordinates whose max v coordinates don''t reach 1, the system shifts my tex coords up to reach the 1. Example: specifying tex coords (a, 0.4), (b, 0.8) will result in an output of (a, 0.6), (b, 1) As a workaround, I currently assign each of these meshes additional 4 vertices with tex coords (0,1) to prevent the "spread". I guess I oversaw a d3d setting for thes textures, but cannot find it. Any idea? - thomas

Share this post


Link to post
Share on other sites
This may be a little too simplistic...but is there anywhere your tex coords could be being changed from floats to ints? That would explain the round up to 1...sorry if i underestimated your problem but it was the first thing that came to mind.

Brian

Share this post


Link to post
Share on other sites
Sorry for my lazy descriptions.. No, teh tex coords are not shiftet to 0 and zero, they are just shifted so that the max of my v coords appears at 1.

To give you the background: I use one texture for e.g. a house. The texture holds walls, doors etc, and the meshes tex coords point accordingly into this texture. Now during rendering I see that my texture fragments are wrong; they are taken with correct shape from the texture, but shifted as mentioned. Of course I thought first that my code from reading the model to feed D3D was wrong, but I output the tex coords that are pushed into the vertex buffers, and I see that they are ok. It must be something in D3D that translates the v coord, I just can''t find the "switch"..

- thomas

Share this post


Link to post
Share on other sites