one vertex array, different materials

Started by
2 comments, last by 2do 21 years, 9 months ago
Hi! I would like to render one VertexArray with more materials. Is this somehow possible or should i split my arrays for each material? the whole thing should be extension independent... Hmm. Dunno how to do that. Any ideas? I''m very new into vertex arrays.. i mostly used immediate mode. i have to split for every texture too, right? TIA
Advertisement
Hmmm.. instead of splitting your vertex-array you can put the two textures into one.

For materials you need to draw all triangles that use a single material seperately. You can use one giant vertex array, but each call to DrawElements/Arrays uses the current material, the current set of lights (up to max lights) and the current set of textures (however many textures a card can do per pass).

------------
- outRider -
quote:should i split my arrays for each material?


Yes

quote:i have to split for every texture too, right?


..and yes

Think of it like this. A material is not only a color, it is a texture also.

This topic is closed to new replies.

Advertisement