simvx.graphics.renderer.grid_pass

Infinite ground-plane grid overlay for 3D editor viewports.

Draws an anti-aliased XZ grid using a fragment shader SDF approach. Major lines every 10 units, minor lines every 1 unit, with distance fade. X-axis coloured red, Z-axis coloured blue (Godot convention).

Module Contents

Classes

GridPass

Renders an infinite XZ ground-plane grid behind scene geometry.

Data

API

simvx.graphics.renderer.grid_pass.__all__

[‘GridPass’]

simvx.graphics.renderer.grid_pass.log

‘getLogger(…)’

class simvx.graphics.renderer.grid_pass.GridPass(engine: Any)[source]

Renders an infinite XZ ground-plane grid behind scene geometry.

Uses a fullscreen quad with ray-plane intersection in the fragment shader to produce anti-aliased grid lines with proper depth for occlusion.

Initialization

setup() None[source]

Initialize grid pipeline and shaders.

rebuild_pipeline(render_pass: Any) None[source]

Recreate the grid pipeline against a different render pass (e.g. HDR).

The grid draws inside the active scene pass; with post-processing on that is the HDR offscreen pass, whose format differs from the swapchain pass the pipeline was first compiled against (VUID-vkCmdDraw-renderPass-02684).

render(cmd: Any, view_matrix: numpy.ndarray, proj_matrix: numpy.ndarray, extent: tuple[int, int]) None[source]

Render infinite grid. Call after skybox but before scene geometry.

cleanup() None[source]

Release GPU resources.