Blitz3D+ Command Reference

EntityColorOverlay entity,red#,green#,blue#,amount#[,emission#]

Parameters

entity - model, sprite or particle emitter handle

red# - red overlay component, clamped to 0-255
green# - green overlay component, clamped to 0-255
blue# - blue overlay component, clamped to 0-255

amount# - blend towards the overlay colour, clamped to 0-1; zero disables it

emission# (optional) - extra brightness in linear radiance; negative values become zero; 0 (default)

Description

Blends an entity's finished material colour towards a flash or status colour.

The entity's assigned materials, textures, transparency and geometry are preserved. Use it for damage flashes, invulnerability pulses, status cues or temporary recolouring. Emission can make the overlay bright enough to feed bloom when HDR rendering is enabled.

EntityColor remains the normal base-colour/tint command. A white tint leaves dark texture detail dark; a white overlay at amount 1 can make that detail white. EntityFX full-bright changes lighting instead. All three settings are independent. Changing EntityColor, EntityAlpha, EntityFX or the material while an overlay is active updates the real entity. Clearing the overlay reveals those current settings.

The command affects the entity's own surfaces. Apply it explicitly to mesh children in an imported hierarchy. Entities sharing a brush or mesh retain independent overlays; CopyEntity starts with no overlay. The setting is transient and is not saved in worlds. There is no automatic timer: update amount using elapsed seconds for a hit or pulse.

Classic materials, Standard, Unlit, Toon, Rim Light, Dissolve, Foliage, Triplanar, Parallax, Wet Surface, Snow and Hologram support the operation. Standard glass retains its transmitted background; only the local, blocked share receives the overlay. Other refractive materials and soft particles do not currently declare support. An unsupported material emits a diagnostic and keeps its existing appearance. Custom shaders must explicitly declare and implement the material-operation capability.

The overlay changes colour, not alpha-cutout holes, shadow coverage, normal maps or roughness. Fog and tone mapping still affect it. Existing EntityBlend/BrushBlend settings determine how its result blends with the scene; multiply still multiplies rather than making the background white. With neutral fog and exposure, amount 1 and emission 0 give the specified colour. Amount zero bypasses the operation exactly.

Requires Extended mode.

See also: EntityColor, EntityAlpha, EntityFX, EntityBlend, EntityShader.

Example

; Extended mode: Space triggers a fading hit flash. The original material stays assigned.
Graphics3D 800,600,0,2
SetBuffer BackBuffer()
camera=CreateCamera():PositionEntity camera,0,1,-5
light=CreateLight():RotateEntity light,35,-25,0
AmbientLight 60,60,70
crystal=CreateCylinder(6):ScaleEntity crystal,.7,1.3,.7
EntityColor crystal,45,100,160
lastTime=MilliSecs():remaining#=0
While Not KeyHit(1)
    now=MilliSecs():elapsed#=Float(now-lastTime)/1000:lastTime=now
    remaining=remaining-elapsed:If remaining<0 Then remaining=0
    If KeyHit(57) Then remaining=.6
    EntityColorOverlay crystal,255,235,180,remaining/.6
    TurnEntity crystal,0,elapsed*35,0
    RenderWorld
    Color 255,255,255:Text 12,12,"Space: hit flash | Esc: exit"
    Flip
Wend
End

Index