Jump to content
  • Advertisement
Sign in to follow this  
Borgleader

OpenGL Displaying objects with varying attributes in OpenGL

This topic is 2341 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,

so lately I've undertaken the task of making a "simple" graphics engine or something along those lines anyway. So far I've only been working on the scene tree, or what you might call the hierarchical representation of the scene (the gun is in the hand of the marine, who is sitting in a humvee, etc).

The problem I've run into so far is how to "neatly" treat objects which don't all conform to the same specification. For example, if I have a background building that can't be seen up close by the player, I may not want to have a bump map texture or even a specular texture, but for the marine NPC standing with the player in the vehicle I would. So my question is: Is there a way to draw each object according to their attributes without having too much branching in each draw call (if(hasSpecTexture) { do this }, etc). I'll mention right now that I'm not using any shaders for the moment.

Share this post


Link to post
Share on other sites
Advertisement
Well, what are you actually changing when you draw one object with bump mapping and then one without? How are you doing the bumpmapping without shaders? Dot3? Or was that just hypothetical?

Share this post


Link to post
Share on other sites
I'm not using shaders now because I'm early in the project but I will include them later. Also the textures were just one example, other attributes will vary. My question is a general one, I want to know if there is a way to manage the variation in attributes across different objects.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!