Jump to content
  • Advertisement

Archived

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

2do

one vertex array, different materials

This topic is 5804 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!