Problems with Texturing...

Started by
4 comments, last by Zaph-0 15 years, 9 months ago
Hi, I am having problems with distorted textures. In the picture below you can see what I mean: In the upper picture you can see the high LoD version with a big quad drawn by 4 smaller quads and they look perfect. In the lower version, the low LoD version (the one it switches too), the 4 outer vertices have the same coordinates but the texture inside is somehow garbled. I have no idea how that happens. It actually should look quite similar considering of course the lower detail texture and using only 1 quad (4 vertices/2 triangles/1 texture) instead of 4 quads (9 vertices/8 triangles/4 textures). And as I said before the outer 4 corner vertices are the same... Somehow the texture doesn't look right in the low LoD version (the high LoD version looks right) and it causes some serious "popping"... Could someone explain to me why that happens and how I can prevent it ?
Advertisement
How are you generating the load LoD?

If you just save the LoD surfaces, how do they look?
Hi,

I am not certain what you mean, but the textures are correct. I use for the higher LoD a generated Texture with a grey square with a number and a red border outside it at a high res and for the lower LoD I just copy 4 of them (copyrect) together.

They look correct when I save the texture and look at it. If you check the square right of the 2 I marked on the lower screen you can see that the same texture is used there correctly.

It's just sometimes that the inside is completely deformed for no apparent reason as you can see on the 2 squares I highlighted on the lower screen.

I really have no idea what is causing this...

Could it be some perspective thingy ?




Ok, I found the error. I didn't count on the quads being made out of 2 triangles that are not aligned 180° to each other and have a depth component that distorts the texture because of perspective correction.

Is there somehow a way to disable perspective correction for texture mapping in directx ?
Quote:Is there somehow a way to disable perspective correction for texture mapping in directx ?

I think I understand what you are trying to ask. However, remember that textures aren't "perspective corrected." The texture is mapped by the texture coordinates of the vertices and it is the vertex positions which are adjusted by the projection matrix.

If you're creating a perspective texture from the high LOD render and trying to use it as a "flat" texture on a perspective object, you're getting a perspective view of a perspective view.

EDIT: Why not use the same "flat" texture for all LOD's?

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I am not creating a perspective texture but am using the same for everything the problem is though that while applying the texture the renderer also seems to use the depth information to apply it in a 3 dimensional way.

I think that is called perspective textureing instead of affine texturing.

http://en.wikipedia.org/wiki/Texture_mapping

And I need to know how to turn the perspective off...

I hope that made it somehow clearer...

^_^

This topic is closed to new replies.

Advertisement