feat(model): ModelSceneActor SetShadowShown blob shadows

A ClassicAPI extension, off by default: actor:SetShadowShown(shown) /
IsShadowShown() put the world's blob shadow under the actor.

The shadow is 1.12's own (DrawBlobShadow 0x006D7920, reached from the
entity draw through 0x006D78F0): drawn only while shadowLOD
(0x0086F5B4) is 1 and the model is ready; the bounds of sequence (0, 0),
skipped when the x or y extent is under the range epsilon, clamped to
+-5 and multiplied by the length of the base transform's row 0
(GetBaseTransform 0x00710600); the four corners turned by the base
rotation and moved by the base translation. The texture is the one the
unit setup loads (Textures\ShadowBlob.blp, handle 0x00CE9DFC, device
object through 0x0044ACF0), with the decal's states: blend 4
(DST_COLOR / ZERO), lighting, fog and depth write off, combiner preset 5,
and the colour white with the model's alpha (GetAlpha 0x00710CA0;
0x004A2C10 packs that byte on top).

The world lays the shadow onto the ground's batches with a decal
(0x006D7330). A scene has no ground, so the paint draws the turned box
itself as a flat triangle strip on the plane of the base translation,
after the animate pass and before the draw passes, so every model draws
over the shadows. Culling is off, as for the engine's lightning quad
(0x007AFCB0). The decal's height fade and its shadowBias depth test
EQUAL are not drawn: both exist to match real ground. A model hung on
another casts none.
This commit is contained in:
Brues
2026-11-08 11:41:03 -06:00
parent 6688385cf1
commit 6600e58f2f
7 changed files with 201 additions and 1 deletions
+25
View File
@@ -880,6 +880,7 @@ build instructions.
- [`actor:AttachToActor(parent, attachmentID)`](#actorattachtoactorparent-attachmentid)
- [`actor:DetachFromActor()`](#actordetachfromactor)
- [`actor:SetPlayAnimationSounds(enabled)` / `actor:GetPlayAnimationSounds()`](#actorsetplayanimationsoundsenabled--actorgetplayanimationsounds)
- [`actor:SetShadowShown(shown)` / `actor:IsShadowShown()`](#actorsetshadowshownshown--actorisshadowshown)
- [`actor:PlaySpellVisual(spellID [, target [, castTimeMs]])`](#actorplayspellvisualspellid--target--casttimems)
- [Actor scripts](#actor-scripts)
- [`<Actor>` templates](#actor-templates)
@@ -19755,6 +19756,30 @@ wolf:SetPlayAnimationSounds(true)
wolf:SetAnimation(5) -- run
```
### `actor:SetShadowShown(shown)` / `actor:IsShadowShown()`
Shows or hides a blob shadow under the model. It is the same dark blob that
units have on the ground in the world. The default is off.
- The shadow lies flat on the plane of the actor's position, below its
feet. The scene has no ground, so the shadow does not follow a slope.
- The size of the shadow comes from the bounds of the model and from the
scale of the actor. The shadow turns with the yaw of the actor.
- The shadow darkens what is behind it. It fades with the alpha of the
actor.
- The model draws over its shadow, and over the shadows of the other
actors.
- The shadow shows only while the `shadowLOD` cvar is `1`, as in the world.
This is the default value.
- A hidden actor shows no shadow. An actor that hangs on another actor (a
seated rider, or an actor of `AttachToActor`) shows no shadow of its own.
This is a ClassicAPI extension.
```lua
mount:SetShadowShown(true)
```
### `actor:PlaySpellVisual(spellID [, target [, castTimeMs]])`
Plays the visual of a spell that this actor casts at `target`, and returns