Jump to content
  • Advertisement


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


Texture coordinates and texture stages

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

Hi i just read somewhere that you can assign more than one texture coordinate per vertex. If so could some tell me how to add the extra texture coordinates to a vertex structure, eg struct CUSTOMVERTEX { float x,y,z, tu,tv //would i just keep adding more tu2,tv2, tu3, tv3 }; and how would i work the fvf? thanksm

Share this post

Link to post
Share on other sites

In TEXn you replace n with the number of coordinates.

In TEXCOORDSIZEa(b) replace a with a size 1, 2, 3, or 4, and b identifies which coordinate you''re setting the size of. They default to 2.

For example:
u1,v1, u2, v2, w2, u3

You must then SetTextureStageState(n, D3DTSS_TEXCOORDINDEX, m)
which says on stage n, use texture coordiante set m. In addition to the UVs you''ve created you can ask D3D to provide you with normals, reflection vectors, or positions using this call.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!