Shader Reference
Last generated: 2026-04-05
Coverage summary: 194 documented functions, 3 undocumented functions, 68 documented uniform fields, 123 undocumented uniform fields.
Undocumented entries are omitted by default. Use --include-undocumented to list them.
Shader
modules/gaussian_splatting/shaders/brush_accumulate.glsl
Functions
| Function |
Description |
fetch_color(vec2 uv)
|
Fetch the source color used by the brush accumulation pass. |
main()
|
Accumulate brush contributions into the offscreen resolve target. |
Shader
modules/gaussian_splatting/shaders/gaussian_splat.frag.glsl
Functions
| Function |
Description |
main()
|
Fragment entry point that resolves the final Gaussian splat color. |
Shader
modules/gaussian_splatting/shaders/gaussian_splat.glsl
Functions
| Function |
Description |
main()
|
Vertex-stage entry point that prepares splat varyings. |
main()
|
Fragment-stage entry point that shades the current splat. |
Shader
modules/gaussian_splatting/shaders/gaussian_splat.vert.glsl
Functions
| Function |
Description |
main()
|
Vertex entry point for Gaussian splat quad expansion. |
Shader
modules/gaussian_splatting/shaders/gs_shadow_blit.glsl
Functions
| Function |
Description |
main()
|
Vertex entry point for the shadow-map blit quad. |
main()
|
Fragment entry point that copies the shadow-map sample to the output. |
Block
| Field |
Type |
Description |
uv_scale_offset
|
vec4
|
xy = scale, zw = offset |
invert_depth
|
float
|
1.0 to invert (reversed depth) |
Block
| Field |
Type |
Description |
uv_scale_offset
|
vec4
|
xy = scale, zw = offset |
invert_depth
|
float
|
1.0 to invert (reversed depth) |
Shader
modules/gaussian_splatting/shaders/includes/color_grading_binning.glsl
Functions
| Function |
Description |
rgb_to_hsv(vec3 c)
|
Binning Stage Color Grading Applied after SH evaluation, before packing into ProjectedGaussian Cost: ~20 ALU operations per splat = ~0.02ms for 1M splats RGB to HSV (copy from tonemap.glsl) |
hsv_to_rgb(vec3 c)
|
HSV to RGB (copy from tonemap.glsl) |
apply_color_grading_binning(vec3 color)
|
Apply color grading to splat color (binning stage) Operates in linear color space, before R11G11B10 packing |
Shader
modules/gaussian_splatting/shaders/includes/gaussian_splat_common_inc.glsl
Functions
| Function |
Description |
quaternion_to_matrix(vec4 q)
|
Convert a quaternion to a rotation matrix. |
build_covariance(vec3 scale, vec4 rotation)
|
Build a 3D covariance matrix from scale and rotation. |
compute_eigen(mat2 cov)
|
Compute the 2D covariance eigensystem for ellipse reconstruction. |
get_sigma_multiplier()
|
Return the scene sigma multiplier override or its default. |
get_gaussian_count()
|
Return the encoded Gaussian count stored in scene metadata. |
compute_projected_covariance(vec3 view_pos, vec3 scale, vec4 rotation, vec2 viewport_size)
|
Project 3D covariance into screen space for the current viewport. |
covariance_to_conic(mat2 cov2d)
|
Convert a 2D covariance matrix into conic coefficients. |
gaussian_get_first_order_count(uint meta)
|
Extract the first-order SH coefficient count from packed metadata. |
gaussian_get_high_order_count(uint meta)
|
Extract the higher-order SH coefficient count from packed metadata. |
gaussian_get_encoded_count(uint meta)
|
Extract the total encoded SH coefficient count from packed metadata. |
gaussian_get_sh_encoding(uint meta)
|
Extract the SH encoding mode from packed metadata. |
decode_rgb9e5(uint packed)
|
Decode packed RGB9E5 color data into linear RGB. |
dither_noise(vec2 frag_coord)
|
Simple hash-based noise for dithering (spatially varying) Uses fragment position to generate pseudo-random value in [-0.5, 0.5] |
dither_noise_rgb(vec2 frag_coord)
|
Generate RGB dither noise using different offsets for each channel This breaks up color banding from RGB9E5 quantization |
compute_sh_basis_with_bands(vec3 dir, uint max_band, out float basis_values[16])
|
SH sign convention (ISSUE-038): Condon-Shortley phase included. This evaluation uses the real spherical harmonics basis with the Condon-Shortley (CS) phase factor applied. Odd-m basis functions carry a leading minus sign (e.g. Y_1^{-1} = -C1*y, Y_1^1 = -C1*x). PLY coefficients from 3DGS training (Kerbl et al. 2023) are stored with CS phase already baked in, so they are consumed here without any sign adjustment. The import side (ply_loader.cpp, assemble_sh_coefficients) documents the same convention. Compute SH basis functions up to the specified band level basis_values[0] = DC (l=0) basis_values[1-3] = 1st order (l=1) basis_values[4-8] = 2nd order (l=2) basis_values[9-15] = 3rd order (l=3) |
compute_sh_basis(vec3 dir, out float basis_values[16])
|
Legacy compute_sh_basis for backwards compatibility (computes all bands) |
evaluate_sh_color_with_bands(uint gaussian_index, vec3 dir, uint sh_band_level)
|
Evaluate SH color with configurable band level sh_band_level: 0=DC only, 1=1st order, 2=2nd order, 3=3rd order |
evaluate_sh_color(uint gaussian_index, vec3 dir)
|
Legacy evaluate_sh_color for backwards compatibility (uses all available bands) |
evaluate_sh_color_dithered(uint gaussian_index, vec3 dir, uint sh_band_level, vec2 frag_coord)
|
Evaluate SH color with dithering to mitigate RGB9E5 quantization banding frag_coord: fragment screen position (gl_FragCoord.xy) for spatially-varying dither sh_band_level: 0=DC only, 1=1st order, 2=2nd order, 3=3rd order |
Block
| Field |
Type |
Description |
camera_position
|
vec4
|
xyz: world camera position, w: time or unused |
viewport
|
vec4
|
x: width, y: height, z: near plane, w: far plane |
misc
|
vec4
|
x: sigma multiplier override, y: gaussian count, z,w: unused |
Shader
modules/gaussian_splatting/shaders/includes/gs_culling_utils.glsl
Functions
| Function |
Description |
gs_hash_u32(uint v)
|
Hash a 32-bit value for deterministic culling randomness. |
gs_should_distance_cull(uint p_stable_splat_key, float world_distance)
|
Returns true if splat should be culled based on distance. p_stable_splat_key must be stable across camera-motion-induced sort order changes. |
gs_keep_overlap_record(uint gaussian_idx, uint instance_id, uint tile_idx)
|
Decide whether to keep an overlap record for diagnostics or coverage sampling. |
Shader
modules/gaussian_splatting/shaders/includes/gs_deformation.glsl
Functions
| Function |
Description |
gs_wind_hash_u32(uint v)
|
Hash an instance identifier for wind phase variation. |
gs_decode_instance_wind_mode(float encoded_mode)
|
Decode the per-instance wind mode from the packed float value. |
gs_is_wind_enabled_for_instance(float encoded_mode, vec4 wind_time_config)
|
Check whether wind deformation is enabled for the current instance. |
gs_apply_sphere_effector(vec3 world_position, vec4 effector_sphere, vec4 effector_config, float time_seconds, uint stable_seed)
|
Sphere effector: animates splats within a spherical region effector_sphere: xyz = center, w = radius effector_config: x = enabled, y = strength, z = falloff, w = animation frequency (Hz) |
Shader
modules/gaussian_splatting/shaders/includes/gs_directional_shadow.glsl
Functions
| Function |
Description |
gs_directional_shadow(uint idx, vec3 vertex, vec3 geo_normal, float taa_frame_count, float receiver_bias)
|
Directional shadow sampling for Gaussian splats. Adapted from Godot's forward clustered directional shadow path (no soft shadows). |
gs_omni_shadow_factor(uint idx, vec3 vertex, vec3 geo_normal, float taa_frame_count, out float attenuation)
|
Omni shadow factor + attenuation (hard shadow path, soft shadows disabled). |
gs_spot_shadow_factor(uint idx, vec3 vertex, vec3 geo_normal, float taa_frame_count, out float attenuation)
|
Spot shadow factor + attenuation (hard shadow path, soft shadows disabled). |
Shader
modules/gaussian_splatting/shaders/includes/gs_eigen_binning.glsl
Functions
| Function |
Description |
compute_opacity_aware_sigma(float opacity, float visibility_threshold, float max_sigma)
|
Opacity-Aware Bounding (FlashGS Optimization) Computes the effective sigma multiplier based on opacity and visibility threshold. Reduces tile-Gaussian pairs by ~94% for low-opacity splats. Reference: FlashGS — Efficient Gaussian Splatting with Adaptive Bounds Compute the sigma multiplier for opacity-aware bounds. Returns the effective number of sigmas to use based on opacity. For high opacity (close to 1.0), returns close to max_sigma (conservative). For low opacity, returns a smaller value (aggressive culling). |
compute_eigen(mat2 cov)
|
Compute eigenvalues and eigenvectors for tile binning heuristics. |
Shader
modules/gaussian_splatting/shaders/includes/gs_lighting_bridge.glsl
Functions
| Function |
Description |
sc_use_light_projector()
|
Compute-shader fallback: projector lights are unavailable. |
sc_use_light_soft_shadows()
|
Compute-shader fallback: soft shadows are unavailable. |
sc_projector_use_mipmaps()
|
Compute-shader fallback: projector mipmaps are unavailable. |
sc_soft_shadow_samples()
|
Compute-shader fallback: soft shadow sampling is disabled. |
sc_penumbra_shadow_samples()
|
Compute-shader fallback: penumbra sampling is disabled. |
sc_directional_soft_shadow_samples()
|
Compute-shader fallback: directional soft shadow sampling is disabled. |
sc_directional_penumbra_shadow_samples()
|
Compute-shader fallback: directional penumbra sampling is disabled. |
sc_luminance_multiplier()
|
Compute-shader fallback: keep luminance neutral in the bridge path. |
Shader
modules/gaussian_splatting/shaders/includes/gs_lighting_common.glsl
Functions
| Function |
Description |
cluster_get_item_range(uint offset, out uint item_min, out uint item_max, out uint item_from, out uint item_to)
|
Read the packed item range for one clustered-light record. |
cluster_get_range_clip_mask(uint i, uint z_min, uint z_max)
|
Compute the clip mask used to reject clustered-light slices outside range. |
gs_use_clustered_lights()
|
Return whether clustered lights are active for this frame. |
Shader
modules/gaussian_splatting/shaders/includes/gs_quat_utils.glsl
Functions
| Function |
Description |
quaternion_to_matrix(vec4 q)
|
Convert a quaternion to a rotation matrix. |
gs_quat_rotate(vec4 q, vec3 v)
|
Rotate a vector by a quaternion. |
gs_quat_mul(vec4 a, vec4 b)
|
Multiply two quaternions. |
Shader
modules/gaussian_splatting/shaders/includes/gs_render_params.glsl
Functions
| Function |
Description |
gs_get_sh_band_level()
|
Helper to get current SH band level from params |
gs_get_sh_amortization_divisor()
|
Return the SH amortization divisor from render params. |
gs_get_sh_amortization_phase()
|
Return the SH amortization phase from render params. |
gs_is_sh_amortization_enabled()
|
Return whether SH amortization is enabled. |
gs_get_sh_amortization_force_update()
|
Return whether SH amortization should force an update this frame. |
gs_is_dc_logit_enabled()
|
Return whether DC logit decoding is enabled. |
gs_is_opacity_aware_culling_enabled()
|
Helper to check if opacity-aware culling is enabled |
gs_get_visibility_threshold()
|
Helper to get visibility threshold (tau) |
gs_get_lod_blend_factor()
|
Helper to get LOD blend factor from params (LODGE technique) |
gs_is_lod_blend_enabled()
|
Helper to check if LOD blending is enabled |
gs_get_overlap_keep_ratio()
|
Return the overlap keep ratio used by culling and diagnostics. |
gs_is_wind_enabled()
|
Return whether wind deformation is enabled. |
gs_is_sphere_effector_enabled()
|
Return whether the sphere effector is enabled. |
Block
| Field |
Type |
Description |
view_matrix
|
mat4
|
World-to-view matrix (may include instance transform) |
inv_view_matrix
|
mat4
|
Inverse of view_matrix |
projection_matrix
|
mat4
|
View-to-clip projection matrix |
inv_projection_matrix
|
mat4
|
Clip-to-view inverse projection matrix (GS render projection) |
viewport_size
|
vec2
|
Viewport size in pixels |
tile_count
|
vec2
|
Tile grid dimensions (x,y) |
total_gaussians
|
uint
|
Total splats in the source buffer |
visible_gaussians
|
uint
|
Visible splats after culling |
near_plane
|
float
|
Camera near plane distance |
far_plane
|
float
|
Camera far plane distance |
debug_flags
|
vec4
|
x: tile_grid_or_bounds, y: collect_raster_stats, z: overflow_tiles, w: projection_issues |
debug_overlay_opacity
|
float
|
Blend strength for debug overlays |
opacity_multiplier
|
float
|
Global opacity scaling factor |
_pad0
|
float
|
Explicit padding to align camera_position to 16 bytes (std140) |
_pad1
|
float
|
std140 padding |
camera_position
|
vec4
|
xyz used, w reserved |
alpha_floor
|
float
|
Minimum alpha when force_solid_coverage is enabled |
force_solid_coverage
|
uint
|
Nonzero enforces alpha_floor for any covered pixel |
overlap_record_count
|
uint
|
Total overlap records in the sorted buffer |
_pad_overlap
|
uint
|
std140 padding |
cull_far_tolerance
|
float
|
Extra tolerance past the far plane for culling |
tiny_splat_screen_radius
|
float
|
Drop splats smaller than this pixel radius |
max_conic_aspect
|
float
|
Max aspect ratio for conic clamping (lower = less stretching) |
_pad_before_jacobian
|
float
|
std140: align jacobian_diag_flags (vec4) to 16 bytes |
jacobian_diag_flags
|
vec4
|
Jacobian diagnostic toggles: x=bypass_radius_depth_floor, y=bypass_j_col2_clamp, z=invert_j_col2_sign, w=reserved |
debug_overlay_flags
|
vec4
|
Debug overlay flags: x=overlay_mode (0=off, 1=density_heatmap, 2=shadow_opacity), y=depth_visualization, z=projection_z_mismatch, w=white_albedo_lighting_isolation |
sh_config
|
vec4
|
Spherical Harmonics configuration: x=sh_bands (0-3), y=amortization_divisor, z=amortization_phase, w=force_full_update sh_bands: 0=DC only, 1=1st order, 2=2nd order, 3=3rd order (full) |
sh_decode_config
|
vec4
|
SH decode configuration: x=dc_logit (1.0=decode DC with sigmoid), yzw=reserved |
opacity_culling_config
|
vec4
|
Opacity-aware culling (FlashGS optimization): x=enabled (1.0=true), y=visibility_threshold (tau), z=reserved, w=reserved When enabled, splat radii are calculated as: r = sqrt(2 * ln(alpha/tau) * lambda_max) This reduces tile-Gaussian pairs by ~94% for low-opacity splats |
lod_blend_config
|
vec4
|
LOD blending configuration (LODGE technique): x=lod_blend_factor (0-1, global blend factor for the frame) y=lod_blend_enabled (0 or 1) z=lod_blend_distance (world units) w=reserved |
distance_cull_config
|
vec4
|
Distance-based culling configuration: x=start_distance, y=max_cull_rate, z=enabled, w=overlap_keep_ratio overlap_keep_ratio is used by global-sort binning to thin overlap records deterministically when the overlap budget is saturated. |
color_grading_primary
|
vec4
|
Color grading parameters (aligned to vec4): x=enabled (0/1), y=exposure, z=contrast, w=saturation |
color_grading_secondary
|
vec4
|
x=temperature, y=tint, z=hue_shift (degrees), w=reserved |
lighting_config
|
vec4
|
Lighting configuration: x=direct_light_scale, y=indirect_sh_scale, z=enable_direct_lighting, w=normal_mode (0=depth gradients, 1=view dir, 2=depth gradients with fallback) |
shadow_strength
|
vec4
|
Shadow configuration: x=shadow_strength (0..1), yzw=reserved |
shadow_bias_config
|
vec4
|
Shadow receiver bias configuration: x=receiver_bias_scale (per-splat radius multiplier), y=receiver_bias_min, z=receiver_bias_max (0=disabled), w=reserved |
lighting_mode
|
uvec4
|
Lighting mode: x=direct_lighting_mode (0=resolve, 1=per-splat, 2=both), yzw=reserved |
light_counts
|
uvec4
|
Light counts: x=omni_light_count, y=spot_light_count, z=cluster_enabled, w=light_mask |
cluster_config
|
uvec4
|
Cluster configuration: x=cluster_shift, y=cluster_width, z=cluster_type_size, w=max_cluster_element_count_div_32 |
instance_rotation_inv_col0
|
vec4
|
Instance rotation inverse for SH view direction correction (mat3 stored as 3 vec4s for std140). |
wind_dir_strength
|
vec4
|
Global procedural wind configuration: wind_dir_strength: xyz = direction (world), w = displacement strength (meters) |
wind_time_config
|
vec4
|
wind_time_config: x = time_seconds, y = temporal_frequency, z = spatial_frequency, w = enabled (0/1) |
effector_sphere
|
vec4
|
Single global sphere effector (foundation for capped multi-effector support): effector_sphere: xyz = center (world), w = radius effector_config: x = enabled (0/1), y = displacement strength (meters), z = falloff exponent, w = reserved |
Shader
modules/gaussian_splatting/shaders/includes/gs_sh_binning.glsl
Functions
| Function |
Description |
gaussian_get_first_order_count(uint meta)
|
Read the number of first-order SH coefficients encoded in metadata. |
gaussian_get_high_order_count(uint meta)
|
Read the number of higher-order SH coefficients encoded in metadata. |
gaussian_get_encoded_count(uint meta)
|
Read the total number of packed SH coefficients stored in metadata. |
gaussian_get_sh_encoding(uint meta)
|
Read the SH storage format identifier from metadata. |
decode_rgb9e5(uint packed)
|
Decode one RGB9E5-packed SH coefficient triplet to linear RGB. |
compute_sh_basis(vec3 dir, uint max_band, out float basis[16])
|
SH sign convention (ISSUE-038): Condon-Shortley phase included. This evaluation uses the real spherical harmonics basis with the Condon-Shortley (CS) phase factor. Matches ply_loader.cpp import convention and gaussian_splat_common_inc.glsl. See those files for full documentation. Compute SH basis functions up to the specified band level basis[0] = DC (l=0) basis[1-3] = 1st order (l=1) basis[4-8] = 2nd order (l=2) basis[9-15] = 3rd order (l=3) |
compute_sh_basis_1st_order(vec3 dir, out float basis[4])
|
Legacy 1st order basis for backwards compatibility |
evaluate_sh_with_bands(Gaussian g, vec3 view_dir, uint sh_band_level)
|
Evaluate SH color with configurable band level sh_band_level: 0=DC only, 1=1st order, 2=2nd order, 3=3rd order |
evaluate_sh_1st_order(Gaussian g, vec3 view_dir)
|
Legacy evaluate function that uses 1st order only (for backwards compatibility) |
Shader
modules/gaussian_splatting/shaders/includes/gs_sort_key.glsl
Functions
| Function |
Description |
gs_float_to_sortable_uint(float value)
|
64-bit key layout: hi = sortable depth, lo = tie-break. |
gs_pack_sort_key64(float depth, uint tie_break)
|
Pack depth and tie-break data into a 64-bit sort key. |
Shader
modules/gaussian_splatting/shaders/includes/painterly_common.glsl
Functions
| Function |
Description |
painterly_quaternion_to_matrix(vec4 q)
|
Convert a quaternion rotation to a 3x3 rotation matrix. |
painterly_scale_matrix(vec3 scale)
|
Build a diagonal scale matrix from per-axis scale values. |
painterly_build_covariance(mat3 rotation_matrix, vec3 scale)
|
Build a covariance matrix from rotation and scale in 3D space. |
painterly_build_covariance(vec3 scale, vec4 rotation)
|
Build a covariance matrix from scale and quaternion inputs. |
painterly_project_gaussian(mat3 view_matrix, mat3 covariance_3d)
|
Project a 3D covariance into view space and derive the 2D conic form. |
painterly_compute_radius(const PainterlyConicData data, float sigma_multiplier)
|
Compute a screen-space radius from projected covariance. |
painterly_gaussian_power(vec2 uv, vec3 conic)
|
Evaluate the quadratic form for a projected Gaussian at a pixel offset. |
painterly_gaussian_alpha(float opacity, float power)
|
Convert Gaussian power into a clamped alpha contribution. |
painterly_hash_scalar(vec3 value)
|
Hash a 3D value to a stable scalar in [0, 1). |
painterly_hash_vector(vec3 value)
|
Hash a 3D value to a stable 2D seed vector. |
painterly_safe_normalize(vec3 v, vec3 fallback)
|
Normalize a vector with a fallback for near-zero length inputs. |
Shader
modules/gaussian_splatting/shaders/includes/painterly_features.glsl
Functions
| Function |
Description |
painterly_apply_palette_quantization(vec3 color, vec2 seeds)
|
Snap a color toward the nearest palette entry with optional jitter. |
painterly_apply_brush_modulation(vec2 uv, vec2 seeds)
|
Turn brush UV and noise seeds into a soft radial brush mask. |
painterly_color_temperature(float kelvin)
|
Approximate a Kelvin temperature as an RGB tint. |
painterly_apply_temperature(vec3 color, float kelvin, float strength)
|
Blend a color toward a Kelvin-based tint by the requested strength. |
cel_shade(vec3 color, vec3 normal, vec3 light_dir, int bands)
|
Quantize diffuse lighting into flat cel-shading bands. |
rim_light(vec3 color, vec3 normal, vec3 view_dir, float power)
|
Compute a view-dependent rim factor scaled by the power exponent. |
gooch_shade_with_dir(vec3 cool_color, vec3 warm_color, vec3 normal, vec3 light_dir)
|
Blend between cool and warm colors using a signed light-facing term. |
gooch_shade(vec3 cool_color, vec3 warm_color, vec3 normal)
|
Gooch-shade using the first configured painterly light direction. |
painterly_mix(vec3 base, vec3 light, float brush_texture)
|
Mix base and lit colors according to brush influence and texture. |
painterly_apply_stylized_lighting(vec3 albedo, vec3 normal_vs, vec3 view_dir_vs)
|
Apply the selected painterly lighting style to a view-space fragment. |
Block
PainterlyPalette (painterly_palette)
| Field |
Type |
Description |
params
|
vec4
|
x: count, y: blend strength, z: noise strength, w: preserve luminance (>0.5) |
Block
PainterlyBrush (painterly_brush)
| Field |
Type |
Description |
params0
|
vec4
|
x: scale, y: softness, z: anisotropy, w: rotation jitter |
params1
|
vec4
|
x: texture noise strength, yzw: reserved |
Block
PainterlyLighting (painterly_lighting)
| Field |
Type |
Description |
ambient_color
|
vec4
|
rgb: ambient tint, a: ambient intensity |
shadow_color
|
vec4
|
rgb: artistic shadow tint, a: shadow strength |
highlight_color
|
vec4
|
rgb: highlight tint, a: highlight strength |
rim_color_power
|
vec4
|
rgb: rim tint, a: rim power |
style_params0
|
vec4
|
x: shading style, y: cel band count, z: painterly mix strength, w: brush influence |
style_params1
|
vec4
|
x: rim blend, y: color temperature (K), z: temperature strength, w: temporal stability |
style_params2
|
vec4
|
x: gooch cool mix, y: gooch warm mix, z: cel softness, w: unused |
light_control
|
vec4
|
x: light count, y: global intensity, z/w: reserved |
Shader
modules/gaussian_splatting/shaders/includes/platform_compat.glsl
Functions
| Function |
Description |
gs_exp_fast(float x)
|
Fast exp approximation using Schraudolph's bit manipulation method exp(x) ≈ 2^(x / ln(2)) represented as IEEE 754 float bits |
Shader
modules/gaussian_splatting/shaders/includes/quantization_dequant.glsl
Functions
| Function |
Description |
sanitize_quant_bits(uint bits, uint min_bits, uint max_bits)
|
Clamp quantization bit depth to the supported range. |
compute_inv_quant_max(uint bits, uint min_bits, uint max_bits)
|
Compute the reciprocal of the maximum quantized integer for a bit depth. |
extract_quantized_position(uvec2 position_chunk)
|
Extract quantized position components from packed data |
extract_chunk_id(uvec2 position_chunk)
|
Extract chunk ID from packed position data |
extract_quantized_scale(uint scale_lo, uint scale_hi)
|
Extract quantized scale components from packed data (scalar version for struct layout) |
extract_quantized_scale(uvec2 scale_area)
|
Legacy overload for uvec2 (backward compatibility) |
extract_area(uint scale_hi)
|
Extract area from packed scale/area data (scalar version) |
extract_area(uvec2 scale_area)
|
Legacy overload for uvec2 |
extract_rotation(uint rotation_lo, uint rotation_hi)
|
Extract rotation quaternion from packed data (scalar version for struct layout) |
extract_rotation(uvec2 rotation_packed)
|
Legacy overload for uvec2 (backward compatibility) |
dequantize_position(uvec3 quantized, ChunkQuantization chunk)
|
Dequantize position using asset-local chunk bounds. |
dequantize_scale(uvec3 quantized, ChunkQuantization chunk)
|
Dequantize scale using asset-local chunk bounds. |
extract_normal(uint normal_xy, uint normal_z_stroke)
|
Extract normal from packed data |
extract_stroke_age(uint normal_z_stroke)
|
Extract stroke age from packed normal data |
get_max_position_error(ChunkQuantization chunk)
|
Utility: Compute quantization error bounds Calculate maximum position quantization error for a chunk |
get_max_scale_error(ChunkQuantization chunk)
|
Calculate maximum scale quantization error for a chunk |
Shader
modules/gaussian_splatting/shaders/includes/tile_projection_common.glsl
Functions
| Function |
Description |
gs_pack_screen_xy(vec2 screen_pos)
|
Pack screen-space position into two half-floats. |
gs_pack_depth_opacity_flags(float depth, float opacity, uint flags)
|
Pack depth, opacity, and 8 bits of flags into one 32-bit word. |
gs_pack_color_r11g11b10(vec3 color)
|
Pack linear RGB into the tile color payload format. |
gs_pack_normal_xy(vec3 normal)
|
Pack the X/Y normal components into one 32-bit word. |
gs_pack_normal_zw(vec3 normal)
|
Pack the Z normal component into the second normal word. |
gs_pack_conic_y_and_index(float conic_y, uint global_idx)
|
Legacy function kept for API compatibility |
gs_unpack_screen_xy(uint packed)
|
Unpack the packed screen-space position. |
gs_unpack_depth_opacity_flags(uint packed, out float depth, out float opacity, out uint flags)
|
Unpack depth, opacity, and flags from the packed payload word. |
gs_unpack_color_r11g11b10(uint packed)
|
Unpack the tile color payload back into linear RGB. |
gs_unpack_normal(uint packed_xy, uint packed_zw)
|
Unpack the normal payload back into a 3D normal vector. |
gs_unpack_conic_y_and_index(uint packed, out float conic_y, out uint global_idx)
|
Legacy function kept for API compatibility |
tile_projection_index(uint tile_index, uint slot_index)
|
Compute the linear index for a tile/slot pair in the projection buffer. |
Shader
modules/gaussian_splatting/shaders/includes/tile_raster_common.glsl
Functions
| Function |
Description |
gs_dither_noise(vec2 frag_coord)
|
Simple hash-based noise for dithering (spatially varying) Uses fragment position to generate pseudo-random value in [-0.5, 0.5] |
gs_dither_noise_rgb(vec2 frag_coord)
|
Generate RGB dither noise using different offsets for each channel This breaks up color banding from quantization |
gs_apply_color_dither(vec3 color, vec2 frag_coord)
|
Apply dithering to a color to reduce quantization banding Uses flat dithering (not scaled by color) for consistent banding reduction across all tones |
gs_read_sorted_value(uint local_index, uint range_start)
|
Read a sorted splat index from shared memory or the backing buffer. |
gs_read_projected_gaussian(uint local_index, uint sorted_idx)
|
Read a projected Gaussian payload from shared memory or the backing buffer. |
gs_get_visible_gaussian_count()
|
Return the number of visible Gaussians in the current dispatch. |
Shader
modules/gaussian_splatting/shaders/painterly_composite.frag.glsl
Functions
| Function |
Description |
linearize_scene_depth(float raw_depth)
|
Convert normalized scene depth to comparable view-space depth. |
sanitize_view_depth(float depth_value)
|
Clamp invalid depth values to a sentinel for comparisons. |
is_scene_background_depth(float raw_scene_depth, float scene_view_depth)
|
Detect whether the sampled scene depth corresponds to the background clear value. |
main()
|
Fragment entry point for the painterly composite pass. |
Shader
modules/gaussian_splatting/shaders/painterly_composite.glsl
Functions
| Function |
Description |
main()
|
Vertex entry point for the fullscreen composite triangle. |
linearize_scene_depth(float raw_depth)
|
Convert normalized scene depth to comparable view-space depth. |
sanitize_view_depth(float depth_value)
|
Clamp invalid depth values to a sentinel for comparisons. |
is_scene_background_depth(float raw_scene_depth, float scene_view_depth)
|
Detect whether the sampled scene depth corresponds to the background clear value. |
main()
|
Fragment entry point for the fullscreen composite pass. |
Shader
modules/gaussian_splatting/shaders/painterly_composite.vert.glsl
Functions
| Function |
Description |
main()
|
Vertex entry point for the fullscreen composite triangle. |
Shader
modules/gaussian_splatting/shaders/painterly_resolve.glsl
Functions
| Function |
Description |
hash(vec2 uv)
|
Generate a repeatable pseudo-random value from UV coordinates. |
layered_noise(vec2 uv, int octaves)
|
Accumulate layered hash noise for painterly modulation. |
apply_palette(vec3 color)
|
Apply the active painterly palette transformation. |
apply_density_response(vec3 color, float alpha)
|
Adjust color response based on splat density and alpha. |
evaluate_painterly(vec2 uv, vec4 base_sample)
|
Evaluate painterly post-processing for a single pixel sample. |
main()
|
Compute entry point for painterly resolve output. |
Shader
modules/gaussian_splatting/shaders/sobel_outline.glsl
Functions
| Function |
Description |
sample_color(vec2 uv, vec2 offset)
|
Sample a neighboring scene color for Sobel edge detection. |
main()
|
Compute outline intensity from Sobel gradients. |
Shader
modules/gaussian_splatting/shaders/tile_binning.glsl
Functions
| Function |
Description |
gs_get_visible_gaussian_count()
|
Return the number of visible Gaussians scheduled for this dispatch. |
gs_pack_sort_key(uint tile_idx, float linear_depth)
|
Pack tile index and depth into a global sort key. |
gs_pack_sort_key(uint tile_idx, float linear_depth)
|
Pack tile index and depth into a global sort key. |
gs_tile_intersects_projected_ellipse(vec2 center, vec3 conic, float sigma2, int tx, int ty)
|
Exact convex-quadratic minimum test against a tile rectangle. Returns true if the projected ellipse intersects the tile. |
gs_build_quantized_sh_metadata(uint encoded_total)
|
Pack quantized spherical-harmonic metadata for the renderer. |
project_gaussian_2d(Gaussian g, out vec2 screen_pos, out mat2 cov2d, out float linear_depth, out float raw_min_radius)
|
Project a Gaussian into screen space and derive its 2D covariance. |
main()
|
Compute entry point for the active tile binning pass. |
Shader
modules/gaussian_splatting/shaders/tile_prefix_scan.glsl
Functions
| Function |
Description |
main()
|
Compute pass 1: local exclusive scan and workgroup totals. |
read_pass2_source(uint idx)
|
Read the current prefix-scan source buffer for pass 2. |
write_pass2_dest(uint idx, uint value)
|
Write the current prefix-scan destination buffer for pass 2. |
main()
|
Compute pass 2: multi-level scan or buffer copy for workgroup offsets. |
main()
|
Pass 3: add workgroup offsets into base ranges. |
Block
| Field |
Type |
Description |
global_sort_capacity
|
uint
|
Used for overflow detection in Pass 3 |
Shader
modules/gaussian_splatting/shaders/tile_rasterizer.glsl
Functions
| Function |
Description |
main()
|
Vertex entry point for the fullscreen raster quad. |
main()
|
Fragment entry point for tile rasterization and compositing. |
Shader
modules/gaussian_splatting/shaders/tile_rasterizer_compute.glsl
Functions
| Function |
Description |
main()
|
Compute entry point for tile-local batched rasterization. |
Shader
modules/gaussian_splatting/shaders/tile_resolve.glsl
Functions
| Function |
Description |
sample_input_color(ivec2 coord, vec2 uv)
|
Sample the resolved input color buffer with optional texel fetch. |
sample_input_depth(ivec2 coord, vec2 uv)
|
Sample the resolved input depth buffer with optional texel fetch. |
sample_input_normal(ivec2 coord, vec2 uv)
|
Sample the resolved input normal buffer with optional texel fetch. |
sanitize_linear_depth(float depth_value)
|
Clamp invalid linear depth values to a safe fallback. |
compute_feather_weight(ivec2 coord)
|
Compute edge feathering for the current tile. |
reconstruct_view_pos(mat4 inv_proj, vec2 screen_uv, float linear_depth, float z_near, float z_far, bool is_ortho)
|
Reconstruct a view-space position from screen UV and linear depth. |
apply_tile_debug_overlay(vec4 color, ivec2 coord)
|
Overlay tile boundaries when tile debug visualization is enabled. |
main()
|
Compute entry point for tile resolve and final shading. |
Shader
modules/gaussian_splatting/shaders/viewport_blit.glsl
Functions
| Function |
Description |
srgb_to_linear(vec3 color)
|
Fast sRGB approximations using polynomial/sqrt instead of pow() These avoid expensive pow() calls while maintaining good accuracy Max error ~0.4% which is imperceptible |
linear_to_srgb(vec3 color)
|
Convert linear color to sRGB for final viewport output. |
linearize_scene_depth(float raw_depth)
|
Convert raw scene depth to linear view-space depth. |
sanitize_view_depth(float depth_value)
|
Clamp invalid depth values to a stable far-plane fallback. |
is_scene_background_depth(float raw_scene_depth, float scene_view_depth)
|
Detect background depth samples near the far plane. |
main()
|
Blit the rendered viewport into the final output target. |
Shader
modules/gaussian_splatting/compute/cluster_cull.glsl
Functions
| Function |
Description |
aabb_frustum_visible(vec3 aabb_min, vec3 aabb_max)
|
AABB-frustum intersection test (conservative) |
main()
|
Cluster culling entry point; writes visibility decisions for the active workgroup. |
Block
ClusterCullParams (params)
| Field |
Type |
Description |
fine_cull_workgroup_size
|
uint
|
Typically 256 |
Shader
modules/gaussian_splatting/compute/depth_compute.glsl
Functions
| Function |
Description |
quat_rotate(vec4 q, vec3 v)
|
Rotate vector `v` by quaternion `q`. |
gs_sphere_frustum_visible(vec3 position, float radius)
|
Conservative sphere-frustum visibility test for compute culling. |
gs_compute_screen_size(float depth, float radius)
|
Estimate projected screen-space radius from depth and world-space radius. |
main()
|
Depth compute entry point; emits per-instance depth and screen-size data. |
Block
| Field |
Type |
Description |
camera_position_ortho
|
vec4
|
xyz = camera position, w = orthographic flag |
cull_screen_distance
|
vec4
|
x = pixel_scale_y, y = tiny_splat_radius_px, z = min_screen_threshold_px, w = max_distance_sq |
cull_frustum_radius
|
vec4
|
x = radius_multiplier, y = frustum_plane_slack, z = enable_frustum, w = reserved |
Shader
modules/gaussian_splatting/compute/frustum_cull.glsl
Functions
| Function |
Description |
quat_rotate(vec4 q, vec3 v)
|
Rotate vector `v` by quaternion `q`. |
sphere_frustum_visible(vec3 position, float radius)
|
Conservative sphere-frustum visibility test for instance culling. |
main()
|
Frustum culling entry point; classifies visible instances for downstream passes. |
Shader
modules/gaussian_splatting/compute/instance_chunk_dispatch.glsl
Functions
| Function |
Description |
main()
|
Build indirect dispatch counts for chunk-level processing. |
Block
| Field |
Type |
Description |
max_visible_chunks
|
uint
|
Uses InstanceDepthParamsGPU.visible_chunk_count slot. |
dispatch_group_x
|
uint
|
Uses InstanceDepthParamsGPU.pad0 slot. |
Shader
modules/gaussian_splatting/compute/instance_count_clamp.glsl
Functions
| Function |
Description |
main()
|
Clamp indirect instance counts to the configured dispatch budget. |
Generated by:
scripts/generate_shader_docs.py