My Project
Public Types | Public Member Functions | List of all members
ParaEngine::CSortedFaceGroups Class Reference

This class provides sorting and rendering of translucent face groups. More...

#include <SortedFaceGroups.h>

Public Types

typedef std::vector< CFaceGroupInstanceFaceGroups_Type
 

Public Member Functions

void AddFaceGroup (const CFaceGroupInstance &facegroup)
 add a new face group
 
void Sort (const Vector3 &vCameraPos)
 sorting from back to front relative to a given camera position in world space. More...
 
bool IsSorted ()
 whether faces is sorted from back to front. More...
 
void Render ()
 render the face group from back to front. More...
 
void Clear ()
 clear all face group. More...
 
bool IsEmpty ()
 check if empty. More...
 

Detailed Description

This class provides sorting and rendering of translucent face groups.

Sorting is performed by face group, instead of individual face. Each face group contains one or several triangle strips, one texture, a set of rendering parameters(such as z-write, z-test, blending, etc) By default, the SceneState will disable rendering sorted face group, unless it is explicitly enabled. This prevents face group to be rendered during shadow pass or in canvas or mini scene graph.

Both StaticMesh and ParaXModel may contain translucent face group that need to be sorted very accurately before rendering. however, it is advised that we use translucent faces rarely, as it degrades rendering performance.

Member Function Documentation

§ Clear()

void ParaEngine::CSortedFaceGroups::Clear ( )

clear all face group.

this function should be called at the beginning of each frame.

§ IsEmpty()

bool ParaEngine::CSortedFaceGroups::IsEmpty ( )
inline

check if empty.

§ IsSorted()

bool ParaEngine::CSortedFaceGroups::IsSorted ( )
inline

whether faces is sorted from back to front.

§ Render()

void ParaEngine::CSortedFaceGroups::Render ( )

render the face group from back to front.

Be sure to call Sort() before calling this function.

set blending and alpha testing

turn on or off z write: z mask means disable z write

if either blending or alpha testing is enabled, we will disable back face culling.

turn on and off blending.

turn on and off alpha testing.

turn on or off z write: z mask means disable z write

uv offset

§ Sort()

void ParaEngine::CSortedFaceGroups::Sort ( const Vector3 vCameraPos)

sorting from back to front relative to a given camera position in world space.


The documentation for this class was generated from the following files: