simvx.graphics.renderer.colour_grading¶
Colour grading pass: LUT-based colour correction via compute shader.
Module Contents¶
Classes¶
Compute-based colour grading: LUT lookup + brightness/contrast/saturation/temperature. |
Functions¶
Create a trilinear, clamp-to-edge sampler for a 3D LUT. |
|
Upload an |
Data¶
API¶
- simvx.graphics.renderer.colour_grading.__all__¶
[‘ColourGradingPass’, ‘create_lut_sampler’, ‘upload_lut_3d’]
- simvx.graphics.renderer.colour_grading.log¶
‘getLogger(…)’
- class simvx.graphics.renderer.colour_grading.ColourGradingPass(engine: Any)[source]¶
Compute-based colour grading: LUT lookup + brightness/contrast/saturation/temperature.
Operates in-place on the HDR colour image. Apply after fog, before tone mapping.
Initialization
- setup(width: int, height: int, colour_view: Any) None[source]¶
Initialize colour grading pipeline and upload default neutral LUT.
- set_lut(lut_data: numpy.ndarray) None[source]¶
Upload a new 3D LUT texture. Shape should be (size, size, size, 4) uint8.
- render(cmd: Any) None[source]¶
Dispatch colour grading compute shader. Call after fog, before tonemap.
Args: cmd: Active command buffer (outside any render pass).
- simvx.graphics.renderer.colour_grading.create_lut_sampler(device: Any) Any[source]¶
Create a trilinear, clamp-to-edge sampler for a 3D LUT.
Matches the web runtime’s LUT sampler (linear mag/min, clamp on all three axes) so desktop and web sample identical texels for the same LUT data.
- simvx.graphics.renderer.colour_grading.upload_lut_3d(engine: Any, lut_data: numpy.ndarray) tuple[Any, Any, Any][source]¶
Upload an
(size, size, size, 4)uint8 LUT as a 3D sampled image.Returns
(image, memory, view). The format isVK_FORMAT_R8G8B8A8_UNORMwith aVK_IMAGE_VIEW_TYPE_3Dview, the byte-for-byte match for the web runtime’srgba8unorm3D LUT texture. The image is left inSHADER_READ_ONLY_OPTIMAL, ready for either a fragment or compute sampler.