Jump to content
  • Advertisement
Sign in to follow this  
nickwinters

OpenGL OpenGL compared with DX Materials

This topic is 4993 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

So in DirectX, the "preferred" way to do color of primitives is to set a material. Is there an equivalent to this in OpenGL? The reason I'm asking is my friends and I are designing an engine, and we want to support both OpenGL and D3D. Thanks. -Nick

Share this post


Link to post
Share on other sites
Advertisement
google for glMaterial();
And you'd better buy yourself a book if you want to know all the things possible, especially those needed for a DirectX/OpenGL choosable Graphics library.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by nickwinters
Sweet. So with OpenGL materials, do you not specify a color for each vertex like in DX?

That depends, OpenGL materials offer a lot of possibilities. They were initially designed to work with OpenGL's hardware lighting, you can use glColorMaterial to specify material properties per vertex.

Please keep in mind that the whole notion of OpenGL and Direct3D materials has become obsolete with the introduction of vertex and fragment shaders, where surface properties are defined in terms of shaders and custom shader parameters.

Share this post


Link to post
Share on other sites
Beware, 'Beginning OpenGL Game Programming' doesn't explain all the functions very good, but it brings structure in what you could have learned from tutorials. The autors preceding book, 'OpenGL Game Programming' is much more complete, but much bigger and a bit more expensive.

EDIT: I think you need special hardware support for these, or isn't it?

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!