FVF Problem: Can two textures use the same texture coordinates

FVF Problem: Can two textures use the same texture coordinates

Post by Franci » Tue, 10 May 2005 11:31:13


Hi everybody,
I have a problem. I want two or more textures use the same texture
coordinates. It means I hope the FVF with D3DFVF_TXT0 flag but using two
textures. Is it possible or I must use the FVF with D3DFVF_TXT1 flag?

Thanks a lot.
Francis Ko
 
 
 

FVF Problem: Can two textures use the same texture coordinates

Post by Wessam Bah » Tue, 10 May 2005 15:54:12

But there is nothing as D3DFVF_TXT0? You mean D3DFVF_TEX0?
The FVF flags describe data in your vertex to D3D. How this is actually used
is something different that is specified from elseware in D3D (Render states
and Texture stage states).
In your case, your vertex has D3DFVF_TEX1. Use D3DTSS_TEXCOORDINDEX to guide
your second texture stage to read from coordinate set 0...

SetTextureStageState(1,D3DTSS_TEXCOORDINDEX|0);

Wessam Bahnassi
Microsoft DirectX MVP,
Lead Programmer
In|Framez

 
 
 

FVF Problem: Can two textures use the same texture coordinates

Post by Franci » Tue, 10 May 2005 16:56:56

First, thank you for your reply. I am sorry to type the wrong word. My
question is can I use
the FVF with D3DFVF_TEX1 flag but two textures in the same vertex? Usually,
I must use
the FVF flag D3DFVF_TEX2 with two textures. But if the two textures use the
same texture
coordinate value (u, v), may I assign the second texture to use the first
texture coordinate
value. If I can, the vertex size will be smaller with only D3DFVF_TEX1 flag
not D3DFVF_TEX2.

"Wessam Bahnassi" < XXXX@XXXXX.COM >

used
states
guide
 
 
 

FVF Problem: Can two textures use the same texture coordinates

Post by Franci » Tue, 10 May 2005 17:14:49

OK, I see. I have success. Thank you very much!

"Francis" < XXXX@XXXXX.COM >

Usually,
the
flag



two
 
 
 

FVF Problem: Can two textures use the same texture coordinates

Post by Eyal Tele » Thu, 12 May 2005 19:05:55

> SetTextureStageState(1,D3DTSS_TEXCOORDINDEX|0);

Remember to set it back to default when you finish using it (just
saying it because I had a hard time finding that bug :).

Also note that ATI's 7x00 series has a problem with texcoordindex
settings.

Eyal