|
Blender V5.3
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | AdditionalInfo |
| struct | ClosurePacking |
| struct | Header |
| struct | InputClosures |
| struct | Layers |
| struct | Packed |
| struct | Packer |
| struct | PackParameters |
| struct | Reader |
| struct | Reflection |
| struct | ReflectionColorless |
| struct | Refraction |
| struct | RefractionColorless |
| struct | Subsurface |
| struct | ThinRefraction |
| struct | ThinRefractionColorless |
Typedefs | |
| using | Header = gbuffer::Header |
| using | ClosurePacking = gbuffer::ClosurePacking |
Functions | |
G-buffer Write | |
| ClosurePacking | pack_closure (const PackParameters &srt, ClosureUndetermined cl) |
| float3 | closure_data_dither_round_to_nearest (float3 data, float3 noise) |
| float4 | closure_data_dither_round_to_nearest (float4 data, float3 noise) |
| float3 | closure_data_dither_flush_to_zero (float3 data, float3 noise) |
| float4 | closure_data_dither_flush_to_zero (float4 data, float3 noise) |
| float3 | closure_dither_noise (float2 texel, uint layer_id, float3 offset) |
| float4 | closure_data_layer_dither_round_to_nearest (float4 data, float2 texel, uint layer_id, float3 offset) |
| float4 | closure_data_layer_dither_flush_to_zero (float4 data, float2 texel, uint layer_id, float3 offset) |
| Packed | pack (const PackParameters &srt, InputClosures cl_data, float3 Ng, packed_float3 surface_N, Thickness thickness, bool use_object_id) |
Utilities | |
| enum | GBufferMode : uchar { GBUF_NONE = 0u , GBUF_DIFFUSE = 1u , GBUF_REFLECTION = 2u , GBUF_REFLECTION_COLORLESS = 3u , GBUF_UNLIT = 4u , GBUF_TRANSMISSION_BIT = 1u << 3u , GBUF_REFRACTION = 0u | GBUF_TRANSMISSION_BIT , GBUF_REFRACTION_COLORLESS = 1u | GBUF_TRANSMISSION_BIT , GBUF_TRANSLUCENT = 2u | GBUF_TRANSMISSION_BIT , GBUF_SUBSURFACE = 3u | GBUF_TRANSMISSION_BIT , GBUF_THIN_REFRACTION = 4u | GBUF_TRANSMISSION_BIT , GBUF_THIN_REFRACTION_COLORLESS = 5u | GBUF_TRANSMISSION_BIT } |
| GBufferMode | closure_type_to_mode (ClosureType type, bool is_grayscale) |
| ClosureType | mode_to_closure_type (uint mode) |
| bool | color_is_grayscale (float3 color) |
| bool | closure_is_empty (ClosureUndetermined cl) |
Pack / Unpack Utils | |
| static constexpr float | closure_10bit_unit = (1.0f / 1023.0f) |
| static constexpr float | ior_packed_lt_1_scale = (511.0f * closure_10bit_unit) |
| static constexpr float | ior_packed_eq_1 = (512.0f * closure_10bit_unit) |
| static constexpr float | ior_packed_gt_1_bias = (510.0f * closure_10bit_unit) |
| float2 | normal_pack (float3 N) |
| float3 | normal_unpack (float2 N_packed) |
| float | ior_pack (float ior) |
| float | ior_unpack (float ior_packed) |
| float | thickness_pack (Thickness thickness) |
| Thickness | thickness_unpack (float thickness_packed) |
| float4 | closure_color_pack (float3 color) |
| float3 | closure_color_unpack (float4 color_packed) |
| float4 | sss_radii_pack (float3 sss_radii) |
| float3 | sss_radii_unpack (float4 sss_radii_packed) |
| float | object_id_f16_pack (uint object_id) |
| uint | object_id_f16_unpack (float object_id_packed) |
| uint | geometry_normal_pack (float3 Ng, float3 N) |
| float3 | geometry_normal_unpack (uint data, float3 N) |
G-buffer: Packing and unpacking of G-buffer data.
See #GBuffer for a breakdown of the G-buffer layout.
There is two way of indexing closure data from the GBuffer:
Indexing per bin is better to avoid parameter discontinuity for a given closure (i.e: for denoising), whereas indexing per layer is better for iterating through the closure without dealing with none-closures.
| using gbuffer::ClosurePacking = gbuffer::ClosurePacking |
Definition at line 558 of file eevee_gbuffer_types.bsl.hh.
| using gbuffer::Header = gbuffer::Header |
Definition at line 71 of file eevee_gbuffer_read.bsl.hh.
| enum gbuffer::GBufferMode : uchar |
Definition at line 57 of file eevee_gbuffer_types.bsl.hh.
Pack color with values in the range of [0..8] using a 2 bit shared exponent. This allows values up to 8 with some color degradation. Above 8, the result will be clamped when writing the data to the output buffer. This is supposed to be stored in a 10_10_10_2_unorm format with exponent in alpha.
Definition at line 219 of file eevee_gbuffer_types.bsl.hh.
References closure_color_pack(), exp2, max, float3::x, float3::y, and float3::z.
Referenced by closure_color_pack(), pack_closure(), and sss_radii_pack().
Definition at line 227 of file eevee_gbuffer_types.bsl.hh.
References closure_color_unpack(), and exp2.
Referenced by closure_color_unpack(), eevee_test_gbuffer_closure_main(), sss_radii_unpack(), and gbuffer::detail::unpack_closure().
Definition at line 141 of file eevee_gbuffer_write.bsl.hh.
References closure_data_dither_flush_to_zero(), noise(), and saturate.
Referenced by closure_data_dither_flush_to_zero(), closure_data_dither_flush_to_zero(), closure_data_layer_dither_flush_to_zero(), and eevee_test_gbuffer_closure_main().
Definition at line 147 of file eevee_gbuffer_write.bsl.hh.
References closure_data_dither_flush_to_zero(), and noise().
Definition at line 129 of file eevee_gbuffer_write.bsl.hh.
References closure_data_dither_round_to_nearest(), noise(), and saturate.
Referenced by closure_data_dither_round_to_nearest(), closure_data_dither_round_to_nearest(), closure_data_layer_dither_round_to_nearest(), and eevee_test_gbuffer_closure_main().
Definition at line 135 of file eevee_gbuffer_write.bsl.hh.
References closure_data_dither_round_to_nearest(), and noise().
| float4 gbuffer::closure_data_layer_dither_flush_to_zero | ( | float4 | data, |
| float2 | texel, | ||
| uint | layer_id, | ||
| float3 | offset ) |
Definition at line 166 of file eevee_gbuffer_write.bsl.hh.
References closure_data_dither_flush_to_zero(), closure_data_layer_dither_flush_to_zero(), and closure_dither_noise().
Referenced by closure_data_layer_dither_flush_to_zero(), eevee::surf_deferred(), and eevee::surf_hybrid().
| float4 gbuffer::closure_data_layer_dither_round_to_nearest | ( | float4 | data, |
| float2 | texel, | ||
| uint | layer_id, | ||
| float3 | offset ) |
Definition at line 158 of file eevee_gbuffer_write.bsl.hh.
References closure_data_dither_round_to_nearest(), closure_data_layer_dither_round_to_nearest(), and closure_dither_noise().
Referenced by closure_data_layer_dither_round_to_nearest(), eevee::surf_deferred(), and eevee::surf_hybrid().
Definition at line 152 of file eevee_gbuffer_write.bsl.hh.
References closure_dither_noise(), float, and random::interleaved_gradient_3d().
Referenced by closure_data_layer_dither_flush_to_zero(), closure_data_layer_dither_round_to_nearest(), and closure_dither_noise().
| bool gbuffer::closure_is_empty | ( | ClosureUndetermined | cl | ) |
Definition at line 137 of file eevee_gbuffer_types.bsl.hh.
References closure_is_empty(), CLOSURE_NONE_ID, and CLOSURE_WEIGHT_CUTOFF.
Referenced by closure_is_empty().
| GBufferMode gbuffer::closure_type_to_mode | ( | ClosureType | type, |
| bool | is_grayscale ) |
Definition at line 88 of file eevee_gbuffer_types.bsl.hh.
References CLOSURE_BSDF_DIFFUSE_ID, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID, CLOSURE_BSDF_TRANSLUCENT_ID, CLOSURE_BSSRDF_BURLEY_ID, closure_type_to_mode(), GBUF_DIFFUSE, GBUF_NONE, GBUF_REFLECTION, GBUF_REFLECTION_COLORLESS, GBUF_REFRACTION, GBUF_REFRACTION_COLORLESS, GBUF_SUBSURFACE, GBUF_THIN_REFRACTION, GBUF_THIN_REFRACTION_COLORLESS, and GBUF_TRANSLUCENT.
Referenced by closure_type_to_mode(), and pack_closure().
| bool gbuffer::color_is_grayscale | ( | float3 | color | ) |
Definition at line 131 of file eevee_gbuffer_types.bsl.hh.
References all(), color_is_grayscale(), and equal.
Referenced by color_is_grayscale(), and pack_closure().
Definition at line 260 of file eevee_gbuffer_types.bsl.hh.
References dot(), geometry_normal_pack(), N, normalize, round, float3::x, float3::y, and float3::z.
Referenced by geometry_normal_pack(), and gbuffer::Header::geometry_normal_set().
Definition at line 283 of file eevee_gbuffer_types.bsl.hh.
References geometry_normal_unpack(), N, and normalize.
Referenced by gbuffer::Header::geometry_normal(), and geometry_normal_unpack().
Definition at line 175 of file eevee_gbuffer_types.bsl.hh.
References ior_pack(), ior_packed_eq_1, ior_packed_gt_1_bias, and ior_packed_lt_1_scale.
Referenced by ior_pack(), gbuffer::Refraction::pack_additional(), gbuffer::RefractionColorless::pack_additional(), and sss_radii_pack().
Definition at line 182 of file eevee_gbuffer_types.bsl.hh.
References ior_packed_eq_1, ior_packed_gt_1_bias, ior_packed_lt_1_scale, and ior_unpack().
Referenced by ior_unpack(), sss_radii_unpack(), gbuffer::Refraction::unpack_additional(), and gbuffer::RefractionColorless::unpack_additional().
| ClosureType gbuffer::mode_to_closure_type | ( | uint | mode | ) |
Definition at line 108 of file eevee_gbuffer_types.bsl.hh.
References CLOSURE_BSDF_DIFFUSE_ID, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID, CLOSURE_BSDF_TRANSLUCENT_ID, CLOSURE_BSSRDF_BURLEY_ID, CLOSURE_NONE_ID, GBUF_DIFFUSE, GBUF_REFLECTION, GBUF_REFLECTION_COLORLESS, GBUF_REFRACTION, GBUF_REFRACTION_COLORLESS, GBUF_SUBSURFACE, GBUF_THIN_REFRACTION, GBUF_THIN_REFRACTION_COLORLESS, GBUF_TRANSLUCENT, and mode_to_closure_type().
Referenced by eevee_test_gbuffer_closure_main(), mode_to_closure_type(), eevee::raytrace::planar::trace(), eevee::raytrace::screen::trace(), and gbuffer::detail::unpack_closure().
Definition at line 149 of file eevee_gbuffer_types.bsl.hh.
References abs, length_manhattan(), N, normal_pack(), sign(), float2::x, and float2::y.
Referenced by normal_pack(), and gbuffer::Packer::result_get().
Definition at line 159 of file eevee_gbuffer_types.bsl.hh.
References abs, clamp(), N, normal_unpack(), normalize, float2::x, and float2::y.
Referenced by eevee::amend_frag(), eevee_test_gbuffer_closure_main(), eevee_test_gbuffer_normal_main(), normal_unpack(), gbuffer::Reader::read_layer(), and gbuffer::Reader::read_normal().
| float gbuffer::object_id_f16_pack | ( | uint | object_id | ) |
Definition at line 247 of file eevee_gbuffer_types.bsl.hh.
References float, and object_id_f16_pack().
Referenced by object_id_f16_pack().
| uint gbuffer::object_id_f16_unpack | ( | float | object_id_packed | ) |
Definition at line 254 of file eevee_gbuffer_types.bsl.hh.
References object_id_f16_unpack().
Referenced by object_id_f16_unpack().
| Packed gbuffer::pack | ( | const PackParameters & | srt, |
| InputClosures | cl_data, | ||
| float3 | Ng, | ||
| packed_float3 | surface_N, | ||
| Thickness | thickness, | ||
| bool | use_object_id ) |
Definition at line 349 of file eevee_gbuffer_write.bsl.hh.
References gbuffer::Packer::additional_info, gbuffer::InputClosures::closure, gbuffer::Header::closure_set(), gbuffer::Packer::closures, gbuffer::Packer::closures_to_layer_order(), gbuffer::ClosurePacking::fallback(), GBUF_NONE, gbuffer::PackParameters::gbuffer_layer_max, gbuffer::Header::geometry_normal_set(), gbuffer::Header::has_additional_data(), gbuffer::Packer::header, gbuffer::ClosurePacking::mode, gbuffer::ClosurePacking::N, gbuffer::AdditionalInfo::pack(), pack(), pack_closure(), gbuffer::Packer::result_get(), gbuffer::Packer::reuse_tangent_spaces(), static_branch, unroll, gbuffer::Header::use_object_id_set(), float2::x, and gbuffer::Header::zero().
Referenced by eevee_test_gbuffer_closure_main(), eevee_test_gbuffer_normal_main(), pack(), eevee::surf_deferred(), and eevee::surf_hybrid().
| ClosurePacking gbuffer::pack_closure | ( | const PackParameters & | srt, |
| ClosureUndetermined | cl ) |
Definition at line 46 of file eevee_gbuffer_write.bsl.hh.
References assert, closure_color_pack(), closure_type_to_mode(), CLOSURE_WEIGHT_CUTOFF, color_is_grayscale(), gbuffer::ClosurePacking::data0, GBUF_NONE, GBUF_REFLECTION, GBUF_REFLECTION_COLORLESS, GBUF_REFRACTION, GBUF_REFRACTION_COLORLESS, GBUF_SUBSURFACE, GBUF_THIN_REFRACTION, GBUF_THIN_REFRACTION_COLORLESS, gbuffer::PackParameters::gbuffer_has_reflection, gbuffer::PackParameters::gbuffer_has_refraction, gbuffer::PackParameters::gbuffer_has_subsurface, gbuffer::PackParameters::gbuffer_reflection_colorless, gbuffer::PackParameters::gbuffer_refraction_colorless, gbuffer::ClosurePacking::mode, gbuffer::ClosurePacking::N, gbuffer::Reflection::pack_additional(), gbuffer::ReflectionColorless::pack_additional(), gbuffer::Refraction::pack_additional(), gbuffer::RefractionColorless::pack_additional(), gbuffer::Subsurface::pack_additional(), gbuffer::ThinRefraction::pack_additional(), gbuffer::ThinRefractionColorless::pack_additional(), pack_closure(), and static_branch.
Referenced by pack(), and pack_closure().
Definition at line 233 of file eevee_gbuffer_types.bsl.hh.
References closure_color_pack(), ior_pack(), sss_radii_pack(), float3::x, float3::y, and float3::z.
Referenced by gbuffer::Subsurface::pack_additional(), and sss_radii_pack().
Definition at line 239 of file eevee_gbuffer_types.bsl.hh.
References closure_color_unpack(), ior_unpack(), sss_radii_unpack(), float3::x, float3::y, and float3::z.
Referenced by sss_radii_unpack(), and gbuffer::Subsurface::unpack_additional().
Definition at line 191 of file eevee_gbuffer_types.bsl.hh.
References Thickness::mode(), Slab, thickness_pack(), and Thickness::value().
Referenced by eevee::amend_frag(), gbuffer::AdditionalInfo::pack(), and thickness_pack().
Definition at line 202 of file eevee_gbuffer_types.bsl.hh.
References Thickness::from(), Slab, Sphere, and thickness_unpack().
Referenced by eevee::amend_frag(), thickness_unpack(), and gbuffer::AdditionalInfo::unpack().
|
staticconstexpr |
Definition at line 170 of file eevee_gbuffer_types.bsl.hh.
|
staticconstexpr |
Definition at line 172 of file eevee_gbuffer_types.bsl.hh.
Referenced by ior_pack(), and ior_unpack().
|
staticconstexpr |
Definition at line 173 of file eevee_gbuffer_types.bsl.hh.
Referenced by ior_pack(), and ior_unpack().
|
staticconstexpr |
Definition at line 171 of file eevee_gbuffer_types.bsl.hh.
Referenced by ior_pack(), and ior_unpack().