SoAlphaTest(3)

NAME
SoAlphaTest - The SoAlphaTest class is a node used to control the GL alpha test function.

SYNOPSIS

#include <Inventor/nodes/SoAlphaTest.h>

Inherits SoNode.

  Public Types
enum Function { NONE, NEVER, ALWAYS, LESS, LEQUAL, EQUAL, GEQUAL, GREATER, NOTEQUAL }

  Public Member Functions
virtual SoType getTypeId (void) const
SoAlphaTest (void)
virtual void GLRender (SoGLRenderAction *action)

  Static Public Member Functions
static SoType getClassTypeId (void)
static void initClass (void)
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

  Public Attributes
SoSFEnum function
SoSFFloat value

  Protected Member Functions
virtual const SoFieldData * getFieldData (void) const
virtual ~SoAlphaTest ()

  Static Protected Member Functions
static const SoFieldData ** getFieldDataPtr (void)

  Additional Inherited Members

Detailed Description

The SoAlphaTest class is a node used to control the GL alpha test function. With this node you can control the OpenGL alpha test function. The alpha test function enables you to discard fragments based on its alpha value. For instance, if you set the function to GREATER and value to 0.5, only fragments with alpha value greater than 0.5 will be rendered.

Alpha testing is typically used when rendering textures where all pixels are either completely opaque or completely transparent. Transparency sorting problems are avoided when alpha testing is used instead of blending, since depth testing can still be enabled and no sorting or delayed rendering is needed.

To enable alpha testing instead of transparency blending, insert a TransparencyType node with value = NONE, and an AlphaTest node with function set to GREATER and value set to for instance 0.01.

FILE FORMAT/DEFAULTS:

AlphaTest {
    function NONE
    value 0.5
}

Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Since
    Coin 4.0

Member Enumeration Documentation

  enum SoAlphaTest::Function
Enumeration for the various alpha functions.

Enumerator

NONE
    No alpha test is performed.

NEVER
    Never passes.

ALWAYS
    Always passes.

LESS
    Passes if the incoming alpha value is less than the stored alpha value.

LEQUAL
    Passes if the incoming alpha value is less than or equal to the stored alpha value.

EQUAL
    Passes if the incoming alpha value is equal to the stored alpha value.

GEQUAL
    Passes if the incoming alpha value is greater than or equal to the stored alpha value.

GREATER
    Passes if the incoming alpha value is greater than the stored alpha value.

NOTEQUAL
    Passes if the incoming alpha value is not equal to the stored alpha value.

Constructor & Destructor Documentation

  SoAlphaTest::SoAlphaTest (void)
Constructor.

  SoAlphaTest::~SoAlphaTest () [protected], [virtual]
Destructor.

Member Function Documentation

  SoType SoAlphaTest::getClassTypeId (void) [static]
This static method returns the SoType object associated with objects of this class.

  SoType SoAlphaTest::getTypeId (void) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and 'downward' casting.

Implements SoBase.

  const SoFieldData ** SoAlphaTest::getFieldDataPtr (void) [static], [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
 Returns the SoFieldData class which holds information about fields in this node.

  const SoFieldData * SoAlphaTest::getFieldData (void) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

Reimplemented from SoFieldContainer.

  void SoAlphaTest::GLRender (SoGLRenderAction * action) [virtual]
Action method for the SoGLRenderAction.

This is called during rendering traversals. Nodes influencing the rendering state in any way or want to throw geometry primitives at OpenGL override this method.

Reimplemented from SoNode.

Member Data Documentation

  SoSFEnum SoAlphaTest::function
Which alpha function to use. Defaults to NONE.

  SoSFFloat SoAlphaTest::value
The value the function will compare against when applicable. Default is 0.5.

Author

Generated automatically by Doxygen for Coin from the source code.