IRenderNode

Represents a rendered object in the world. More...

#include

Inherits IShadowCaster.

Inherited by IBreakableGlassRenderNode, IBrush, ICharacterRenderNode, ICloudBlockerRenderNode, IDecalRenderNode, IDistanceCloudRenderNode, IFogVolumeRenderNode, IGeomCacheRenderNode, ILightSource, IParticleEmitter, IRoadRenderNode, IRopeRenderNode, IVegetation, IVoxelObject, and IWaterVolumeRenderNode.

Public Types

enum EInternalFlags : uint8 {
DECAL_OWNER = BIT(0), REQUIRES_NEAREST_CUBEMAP = BIT(1), UPDATE_DECALS = BIT(2), REQUIRES_FORWARD_RENDERING = BIT(3),
WAS_INVISIBLE = BIT(4), WAS_IN_VISAREA = BIT(5), WAS_FARAWAY = BIT(6), HAS_OCCLUSION_PROXY = BIT(7)
}
enum EGIMode {
eGM_None = 0, eGM_StaticVoxelization, eGM_DynamicVoxelization, eGM_HideIfGiIsActive,
eGM_AnalyticalProxy_Soft, eGM_AnalyticalProxy_Hard, eGM_AnalytPostOccluder, eGM_IntegrateIntoTerrain
}
Object can be used by GI system in several ways. More...
typedef uint64 RenderFlagsType

Public Member Functions

virtual bool CanExecuteRenderAsJob ()
virtual const char * GetName () const =0
Debug info about object.
virtual const char * GetEntityClassName () const =0
virtual string GetDebugString (char type=0) const
virtual float GetImportance () const
virtual void ReleaseNode (bool bImmediate=false)
Releases IRenderNode.
virtual IRenderNode * Clone () const
virtual void SetMatrix (const Matrix34 &mat)
Sets render node transformation matrix.
virtual void GetLocalBounds (AABB &bbox)
Gets local bounds of the render node.
virtual Vec3 GetPos (bool bWorldOnly=true) const =0
virtual const AABB GetBBox () const =0
virtual void FillBBox (AABB &aabb)
virtual void SetBBox (const AABB &WSBBox)=0
virtual void OffsetPosition (const Vec3 &delta)=0
virtual void Render (const struct SRendParams &EntDrawParams, const SRenderingPassInfo &passInfo)=0
Renders node geometry.
virtual void Hide (bool bHide)
Hides/disables node in renderer.
virtual IStatObj * GetEntityStatObj (unsigned int nSubPartId=0, Matrix34A *pMatrix=NULL, bool bReturnOnlyVisible=false)
Gives access to object components.
virtual void SetEntityStatObj (IStatObj *pStatObj, const Matrix34A *pMatrix=NULL)
virtual ICharacterInstance * GetEntityCharacter (Matrix34A *pMatrix=NULL, bool bReturnOnlyVisible=false)
Retrieve access to the character instance of the the RenderNode.
virtual struct IGeomCacheRenderNode * GetGeomCacheRenderNode (unsigned int nSlot, Matrix34A *pMatrix=NULL, bool bReturnOnlyVisible=false)
virtual struct IRenderMesh * GetRenderMesh (int nLod)
virtual void SetLodRatio (int nLodRatio)
virtual uint8 GetMaterialLayers () const
Get material layers mask.
virtual struct IPhysicalEntity * GetPhysics () const =0
Get physical entity.
virtual void SetPhysics (IPhysicalEntity *pPhys)=0
virtual void CheckPhysicalized ()
Physicalizes if it isn't already.
virtual void Physicalize (bool bInstant=false)
Physicalize the node.
virtual bool PhysicalizeFoliage (bool bPhysicalize=true, int iSource=0, int nSlot=0)
Physicalize stat object's foliage.
virtual IPhysicalEntity * GetBranchPhys (int idx, int nSlot=0)
Get physical entity (rope) for a given branch (if foliage is physicalized).
virtual struct IFoliage * GetFoliage (int nSlot=0)
virtual ~IRenderNode ()
Make sure I3DEngine::FreeRenderNodeState(this) is called in destructor of derived class.
virtual void SetMaterial (IMaterial *pMat)=0
Set override material for this instance.
virtual IMaterial * GetMaterial (Vec3 *pHitPos=NULL) const =0
Queries override material of this instance.
virtual IMaterial * GetMaterialOverride ()=0
virtual void SetCollisionClassIndex (int tableIndex)
Used by the editor during export.
virtual void SetStatObjGroupIndex (int nVegetationGroupIndex)
virtual int GetStatObjGroupId () const
virtual void SetLayerId (uint16 nLayerId)
virtual uint16 GetLayerId ()
virtual float GetMaxViewDist ()=0
virtual EERType GetRenderNodeType ()=0
virtual bool IsAllocatedOutsideOf3DEngineDLL ()
virtual void Dephysicalize (bool bKeepIfReferenced=false)
virtual void Dematerialize ()
virtual void GetMemoryUsage (ICrySizer *pSizer) const =0
virtual void Precache ()
virtual void UpdateStreamingPriority (const SUpdateStreamingPriorityContext &streamingContext)
virtual const AABB GetBBoxVirtual ()
virtual void OnRenderNodeBecomeVisibleAsync (SRenderNodeTempData *pTempData, const SRenderingPassInfo &passInfo)
virtual void OnRenderNodeVisible (bool bBecomeVisible)
Called when RenderNode becomes visible or invisible, can only be called from the Main thread.
virtual uint8 GetSortPriority ()
virtual EGIMode GetGIMode () const
Retrieves the way object is used by GI system.
virtual void SetMinSpec (RenderFlagsType nMinSpec)
virtual void SetViewDistRatio (int nViewDistRatio)
void CopyIRenderNodeData (IRenderNode *pDest) const
ILINE void SetRndFlags (RenderFlagsType dwFlags)
Rendering flags. (. More...
ILINE void SetRndFlags (RenderFlagsType dwFlags, bool bEnable)
ILINE RenderFlagsType GetRndFlags () const
ILINE void SetDrawFrame (int nFrameID, int nRecursionLevel)
Object draw frames (set if was drawn).
ILINE int GetDrawFrame (int nRecursionLevel=0) const
ILINE IVisArea * GetEntityVisArea () const
struct CTerrainNode * GetEntityTerrainNode () const
ILINE void SetViewDistUnlimited ()
Makes object visible at any distance.
ILINE int GetViewDistRatio () const
Retrieves the view distance settings.
ILINE int GetViewDistRatioVal () const
Retrieves the view distance settings without any value interpretation.
ILINE float GetViewDistRatioNormilized () const
ILINE int GetLodRatio () const
ILINE float GetLodRatioNormalized () const
virtual bool GetLodDistances (const SFrameLodInfo &frameLodInfo, float *distances) const
virtual void SetShadowLodBias (int8 nShadowLodBias)
Bias value to add to the regular lod.
ILINE int GetShadowLodBias () const
virtual void SetCameraSpacePos (Vec3 *pCameraSpacePos)
ILINE void SetMaterialLayers (uint8 nMtlLayers)
Set material layers mask.
ILINE int GetMinSpec () const
ILINE void InvalidatePermanentRenderObject ()
Inform 3d engine that permanent render object that captures drawing state of this node is not valid and must be recreated.
virtual void SetEditorObjectId (uint32 nEditorObjectId)
virtual void SetEditorObjectInfo (bool bSelected, bool bHighlighted)
virtual void SetOwnerEntity (IEntity *pEntity)
virtual IEntity * GetOwnerEntity () const
void RemoveAndMarkForAutoDeleteTempData ()

Static Public Member Functions

static const ERNListType GetRenderNodeListId (const EERType eRType)

Public Attributes

IRenderNode * m_pNext
Every sector has linked list of IRenderNode objects.
IRenderNode * m_pPrev
IOctreeNode * m_pOcNode
Current objects tree cell.
std::atomic< SRenderNodeTempData * > m_pTempData
Pointer to temporary data allocated only for currently visible objects.
int m_manipulationFrame = -1
CryRWLock m_manipulationLock
uint32 m_nHUDSilhouettesParam
Hud silhouette parameter, default is black with alpha zero.
float m_fWSMaxViewDist
Max view distance.
RenderFlagsType m_dwRndFlags
Render flags (. More...
uint8 m_nInternalFlags
Flags for render node internal usage, one or more bits from EInternalFlags.
uint8 m_ucViewDistRatio
Max view distance settings.
uint8 m_ucLodRatio
LOD settings.
uint8 m_nMaterialLayers
Material layers bitmask -> which material layers are active.
int8 m_cShadowLodBias
uint32 m_nEditorSelectionID

Static Public Attributes

static const int8 SHADOW_LODBIAS_DISABLE = -128

Detailed Description

Represents a rendered object in the world.

To visualize objects in a world CRYENGINE defines the concept of render nodes and render elements. Render nodes represent general objects in the 3D engine. Among other things they are used to build a hierarchy for visibility culling, allow physics interactions (optional) and rendering. For actual rendering they add themselves to the renderer (with the help of render objects as you can see in the sample code below) passing an appropriate render element which implements the actual drawing of the object.

Member Enumeration Documentation

◆ EGIMode

Object can be used by GI system in several ways.

Enumerator
eGM_None

No voxelization.

eGM_StaticVoxelization

Incremental or asynchronous lazy voxelization.

eGM_DynamicVoxelization

Real-time every-frame voxelization on GPU.

eGM_HideIfGiIsActive

Hide this light source if GI is enabled.

eGM_AnalyticalProxy_Soft

Analytical proxy (with shadow fading)

eGM_AnalyticalProxy_Hard

Analytical proxy (no shadow fading)

eGM_AnalytPostOccluder

Analytical occluder (used with average light direction)

eGM_IntegrateIntoTerrain

Copy object mesh into terrain mesh and render using usual terrain materials.

◆ EInternalFlags

Enumerator
DECAL_OWNER

Owns some decals.

REQUIRES_NEAREST_CUBEMAP

Pick nearest cube map.

UPDATE_DECALS

The node changed geometry - decals must be updated.

REQUIRES_FORWARD_RENDERING

Special shadow processing needed.

WAS_INVISIBLE

Was invisible last frame.

WAS_IN_VISAREA

Was inside vis-ares last frame.

WAS_FARAWAY

Was considered 'far away' for the purposes of physics deactivation.

HAS_OCCLUSION_PROXY

This node has occlusion proxy.

Member Function Documentation

◆ GetEntityTerrainNode()

struct CTerrainNode* IRenderNode::GetEntityTerrainNode ( ) const
inline
Returns
Current VisArea or null if in outdoors or entity was not registered in 3Dengine.

◆ GetEntityVisArea()

ILINE IVisArea* IRenderNode::GetEntityVisArea ( ) const
inline
Returns
Current VisArea or null if in outdoors or entity was not registered in 3Dengine.

◆ GetFoliage()

virtual struct IFoliage* IRenderNode::GetFoliage ( int nSlot = 0)
inline
virtual
Returns
Physicalized foliage, or NULL if it isn't physicalized.

◆ GetLodRatio()

ILINE int IRenderNode::GetLodRatio ( ) const
inline
Returns
Lod distance ratio.

◆ GetLodRatioNormalized()

ILINE float IRenderNode::GetLodRatioNormalized ( ) const
inline
Returns
Lod distance ratio

◆ GetRenderMesh()

virtual struct IRenderMesh* IRenderNode::GetRenderMesh ( int nLod)
inline
virtual
Returns
IRenderMesh of the object.

◆ GetShadowLodBias()

ILINE int IRenderNode::GetShadowLodBias ( ) const
inline
Returns
Lod distance ratio.

◆ GetViewDistRatioNormilized()

ILINE float IRenderNode::GetViewDistRatioNormilized ( ) const
inline
Returns
Max view distance ratio.

◆ OffsetPosition()

virtual void IRenderNode::OffsetPosition ( const Vec3 & delta)
pure virtual

Changes the world coordinates position of this node by delta. Don't forget to call this base function when overriding it.

◆ OnRenderNodeBecomeVisibleAsync()

virtual void IRenderNode::OnRenderNodeBecomeVisibleAsync ( SRenderNodeTempData * pTempData,
const SRenderingPassInfo & passInfo
)
inline
virtual

Called immediately when render node becomes visible from any thread. Not reentrant, multiple simultaneous calls to this method on the same rendernode from multiple threads is not supported and should not happen

◆ SetCameraSpacePos()

virtual void IRenderNode::SetCameraSpacePos ( Vec3 * pCameraSpacePos)
inline
virtual

Sets camera space position of the render node. Only implemented by few nodes.

◆ SetLodRatio()

virtual void IRenderNode::SetLodRatio ( int nLodRatio)
inline
virtual

Allows to adjust default lod distance settings. If fLodRatio is 100 - default lod distance is used.

◆ SetRndFlags()

ILINE void IRenderNode::SetRndFlags ( RenderFlagsType dwFlags)
inline

Rendering flags. (.

See also
ERenderNodeFlags)

◆ SetViewDistRatio()

void IRenderNode::SetViewDistRatio ( int nViewDistRatio)
inline
virtual

Allows to adjust default max view distance settings. If fMaxViewDistRatio is 100 - default max view distance is used.

Member Data Documentation

◆ m_dwRndFlags

RenderFlagsType IRenderNode::m_dwRndFlags

Render flags (.

See also
ERenderNodeFlags)

◆ m_nEditorSelectionID

uint32 IRenderNode::m_nEditorSelectionID

Selection ID used to map the rendernode to a baseobject in the editor, or differentiate between objects in highlight framebuffer This ID is split in two parts. The low 8 bits store flags such as selection and highlight state The high 24 bits store the actual ID of the object. This need not be the same as CryGUID, though the CryGUID could be used to generate it

◆ SHADOW_LODBIAS_DISABLE

const int8 IRenderNode::SHADOW_LODBIAS_DISABLE = -128
static

Shadow LOD bias. Set to SHADOW_LODBIAS_DISABLE to disable any shadow lod overrides for this rendernode.