0x326 set-3d-effect-snow
Opcode 0x326 (806), draw. Investigated by OME, with high confidence (from investigation).
(flakes)(surface_slot)(speed)(fade) — native's Set3DEffectSnow: build the display's snow effect, that many flakes of a surface slot's texture falling at a speed, fading in below the top when fade is nonzero. Nothing at all at a pixel-shader level of 0.
Operands
| # | Role | Types seen | Access |
|---|---|---|---|
| 1 | flake count | imm | read |
| 2 | surface slot whose texture the flakes draw with (an index into surface, 1000 entries, not bounds-checked) | imm | read |
| 3 | fall speed, a float: each 1/60 s step moves a flake by speed times 0.01 | imm | read-float |
| 4 | fade: nonzero fades each flake in below the top | imm | read |
In the port
OME’s port implements it. It never waits: a wait parks the engine until input, a sleep, a transition, a dialog or a movie ends. What it can do with control besides waiting:
falls: it returns to the next instruction
OME derives these facts from the port’s handler (its tools/opcode_flow.py), and they over-approximate: a fact some path can reach is given.
By build
Whether each build’s scripts use it, as OME’s survey of the game’s scripts saw them, and how many evidence items name the build.
| Build | Game | Used by its scripts | Evidence |
|---|---|---|---|
4.24J (SYS4422) | Himegari Dungeon Meister | no | — |
4.33G (SYS4433) | Kamidori Alchemy Meister | no | — |
4.38D (SYS4438) | Soukoku no Arterial | yes | 1 |
Evidence
- native-re on SYS4438, high confidence; Arterial SYS4438 Ghidra /arterial/4.38D and the complete Arterial catalog (
vm-map/opcodes.toml opcode 0x326): op_0x326_set_3d_effect_snow@0x4252f0 reads operands 2 and 4 as integers and 3 as a float and calls gfx_set_3d_effect_snow@0x417640, which acts only when the manager's +0xb62c is above 0, traces 「関数:Set3DEffectSnow エラー:テクスチャが作成されていません. TEXTURE=%d」 for a slot with no texture, and otherwise builds the effect object at the display's +0x40c (0xe4 bytes) in place of the one there, with the D3DX effect of resource 202 it builds once (+0xb580). +0xb62c is the pixel-shader level gfx_create_device_objects@0x4907f0 sets: display:PixelShader when it is 0 to 2, otherwise from the device caps. Read 2026-11-20 (snow_effect_construct@0x49bfa0 to snow_flake_draw@0x49bc30): each flake is born from four rand draws and steps 60 times a second, x and y by speed times 0.01; the draw sorts the flakes farthest first with qsort and draws each a square of the texture facing the viewer, through the display's view as it was at device setup. Only DEBUG.BIN uses it: 100 flakes, slot 0x2d, speed 1, fade on.
Details
OME’s notes on it, as the registry keeps them.
The port keeps the state in the graphics native (Graphics.Scene3D.cs), and the frame lowering draws the rain, the snow and the leaves with it where native's frame render and range present draw them, on the screen or into a render target (Graphics.Scene3DLowering.cs; docs/superpowers/specs/2026-11-20-title-leaves-design.md; docs/engine-re.md, 'The 3D scene'). Point and spot lights, a screen transition's source and a movie mask's capture keep their state and draw nothing (docs/backlog.md, 'The 3D scene's other cases are not drawn').