simvx.graphics.renderer.water_pass

Built-in water pass (design D16, RM-E1).

A dedicated forward pass (its own GLSL shader pair, not a ShaderMaterial) drawn in the TRANSPARENT slot after the scene colour/depth copy (A7/A8), so it can refract what is behind it. The vertex stage generates a tessellated grid with no vertex buffer (like the grid / tilemap passes) and displaces it by a sum of Gerstner waves driven by the FrameGlobals wind + time; the fragment stage refracts + depth-fades against the scene copy, mixes a Fresnel reflection from the environment cubemap, and adds shore foam.

Set 0 is the shared forward descriptor set (FrameGlobals b13, environment cube b4, scene colour/depth b14/b15); set 1 is this pass’s own camera UBO + per-frame surface SSBO; set 2 is the engine bindless texture array, from which a PlanarReflection3D mirror feed is sampled by index (RM-E2). Zero-cost when unused: nothing renders and no surface triggers the scene-copy split when the scene holds no visible WaterSurface3D, and a surface with no reflection is byte-identical to RM-E1 (the planar branch is gated on the per-surface index).

Module Contents

Classes

WaterPass

Renders every submitted WaterSurface3D as a Gerstner water grid.

Data

API

simvx.graphics.renderer.water_pass.__all__

[‘WaterPass’, ‘WATER_SURFACE_DTYPE’]

simvx.graphics.renderer.water_pass.log

‘getLogger(…)’

simvx.graphics.renderer.water_pass.MAX_SURFACES

64

class simvx.graphics.renderer.water_pass.WaterPass(engine: Any)[source]

Renders every submitted WaterSurface3D as a Gerstner water grid.

Initialization

setup(ssbo_layout: Any, render_pass: Any = None) None[source]

Create GPU resources. ssbo_layout is the shared forward set-0 layout.

rebuild_pipeline(render_pass: Any) None[source]

Recreate the pipeline against a different render pass (HDR / G-buffer toggle).

begin_frame() None[source]
submit(model_matrix: numpy.ndarray, material: Any, subdivisions: int, size: tuple[float, float], reflection_tex: int = -1) None[source]

Queue a water surface for this frame.

reflection_tex is the bindless index of a :class:PlanarReflection3D capture feeding a true planar mirror (RM-E2), or -1 for none.

property has_surfaces: bool[source]
render(cmd: Any, view_proj: numpy.ndarray, cam_pos: numpy.ndarray, near: float, far: float, has_skybox: bool, extent: tuple[int, int], ssbo_set: Any, submissions: list | None = None) None[source]

Record the water draws. ssbo_set is the shared forward set 0.

cleanup() None[source]