Sign in to follow this  
nickwinters

OpenGL OpenGL compared with DX Materials

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this