GL texture warping
Hi
My GL textures are warping when they get close to the camra...
They look like linear texture mapping instead of z perspctively correct.
So how do I fix this?
How do I turn on Z perspective mapping if its off?
My GL textures are warping when they get close to the camra...
They look like linear texture mapping instead of z perspctively correct.
So how do I fix this?
How do I turn on Z perspective mapping if its off?
Texture-mapping is always perspective-correct.
Post a screenshot or two?
Post a screenshot or two?
Perhaps your near-far ratio isn't strict enough. In the past, fine tuning this has helped for me.
Quote:Originally posted by Holmes
Perhaps your near-far ratio isn't strict enough. In the past, fine tuning this has helped for me.
hmm ok what kind of vaules do you use?
Are you sure you haven't just got your texture-coordinates wrong?
Quote:Originally posted by OneSadCookie
Are you sure you haven't just got your texture-coordinates wrong?
Hmm they look fine except were the warping occures.
I will doble check the textures.
There a chance they are all reversed but like in the space ship its a total reversal
and the ship is just currently pointing up side down.
have you considered drawing quads? (or if you are drawing quads, drawing triangles?)
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote:Originally posted by kelvin
have you considered drawing quads? (or if you are drawing quads, drawing triangles?)
No.
BANG! is not a open gl engine.
Its a engine that has a open gl driver.
Quads were a non standard shape under other 3D cards... only tris are.
The test app above is simply a RealBasic Shell that tests the Bang! real basic plug in.
It is not a actual game of any real sort... tho it looks to be using tiles.
FIXED....
Heres how...
// TEXTURE COORDINATES //
float invW = 1.0f / ( in_triangle->clipped_vertexes[ x ].point.z * 0.001f );
glTexCoord4f( in_triangle->clipped_vertexes [ x ].u * invW, in_triangle->clipped_vertexes [ x ].v * invW, 1.0f, invW );
Using glTexCoord4f
and using the q value and also scaling the u/v by invW
give me perspective correct texture mapping...
Or actually the problem is more like this...
Read about it here... http://www.opengl.org/developers/code/mj...ortion.txt
Im not sure but maybe? this only happens when using glOrtho
maybe the other modes handle this for you...
cause it does not seem to be a common problem for most people.
Heres how...
// TEXTURE COORDINATES //
float invW = 1.0f / ( in_triangle->clipped_vertexes[ x ].point.z * 0.001f );
glTexCoord4f( in_triangle->clipped_vertexes [ x ].u * invW, in_triangle->clipped_vertexes [ x ].v * invW, 1.0f, invW );
Using glTexCoord4f
and using the q value and also scaling the u/v by invW
give me perspective correct texture mapping...
Or actually the problem is more like this...
Read about it here... http://www.opengl.org/developers/code/mj...ortion.txt
Im not sure but maybe? this only happens when using glOrtho
maybe the other modes handle this for you...
cause it does not seem to be a common problem for most people.

