Entity states: static and dynamic
Entities can be either static or dynamic.
Static entities are faster to render and to process than the dynamic:
- Dynamic entities: lighting and shadowing is performed in real-time. Which means that for every light (dynamic or static lights) around dynamic entities, lighting shaders will be executed to compute how these lights affect the entity. Once it is declared as dynamic, we never know when they'll move therefore we can't pre-calculate lighting.
- Static entities: instead of computing every nearby light source, static entities will have all static lights pre-rendered to a lightmap. Combining static entities and static light sources make lighting effects very cheap for the GPU.
Entity callback functions also behave differently on static and dynamic entities:
- Dynamic entity callbacks: functions are called once every frame for each dynamic entity. It doesn't matter if it is being rendered or not.
- Static entity callbacks: callback for static entities are only called if the entity is visible (if its parent visibility bucket is active).
Notice that dynamic lights will shade static entities dynamically. Remember that "free lights" only happen if static entities are lit by static lights (lights with static parent entity).
Entity state may be enabled in the Entity Editor.
-
Highlight the Static entity toggle button in order to make it static. Disabling it will turn the entity dynamic.