Textures stretching

Originally posted by -NiCo-:
[b] [quote] Nut even Nehe’s examples work correctly.
So ‘Nut’ means ‘yes’? :slight_smile:

Anyway, it’s indeed time to do some debugging at every step and see if the results are what you expect.

Good luck!

N.[/b][/QUOTE]‘Nut’ means ‘But’. :slight_smile:
I’ll gladly debug each step, but WHAT STEPS SHOULD I DEBUG?! The texture coordinates are correct, but somewhere in the pipeline before the fragement proccessor something goes wrong… :confused:

Start with the NeHe tutorial for a textured quad, then gradually ad parts of your code to that tutorial that would effect the execution and verify at each point that the results are still correct.

N.

Heck, the texture coordinates get changed even beore the rasterizer. What except the texture matrix can be causing that?!

Originally posted by -NiCo-:
[b]Start with the NeHe tutorial for a textured quad, then gradually ad parts of your code to that tutorial that would effect the execution and verify at each point that the results are still correct.

N.[/b]
Yeah, I think I’ll do that. Thanks for your help and time.

On your screenshots I can see bad texture mapping only when hw do clipping. Check your vertex shader. Maybe your transform code doesn’t work as well.

yooyo

Originally posted by yooyo:
[b]On your screenshots I can see bad texture mapping only when hw do clipping. Check your vertex shader. Maybe your transform code doesn’t work as well.

yooyo[/b]
I use no shaders for that quad.

This might help: http://www.r3.nu/~cass/qcoord/

Check for texcoord generation. Maybe you forget to call glDisable(GL_TEXTURE_GEN_R) and glDisable(GL_TEXTURE_GEN_Q).

Or… try change driver…

yooyo

Make sure that the texture coordinates of all 4 vertices of the quad lie on a plane.

…?

That is that if you view your texcoords as positions, they must form a parallelogram.

Strange. It does work correctly on the GF4Ti using my ARB code path, however forcing exactly the same code path on my Radeon doesn’t solve the problem. :mad:

I am also having trouble with my radeon. I have a problem with texture-coords “damaged”, too. But my problem appeares when i use point-sprites. My code worked on a geforce-3.
Strange, strange. Someone should report all these bugs to ATI. Hopefully the will release a new driver. I am getting crazy. :eek:

I doubt it is a driver bug, because other OpenGL games (CS) work correctly.

Originally posted by CPPMaster:
[quote]Originally posted by Overmind:
Just an idea, I didn’t actually test this:
Do you do your camera transformation on the projection matrix instead of the modelview matrix? If yes, this could cause a problem with perspective correct interpolation…

No, everything (except the perspective calculation and calling glfrustom) is done in the ModelView matrix.
I just don’t get it… :confused: :confused:
[/QUOTE]I second the idea that the most likely cause of these issues is that your matrix stacks are botched. You might produce constant w or something like that.

I take it that you construct some (all?) matrices yourself? (because you said “perspective calculation and calling glFrustum”)

Can you insert code that gets both the modelview and projection matrices during a “broken” frame and just post the results?

Fixed it. It does looks like a driver bug. I’ve commented out glPushMatrix() and glPopMatrix() in the particle rendering code, and it looks like calling glTransform a few thousends of times (probably out of precision of float) causes some matrix bugs or something. Anyway adding the missing push and pop matrix calls fixes it, thanks everybody. :cool: