GL texture warping

Member
Posts: 110
Joined: 2002.04
Post: #1
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?

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Texture-mapping is always perspective-correct.

Post a screenshot or two?
Quote this message in a reply
Member
Posts: 142
Joined: 2002.11
Post: #3
Perhaps your near-far ratio isn't strict enough. In the past, fine tuning this has helped for me.
Quote this message in a reply
Member
Posts: 110
Joined: 2002.04
Post: #4

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Member
Posts: 110
Joined: 2002.04
Post: #5
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?

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
Are you sure you haven't just got your texture-coordinates wrong?
Quote this message in a reply
Member
Posts: 110
Joined: 2002.04
Post: #7
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.

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #8
have you considered drawing quads? (or if you are drawing quads, drawing triangles?)

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Member
Posts: 110
Joined: 2002.04
Post: #9
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.

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Member
Posts: 110
Joined: 2002.04
Post: #10
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.

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume: http://www.chrisdillman.com
Quote this message in a reply
Post Reply