Jump to content
  • Advertisement
Sign in to follow this  
subsonix

OpenGL Gourad shaing + 2D primitives

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

The 3d engine I'm trying to build draws polys using 2D opengl functions. It doesn't use opengl's matrix operations. Is there any way to combine the glTexCoord and glColor functions so I can shade primitives?

Share this post


Link to post
Share on other sites
Advertisement
using glColor.(..) will work if u have lighting turned off, if its turned on then u need to use colormaterials

Share this post


Link to post
Share on other sites
Yes, by default the vertex colour is modulated (multiplied) by the texture colour. If you want other operations to combine the two then various extensions (including fragment shaders) will let you do that.

It begs the question why you're not using OpenGL's matrix stacks for a 3d engine though, you're letting a sizable chunk of your graphics card silicon sit idle.

Share this post


Link to post
Share on other sites
and there is another option if u don't need or don't want to use shaders. check out at opengl specs and you will find at least 4 modes of combining texture data with vertex colors. the default is modulate, but there can be replace, too, and there are others. just check it out

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.

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

Sign me up!