SoAlphaTest.3coin4 - Man Page

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

Synopsis

#include <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
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting.
SoAlphaTest (void)
virtual void GLRender (SoGLRenderAction *action)

Static Public Member Functions

static SoType getClassTypeId (void)
static void initClass (void)

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

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::getTypeId (void) const [virtual]

Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. Usage example:

void foo(SoNode * node)
{
  if (node->getTypeId() == SoFile::getClassTypeId()) {
    SoFile * filenode = (SoFile *)node;  // safe downward cast, knows the type
  }
}

For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.

For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.

Implements SoBase.

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 who wants to throw geometry primitives at OpenGL overrides 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.

Info

Sat Aug 1 2020 Version 4.0.0 Coin