Jump to content
  • Advertisement


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

John Morris

Mirroring Textures

This topic is 6053 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

So people, can I mirror a picture that I''m displaying as a texture on a vertex-buffered primitive without having to lock the buffer, or use a different buffer for each direction?

Share this post

Link to post
Share on other sites
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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!