Playing with fixed-function effects

OSG supports almost all kinds of OpenGL rendering attributes and modes by using the osg::StateAttribute derived classes. The following table is part of over 40 OSG components that encapsulate major OpenGL fixed-function states:

Type ID

Class name

Associated mode

Related OpenGL functions

ALPHAFUNC

osg::AlphaFunc

GL_ALPHA_TEST

glAlphaFunc()

BLENDFUNC

osg::BlendFunc

GL_BLEND

glBlendFunc() and glBlendFuncSeparate()

CLIPPLANE

osg::ClipPlane

GL_CLIP_PLANEi (i ranges from 0 to 5)

glClipPlane()

COLORMASK

osg::ColorMask

-

glColorMask()

CULLFACE

osg::CullFace

GL_CULLFACE

glCullFace()

DEPTH

osg::Depth

GL_DEPTH_TEST

glDepthFunc(), glDepthRange(), and glDepthMask()

FOG

osg::Fog

GL_FOG

glFog() ...

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.