Table of Contents

Class EntityRenderer

Namespace
Vintagestory.API.Common.Entities
Assembly
VintagestoryAPI.dll

Base class for entity rendering

public abstract class EntityRenderer
Inheritance
EntityRenderer
Inherited Members
Extension Methods

Constructors

EntityRenderer(Entity, ICoreClientAPI)

Creates a new entity renderer instance

public EntityRenderer(Entity entity, ICoreClientAPI api)

Parameters

entity Entity
api ICoreClientAPI

Fields

capi

A reference to the client api

public ICoreClientAPI capi

Field Value

ICoreClientAPI

entity

The current entity

public Entity entity

Field Value

Entity

Methods

BeforeRender(float)

Called before in-world rendering starts

public virtual void BeforeRender(float dt)

Parameters

dt float

Dispose()

Should free up all the resources

public abstract void Dispose()

DoRender2D(float)

Ortho mode draw call for 2d gui stuff, like name tags. Gui shader initialized already.

public virtual void DoRender2D(float dt)

Parameters

dt float

DoRender3DAfterOIT(float, bool)

public virtual void DoRender3DAfterOIT(float dt, bool isShadowPass)

Parameters

dt float
isShadowPass bool

DoRender3DOIT(float)

Render call for the transparent pass

public virtual void DoRender3DOIT(float dt)

Parameters

dt float

DoRender3DOITBatched(float)

Batched render call for the transparent pass

public virtual void DoRender3DOITBatched(float dt)

Parameters

dt float

DoRender3DOpaque(float, bool)

Draw call with no shader initialized

public virtual void DoRender3DOpaque(float dt, bool isShadowPass)

Parameters

dt float
isShadowPass bool

DoRender3DOpaqueBatched(float, bool)

Draw call with the Entityanimated shader loaded and initialized with the correct color/fog/sunlight/texture values If shadows are enabled, then this method is called again with shadowmap shader intialized

public virtual void DoRender3DOpaqueBatched(float dt, bool isShadowPass)

Parameters

dt float
isShadowPass bool

OnEntityLoaded()

Called when the entity is now fully either spawned or fully loaded

public virtual void OnEntityLoaded()

RenderToGui(float, double, double, double, float, float)

Called before gui rendering starts. Drawing of the whole model into a gui dialog. Gui shader initialized already.

public virtual void RenderToGui(float dt, double posX, double posY, double posZ, float yawDelta, float size)

Parameters

dt float
posX double
posY double
posZ double
yawDelta float
size float