Efficient UV Streams

Started by
1 comment, last by Scoob Droolins 18 years, 9 months ago
I am using multi-streaming and noticed that I have to provide a UV stream for each texture stage. This seems crazy, as the UV co-ordinates are the same for each stage. Is there any way I can use the same stream to provide the UV's to all stages, or do I have to create multiple streams using the same buffer? Thanks Rael
Advertisement
You can determine, for each texture stage, which texture set gets used using the D3DTSS_TEXCOORDINDEX member of D3DTEXTURESTAGESTATE. For example:

device->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0);

...binds the first uv set to the second texture stage.

You can have multiple UV sets in a single stream - use 4 sets per stream, for example, to minmize the number of streams. Beware that multiple streams will cost performance. Also note that Coder's solution will not work with ps1.x - you must directly map tc index to stream (0->0, 1->1, etc).

This topic is closed to new replies.

Advertisement