Archived

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

2do

one vertex array, different materials

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 -

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites