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

Mirroring Textures

This topic is 5774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

1. Texture transform matrices:
a) IDirect3DDevice8::SetTransform( D3DTS_TEXTUREstage, ...
b) IDirect3DDevice8::SetTextureStageState( stage, D3DTSS_TEXTURETRANSFORMFLAGS, ...

Lets you apply an arbitrary transformation matrix to the texture coordinates as they are transformed - works with software VP, works on all T&L hardware etc... - it gives you much more than just the ability to mirror - think rotations, scales, scrolling etc.


a) SetTextureStageState( stage, D3DTSS_ADDRESSU, ...
b) SetTextureStageState( stage, D3DTSS_ADDRESSV, ...

#1 is more flexible and actually tends to have wider support. Some of the more novel addressing modes aren''t supported on older hardware, and since they''re done at the texture fetch stage, they require that support to be on the silicon (which it isn''t on old cards). Texture transforms fit well into what T&L hardware is doing (i.e. lots of fast transform vector by matrix operations), they''re also supported in the software vertex processing pipe so you can do them on _any_ card.

Simon O''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites
Uhm well, I *do* use texture coordinates to select the correct frame and for scaling and rotation, however if I enter a negative scaling value the texture isn''t shown at all. So I don''t know how I''d use the texture coordinates to make mirroring.

Share this post

Link to post
Share on other sites
If you mean "What uv values do you use to make a mirrored texture on a poly?".

Then the values are 0..n, where n is
1.0 - just the single texture
2.0 - texture is tiled twice, the second one been mirrored
and so on.


tiled twice on u and v.
| * | * |
| < > |
|- - - - - - + - - - - - -|
| < > |
| * | * |

Appolgies for the ASCII art!

Edited by - Mark Duffill on February 22, 2002 4:20:12 AM

Share this post

Link to post
Share on other sites