simvx.graphics.renderer.point_shadow_pass¶
Point and spot light shadow map rendering pass.
Point lights use a 6-face cubemap (rendered as 6 separate passes with different view matrices). Spot lights use a single 2D depth texture with a perspective projection matching the cone angle.
Shadow depth textures are registered in the bindless texture array so the forward fragment shader can sample them via integer index.
Module Contents¶
Classes¶
Renders depth from point/spot light POVs into shadow map textures. |
Data¶
API¶
- simvx.graphics.renderer.point_shadow_pass.__all__¶
[‘PointShadowPass’]
- simvx.graphics.renderer.point_shadow_pass.log¶
‘getLogger(…)’
- simvx.graphics.renderer.point_shadow_pass.POINT_SHADOW_SIZE¶
512
- simvx.graphics.renderer.point_shadow_pass.SPOT_SHADOW_SIZE¶
1024
- simvx.graphics.renderer.point_shadow_pass.DEPTH_FORMAT¶
None
- simvx.graphics.renderer.point_shadow_pass.COLOR_FORMAT¶
None
- class simvx.graphics.renderer.point_shadow_pass.PointShadowPass(engine: Any)¶
Renders depth from point/spot light POVs into shadow map textures.
Point lights: 6-face atlas (6 x POINT_SHADOW_SIZE side-by-side). Spot lights: Single 2D depth texture (SPOT_SHADOW_SIZE x SPOT_SHADOW_SIZE).
Uses a color attachment (R32_SFLOAT) to store linear distance from light, plus a depth attachment for correct Z-testing during rendering.
Initialization
- setup(ssbo_layout: Any) None¶
Initialize point and spot shadow map resources.
- property point_shadow_texture_index: int¶
Bindless index of the point shadow atlas texture.
- property spot_shadow_texture_index: int¶
Bindless index of the spot shadow depth texture.
- render_point_shadow(cmd: Any, light_pos: numpy.ndarray, light_range: float, instances: list, ssbo_set: Any, mesh_registry: Any) None¶
Render 6 cubemap faces for a point light shadow.
Each face is rendered to a horizontal slice of the point shadow atlas. Linear distance from light is written to the R32F color attachment.
- render_spot_shadow(cmd: Any, light_pos: numpy.ndarray, light_dir: numpy.ndarray, fov: float, light_range: float, instances: list, ssbo_set: Any, mesh_registry: Any) None¶
Render a single perspective shadow map for a spot light.
Args: light_pos: World-space position of the spot light. light_dir: Normalized direction the spot light points. fov: Outer cone angle in degrees (used as projection FOV). light_range: Maximum range of the spot light.
- get_spot_vp_matrix(light_pos: numpy.ndarray, light_dir: numpy.ndarray, fov: float, light_range: float) numpy.ndarray¶
Compute the VP matrix for a spot light (for fragment shader sampling).
- cleanup() None¶
Release all GPU resources.