Skip to content

EntityStatic

Narta Xaymar Dirks edited this page Oct 30, 2026 · 1 revision
BlitzLLVM

EntityStatic 〔BlitzLLVM〕

EntityStatic:Void entity:Int32, is_static:Int32
Parameter Mode Type Default Description
entity In Int32 required The entity.
is_static In Int32 required -1 for never static, 0 to let the renderer decide (default), 1 for always static.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

Tells the renderer whether a mesh is static, which is a mesh that the program leaves as it is for a long time. The renderer can draw such meshes in a cheaper way (see GPU-Driven-Draws), and by default it finds them by itself: a mesh that was not touched for four frames is treated as static. This command lets the program decide instead.

  • -1 (never): the mesh is never treated as static. Use it for a mesh that the program changes now and then, but never for long enough to be worth keeping.
  • 0 (auto): the renderer decides. This is the default, and what happens without the command.
  • 1 (always): the mesh is treated as static as soon as it can be, without waiting for the four untouched frames. Use it for scenery that is placed once, like trees, rocks or the walls of a room.

Any other value counts by its sign. The setting is kept by CopyEntity, and it changes nothing about what is drawn: only the way the mesh is drawn changes, and only while BLITZLLVM_GPU_DRAWS=1 is set. Without that the command does nothing.

Always is no promise that the mesh stays where it is. When a command moves, turns, scales or re-parents an always static mesh (PositionEntity, TranslateEntity, MoveEntity, RotateEntity, TurnEntity, ScaleEntity, PointEntity, AlignToVector, EntityParent, or the collisions pushing it), the setting goes back to 0 (auto): the mesh was not static after all, and from then on the renderer decides again, with the wait of four untouched frames. Call EntityStatic with 1 again to make it always static. Other commands that only change how it looks (EntityColor, HideEntity, EntityTexture, ...) leave the setting alone. Nothing the program does shows up late or not at all: every command on the mesh takes it out of the kept data right away, and the next frame draws it as the program left it. A mesh that is moved every frame is therefore drawn the usual way; -1 (never) avoids the small cost of looking at it for the table. An always static mesh that can not be drawn from the kept data at all, like a sprite, a see-through mesh, a parented or animated mesh, is drawn as always: the command can not make these static.

Differences

  • The original has no such command. This is an extension; programs that use it do not compile with the original Blitz3D.

Examples

Graphics3D 640, 480, 32, 2
camera = CreateCamera()
light = CreateLight()
PositionEntity camera, 0, 2, -10

; Scenery that never moves, in the kept data from the first frame on.
For i = 0 To 999
	tree = CreateCube()
	PositionEntity tree, (i Mod 40) * 2 - 40, 0, (i / 40) * 2
	EntityStatic tree, 1
Next

; A door that opens now and then must not wait to be treated as moving.
door = CreateCube()
EntityStatic door, -1

Related Commands

EntityAlpha, EntityAutoFade, EntityBlend, EntityClass, EntityColor, EntityDepthFade 〔BlitzLLVM〕, EntityDistance, EntityFX

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally