C# Class open3mod.SceneRendererShared

Shared utility class for SceneRendererClassicGl and SceneRendererModernGl that encapsulates logic to traverse the scene graph, determine rendering passes and finally produce draw calls which are then dispatched to the (deriving) renderer implementation.
Exibir arquivo Open project: acgessler/open3mod

Protected Properties

Property Type Description
InitposeMax Vector3
InitposeMin Vector3
IsAlphaMaterial bool[]
Owner Scene
Skinner open3mod.CpuSkinningEvaluator

Protected Methods

Method Description
DrawAlphaMeshes ( Assimp.Node node, Dictionary visibleNodes, RenderFlags flags, bool animated ) : void

Draw the semi-transparent meshes pertaining to a node

DrawMesh ( Assimp.Node node, bool animated, bool showGhost, int index, Mesh mesh, RenderFlags flags ) : bool

Obtains a lock on a mesh and draws it. Also handles mesh overrides.

DrawOpaqueMeshes ( Assimp.Node node, Dictionary visibleMeshesByNode, RenderFlags flags, bool animated ) : bool

Draw the opaque (i.e. not semi-transparent) meshes pertaining to a node and checks whether the node has any semi-transparent meshes to be drawn later.

InternDrawMesh ( Assimp.Node node, bool animated, bool showGhost, int index, Mesh mesh, RenderFlags flags ) : bool

Abstract method to draw a mesh attached to a node. This is to be implemented by whichever rendering method should be used. The thread is guaranteed to own the monitor for the |mesh|, making read access to the mesh safe.

PopWorld ( ) : void
PushWorld ( Matrix4 &world ) : void
RecursiveRender ( Assimp.Node node, Dictionary visibleMeshesByNode, RenderFlags flags, bool animated ) : bool

Recursive rendering function

RecursiveRenderWithAlpha ( Assimp.Node node, Dictionary visibleNodes, RenderFlags flags, bool animated ) : void

Recursive rendering function for semi-transparent (i.e. alpha-blended) meshes. Alpha blending is not globally on, meshes need to do that on their own. This render function is called _after_ solid geometry has been drawn, so the relative order between transparent and opaque geometry is maintained. There is no further ordering within the alpha rendering pass.

SceneRendererShared ( Scene owner, Vector3 initposeMin, Vector3 initposeMax ) : System

Constructs an instance given a scene with its bounds (AABB)

UploadTextures ( ) : void

Make sure all textures required for the materials in the scene are uploaded to VRAM.

Method Details

DrawAlphaMeshes() protected method

Draw the semi-transparent meshes pertaining to a node
protected DrawAlphaMeshes ( Assimp.Node node, Dictionary visibleNodes, RenderFlags flags, bool animated ) : void
node Assimp.Node
visibleNodes Dictionary
flags RenderFlags
animated bool
return void

DrawMesh() protected method

Obtains a lock on a mesh and draws it. Also handles mesh overrides.
protected DrawMesh ( Assimp.Node node, bool animated, bool showGhost, int index, Mesh mesh, RenderFlags flags ) : bool
node Assimp.Node
animated bool
showGhost bool
index int
mesh Assimp.Mesh
flags RenderFlags
return bool

DrawOpaqueMeshes() protected method

Draw the opaque (i.e. not semi-transparent) meshes pertaining to a node and checks whether the node has any semi-transparent meshes to be drawn later.
protected DrawOpaqueMeshes ( Assimp.Node node, Dictionary visibleMeshesByNode, RenderFlags flags, bool animated ) : bool
node Assimp.Node
visibleMeshesByNode Dictionary
flags RenderFlags
animated bool
return bool

InternDrawMesh() protected abstract method

Abstract method to draw a mesh attached to a node. This is to be implemented by whichever rendering method should be used. The thread is guaranteed to own the monitor for the |mesh|, making read access to the mesh safe.
protected abstract InternDrawMesh ( Assimp.Node node, bool animated, bool showGhost, int index, Mesh mesh, RenderFlags flags ) : bool
node Assimp.Node
animated bool
showGhost bool
index int
mesh Assimp.Mesh
flags RenderFlags
return bool

PopWorld() protected abstract method

protected abstract PopWorld ( ) : void
return void

PushWorld() protected abstract method

protected abstract PushWorld ( Matrix4 &world ) : void
world Matrix4
return void

RecursiveRender() protected method

Recursive rendering function
protected RecursiveRender ( Assimp.Node node, Dictionary visibleMeshesByNode, RenderFlags flags, bool animated ) : bool
node Assimp.Node Current node
visibleMeshesByNode Dictionary
flags RenderFlags Rendering flags
animated bool Play animation?
return bool

RecursiveRenderWithAlpha() protected method

Recursive rendering function for semi-transparent (i.e. alpha-blended) meshes. Alpha blending is not globally on, meshes need to do that on their own. This render function is called _after_ solid geometry has been drawn, so the relative order between transparent and opaque geometry is maintained. There is no further ordering within the alpha rendering pass.
protected RecursiveRenderWithAlpha ( Assimp.Node node, Dictionary visibleNodes, RenderFlags flags, bool animated ) : void
node Assimp.Node Current node
visibleNodes Dictionary Set of visible meshes
flags RenderFlags Rendering flags
animated bool Play animation?
return void

SceneRendererShared() protected method

Constructs an instance given a scene with its bounds (AABB)
protected SceneRendererShared ( Scene owner, Vector3 initposeMin, Vector3 initposeMax ) : System
owner Scene
initposeMin Vector3
initposeMax Vector3
return System

UploadTextures() protected method

Make sure all textures required for the materials in the scene are uploaded to VRAM.
protected UploadTextures ( ) : void
return void

Property Details

InitposeMax protected_oe property

protected Vector3 InitposeMax
return Vector3

InitposeMin protected_oe property

protected Vector3 InitposeMin
return Vector3

IsAlphaMaterial protected_oe property

protected bool[] IsAlphaMaterial
return bool[]

Owner protected_oe property

protected Scene Owner
return Scene

Skinner protected_oe property

protected CpuSkinningEvaluator,open3mod Skinner
return open3mod.CpuSkinningEvaluator