simvx.graphics.frame_globals¶
FrameGlobals: the one per-frame global uniform block (design D4).
A single fixed 256-byte std140 block, defined ONCE here and mirrored by GLSL
(desktop) and WGSL (web) declarations that a completeness test pins to this
layout. The block is append-only: v1 fills the first five vec4 slots and
reserves the remaining 176 bytes (zeroed) so later work packages can add fields
without moving any existing offset.
Binding budget (design D14):
Desktop: set 0, binding 13 (forward set), optional group0 binding 1 on the ShaderMaterial ABI.
Web: group0 binding 1 (landed by RM-A6).
v1 fields (each a std140 vec4, 16-byte aligned, offset = index * 16):
0 time_info (time, delta, frame_index, reserved)
1 wind (dir.x, dir.y, strength, gustiness)
2 wetness (global_wetness, rain_intensity, ripple_strength, reserved)
3 render_info (internal_w, internal_h, 1/internal_w, 1/internal_h)
4 render_info2(render_scale, output_w, output_h, reserved)
5..15 reserved (176 bytes, zeroed)
Module Contents¶
Classes¶
WorldEnvironment-sourced inputs to the wind/wetness slots of FrameGlobals. |
Functions¶
Pack the v1 FrameGlobals block into a 256-byte |
|
Return a 256-byte all-zero block for the never-unbound fallback write. |
|
Render the canonical FrameGlobals GLSL uniform block for a given binding. |
Data¶
API¶
- simvx.graphics.frame_globals.__all__¶
[‘FRAME_GLOBALS_SIZE’, ‘FRAME_GLOBALS_BINDING’, ‘FRAME_GLOBALS_FIELD_OFFSETS’, ‘FRAME_GLOBALS_GLSL’,…
- simvx.graphics.frame_globals.FRAME_GLOBALS_SIZE¶
256
- simvx.graphics.frame_globals.FRAME_GLOBALS_BINDING¶
13
- simvx.graphics.frame_globals.FRAME_GLOBALS_FIELD_OFFSETS: dict[str, int]¶
None
- class simvx.graphics.frame_globals.FrameGlobalsEnv[source]¶
WorldEnvironment-sourced inputs to the wind/wetness slots of FrameGlobals.
Held by the renderer and written each frame by
EnvironmentSyncfrom the scene’sWorldEnvironment(when present). Defaults are calm/dry so a scene with no environment produces a feature-off, byte-identical frame.- wind_direction: tuple[float, float]¶
(1.0, 0.0)
- wind_strength: float¶
0.0
- wind_gustiness: float¶
0.0
- wetness: float¶
0.0
- rain_intensity: float¶
0.0
- ripple_strength: float¶
0.0
- simvx.graphics.frame_globals.pack(*, time: float, delta: float, frame_index: int, wind_direction: tuple[float, float] = (1.0, 0.0), wind_strength: float = 0.0, wind_gustiness: float = 0.0, wetness: float = 0.0, rain_intensity: float = 0.0, ripple_strength: float = 0.0, internal_w: float = 0.0, internal_h: float = 0.0, render_scale: float = 1.0, output_w: float = 0.0, output_h: float = 0.0) numpy.ndarray[source]¶
Pack the v1 FrameGlobals block into a 256-byte
uint8array (std140).
- simvx.graphics.frame_globals.zeroed() numpy.ndarray[source]¶
Return a 256-byte all-zero block for the never-unbound fallback write.
- simvx.graphics.frame_globals.glsl_block(set_index: int, binding: int, instance: str = 'fg') str[source]¶
Render the canonical FrameGlobals GLSL uniform block for a given binding.
- simvx.graphics.frame_globals.FRAME_GLOBALS_GLSL¶
‘glsl_block(…)’
- simvx.graphics.frame_globals.FRAME_GLOBALS_WGSL¶
None