I started to create a puzzle-bobble like in OpenGL and I want to draw some little sphere in one color, transparent and without any texture (to win some frame per sec). I have no problem to draw any mesh with 32 bits texture but I can not draw a sphere with smooth shading, a 4 channels color and no texture.
I use glColor(); before sending vertices to my 3d card via glBegin. I tried to change the ambient value of my light but it doesn’t resolve my problem. I checked many tutorials but there isn’t a tutorial on alpha blending w/o texture and lighting …
if someone did it in the past or have an iD …
once after you init OpenGL and then you can use Color* to specify the color and alpha for your polys.
glMaterial* will also work but is a more expensive operation.
thanks RandyU and BK,
I tried first the glMaterial method but as BK said it’s expensive so I gonna implement the second.
Try using glColor4x() after glBegin(). I have been able to do stuff like that with no problems! Perhaps you have an old video driver?
If you’re using lighting, the alpha value that results from lighting is the alpha of your diffuse material.
Don’t use color material unless you have to.
It is preferable to set the color outside a Begin/End. (Setting Material inside a Begin/End is also allowed but is very bad practice. Use ColorMaterial if you really, really, really have to change your material per-vertex.)
So Matt, are you saying that glMaterial is preferable to Using ColorMaterial for per object colour changes? (as opposed to per polygon, or per vertex).