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


Rendering in DX8

Recommended Posts

zalian    122
Hi! I wish someone would tell me how do I implement function which renders objects with more than one texture. I have exported data from 3dsmax that gives me an opportunity to have more than one uv coordinate in one vertex. (I mean that every face could have its own texture.) I know how to do it if object has only one texture. How do I set the index buffer and vertex buffer to work with multiple textures in one object? Thanks. Edited by - zalian on March 15, 2001 7:27:28 AM

Share this post

Link to post
Share on other sites
Tessellator    1394
Unfortunately, you are unable to change texture mid vertex stream. This means you have to group the polygons together that use the same texture. The DrawIndexedPrimitve() method can be used to draw only parts of a vertex buffer. So you could do this:

+ Set the vertex buffer

+ Set the index buffer

+ Set a first texture

+ Draw some of the vertex buffer

+ Set a second texture

+ Draw some more of the vertex buffer

+ etc

I remember asking the exact same question when I first started using D3D. It is a pain in the butt.


Share this post

Link to post
Share on other sites
dooz    271
You''re better off trying to seperate the rendering and the transformation part of your engine, for the simple reason that you''re probably end up drawing different textures/materials at different times (ie first the opaque, later the transparent) anyway.

For each object in my list I have a list of "face blocks" where each face block contains the material name, vertex data etc, and a pointer back to the actual object.. (clipping etc is done on a per object basis)..


Share this post

Link to post
Share on other sites