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


Texture wrapping problem

Recommended Posts

Greetings! I have a weird problem with texture wrapping. I''m using DX 8.1 SDK, but DX 9.0 is installed (I think it shouldn''t be a problem). I program in VC++. I haven''t installed the debug runtimes with the SDK of course. The problem: I enable texture wrapping in both U and V direction, because I draw a torus (with a single triangle strip). Everything is OK, except those triangles which don''t have neighbouring triangles on the 0.0-1.0 side. Those triangles aren''t textured properly, the texture isn''t wrapped. For example: buggy triangle''s texture coordinates ( (0.1,0.9),(0.1,0.0),(0.3,0.0) ) neighbouring triangle ( (0.1,0.0),(0.3,0.0),(0.3,0.1) ) When the second triangle is displayed, wrapping is OK. When the second disappears, wrapping does not occur. What do I do wrong? Are there any special sequence in setting render states, textures, shaders? I discovered another weird thing. When I output the same texture coordinates to oT1 (after oT0) but I don''t load it in the PS, texture wrapping is disabled. So the only difference is the mov oT1,v2 line added in the VS, PS remains the same. I have an ATI 8500LE card, if it helps. Thanks

Share this post

Link to post
Share on other sites
Well, after some experimenting...

If I use PS 1.3 and load t1, everything works!
If I use PS 1.4, texture wrapping is disabled!

So VS outputs texture coordinates:
mov oT0.xy,v2
mov oT1.xy,v2

PS 1.3 (which works well):

tex t0
tex t1 ;if I leave this out, the above mentioned effect occurs
add r0,v1,t0

PS 1.4 (which doesn''t work):

texld r0,t0
;here doesn''t matter another texld r1,t0 or texld r1,t1
add r0,v1,r0

I initialize both the 0th and 1st texture stage with the same texture.

I hope someone can help me.

Share this post

Link to post
Share on other sites