Blender V5.3
draw::gsplat::detail Namespace Reference

Functions

float3 scene_linear_from_bt709 (float3 rgb_color)
float3 unpack_sh (uint3 data, ScalingRange range)
bool is_inside_viewport (AxisTuple axes, float3 hP, float2 viewport_size)
template<typename T>
void swap (T &a, T &b)
template void swap< float > (float &, float &)
template void swap< float2 > (float2 &, float2 &)
float2 pack_normal_octahedral (float3 N)
float3 unpack_normal_octahedral (float2 p)
float4 unpack_quaternion_3_to_4 (float3 v)
float3 unpack_gaussian_mean (uint4 pack, ScalingRange data_range)
Quaternion unpack_gaussian_rotation (uint4 pack)
float3 unpack_gaussian_scale (uint4 pack, ScalingRange data_range)
float unpack_gaussian_opacity (uint4 pack)
uint3 slice_tuple_xyzn (uint t)
uint3 slice_tuple_nxyz (uint t)
uint3 slice_tuple_xnyz (uint t1, uint t2)
uint3 slice_tuple_xynz (uint t1, uint t2)
uint get_shape_id (uint vert_id)
bool get_shape_winding_ccw (uint vert_id)
float2 get_shape_offset (uint vert_id)

Function Documentation

◆ get_shape_id()

uint draw::gsplat::detail::get_shape_id ( uint vert_id)

Get the index of the current gsplat, given the vertex index.

Definition at line 190 of file draw_gsplat_lib.bsl.hh.

References DRW_GSPLAT_STRIP_TILE_SIZE, and get_shape_id().

Referenced by get_shape_id().

◆ get_shape_offset()

float2 draw::gsplat::detail::get_shape_offset ( uint vert_id)

Get a local vertex offset of the current gsplat, given the vertex index.

Definition at line 202 of file draw_gsplat_lib.bsl.hh.

References DRW_GSPLAT_STRIP_TILE_SIZE, get_shape_offset(), get_shape_winding_ccw(), and NAN_FLT.

Referenced by get_shape_offset().

◆ get_shape_winding_ccw()

bool draw::gsplat::detail::get_shape_winding_ccw ( uint vert_id)

Given a vertex index, determine if the expected winding order of the strip is cw/ccw.

Definition at line 196 of file draw_gsplat_lib.bsl.hh.

References DRW_GSPLAT_STRIP_TILE_SIZE, and get_shape_winding_ccw().

Referenced by get_shape_offset(), and get_shape_winding_ccw().

◆ is_inside_viewport()

bool draw::gsplat::detail::is_inside_viewport ( AxisTuple axes,
float3 hP,
float2 viewport_size )

Test if a splat's projection is partially or entirely inside, or partially or entirely enclosing NDC space.

Definition at line 51 of file draw_gsplat.bsl.hh.

References abs, any(), draw::gsplat::AxisTuple::axis_0, draw::gsplat::AxisTuple::axis_1, equal, is_inside_viewport(), max, and min.

Referenced by draw::gsplat::eval_splat(), and is_inside_viewport().

◆ pack_normal_octahedral()

float2 draw::gsplat::detail::pack_normal_octahedral ( float3 N)

Octahedral normal encoding [octa2017].

Definition at line 67 of file draw_gsplat_lib.bsl.hh.

References abs, greaterThanEqual, mix, N, pack_normal_octahedral(), and reduce_add().

Referenced by draw::gsplat::SplatData::pack(), and pack_normal_octahedral().

◆ scene_linear_from_bt709()

float3 draw::gsplat::detail::scene_linear_from_bt709 ( float3 rgb_color)

Definition at line 34 of file draw_gsplat.bsl.hh.

References mix, pow, scene_linear_from_bt709(), and step.

Referenced by draw::gsplat::eval_radiance(), and scene_linear_from_bt709().

◆ slice_tuple_nxyz()

uint3 draw::gsplat::detail::slice_tuple_nxyz ( uint t)

Definition at line 176 of file draw_gsplat_lib.bsl.hh.

References slice_tuple_nxyz().

Referenced by draw::gsplat::eval_radiance(), and slice_tuple_nxyz().

◆ slice_tuple_xnyz()

uint3 draw::gsplat::detail::slice_tuple_xnyz ( uint t1,
uint t2 )

Definition at line 180 of file draw_gsplat_lib.bsl.hh.

References slice_tuple_xnyz().

Referenced by draw::gsplat::eval_radiance(), and slice_tuple_xnyz().

◆ slice_tuple_xynz()

uint3 draw::gsplat::detail::slice_tuple_xynz ( uint t1,
uint t2 )

Definition at line 184 of file draw_gsplat_lib.bsl.hh.

References slice_tuple_xynz().

Referenced by draw::gsplat::eval_radiance(), and slice_tuple_xynz().

◆ slice_tuple_xyzn()

uint3 draw::gsplat::detail::slice_tuple_xyzn ( uint t)

Helper methods to slice 3-tuples (xyz) of 8b values from uint4 packed data ([xyzx][yzxy][zxyz][xyzx][yzxy]...).

Definition at line 172 of file draw_gsplat_lib.bsl.hh.

References slice_tuple_xyzn().

Referenced by draw::gsplat::eval_radiance(), and slice_tuple_xyzn().

◆ swap()

template<typename T>
void draw::gsplat::detail::swap ( T & a,
T & b )

Definition at line 56 of file draw_gsplat_lib.bsl.hh.

References b, swap(), and T.

Referenced by draw::gsplat::AxisTuple::from(), swap(), swap< float >(), and swap< float2 >().

◆ swap< float >()

template void draw::gsplat::detail::swap< float > ( float & ,
float &  )

References swap().

◆ swap< float2 >()

template void draw::gsplat::detail::swap< float2 > ( float2 & ,
float2 &  )

References swap().

◆ unpack_gaussian_mean()

float3 draw::gsplat::detail::unpack_gaussian_mean ( uint4 pack,
ScalingRange data_range )

Unpack Gaussian mean from quantized representation [gspt2026].

Note
Keep in sync with pack_gaussian() in draw_cache_impl_gsplat.cc.

Definition at line 109 of file draw_gsplat_lib.bsl.hh.

References float, ScalingRange::scale_from_unit(), unpack_gaussian_mean(), uint3::x, uint3::y, and uint3::z.

Referenced by draw::gsplat::ShapeResource::get_point(), draw::gsplat::Gaussian::unpack(), and unpack_gaussian_mean().

◆ unpack_gaussian_opacity()

float draw::gsplat::detail::unpack_gaussian_opacity ( uint4 pack)

Unpack Gaussian opacity from quantized representation.

Note
Keep in sync with pack_gaussian() in draw_cache_impl_gsplat.cc.

Definition at line 161 of file draw_gsplat_lib.bsl.hh.

References float, and unpack_gaussian_opacity().

Referenced by draw::gsplat::ShapeResource::get_opacity(), draw::gsplat::Gaussian::unpack(), and unpack_gaussian_opacity().

◆ unpack_gaussian_rotation()

Quaternion draw::gsplat::detail::unpack_gaussian_rotation ( uint4 pack)

Unpack Gaussian rotational component from quantized representation [gspt2026].

Note
Keep in sync with pack_gaussian() in draw_cache_impl_gsplat.cc.

Definition at line 126 of file draw_gsplat_lib.bsl.hh.

References Quaternion::from_float4(), unpack_gaussian_rotation(), unpack_quaternion_3_to_4(), uint3::x, uint3::y, and uint3::z.

Referenced by draw::gsplat::Gaussian::unpack(), and unpack_gaussian_rotation().

◆ unpack_gaussian_scale()

float3 draw::gsplat::detail::unpack_gaussian_scale ( uint4 pack,
ScalingRange data_range )

Unpack Gaussian scaling component from quantized representation [gspt2026].

Note
Keep in sync with pack_gaussian() in draw_cache_impl_gsplat.cc.

Definition at line 141 of file draw_gsplat_lib.bsl.hh.

References all(), equal, exp, ScalingRange::scale_from_unit(), unpack_gaussian_scale(), uint3::x, uint3::y, and uint3::z.

Referenced by draw::gsplat::Gaussian::unpack(), and unpack_gaussian_scale().

◆ unpack_normal_octahedral()

float3 draw::gsplat::detail::unpack_normal_octahedral ( float2 p)

Octahedral normal decoding [octa2017].

Definition at line 79 of file draw_gsplat_lib.bsl.hh.

References abs, clamp(), greaterThanEqual, mix, N, normalize, reduce_add(), and unpack_normal_octahedral().

Referenced by unpack_normal_octahedral().

◆ unpack_quaternion_3_to_4()

float4 draw::gsplat::detail::unpack_quaternion_3_to_4 ( float3 v)

Inverse of expmap packing [quat2017] of quaternion data.

Note
Keep in sync with pack_quaternion_4_to_3 in draw_cache_impl_gsplat.cc.

Definition at line 93 of file draw_gsplat_lib.bsl.hh.

References cos, dot(), inversesqrt(), M_PI_2, sin, and unpack_quaternion_3_to_4().

Referenced by unpack_gaussian_rotation(), and unpack_quaternion_3_to_4().

◆ unpack_sh()

float3 draw::gsplat::detail::unpack_sh ( uint3 data,
ScalingRange range )

Helper to unpack 3x8b quantized sh coefficients to a float3 representation.

Definition at line 42 of file draw_gsplat.bsl.hh.

References ScalingRange::scale_from_unit(), and unpack_sh().

Referenced by draw::gsplat::eval_radiance(), and unpack_sh().