Blender V5.3
eevee_gbuffer_types.bsl.hh File Reference
#include "eevee_defines.hh"
#include "eevee_thickness_lib.bsl.hh"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_vector.bsl.hh"
#include "gpu_shader_math_vector_reduce.bsl.hh"
#include "gpu_shader_utildefines.bsl.hh"

Go to the source code of this file.

Classes

struct  gbuffer::Header
struct  gbuffer::AdditionalInfo
struct  gbuffer::ClosurePacking
struct  gbuffer::Subsurface
struct  gbuffer::Reflection
struct  gbuffer::Refraction
struct  gbuffer::ThinRefraction
struct  gbuffer::ReflectionColorless
struct  gbuffer::RefractionColorless
struct  gbuffer::ThinRefractionColorless

Namespaces

namespace  gbuffer

Typedefs

using gbuffer::ClosurePacking = gbuffer::ClosurePacking

Enumerations

enum  UsedLayerFlag : uchar {
  CLOSURE_DATA_2 = 1u << 0u , CLOSURE_DATA_3 = 1u << 1u , CLOSURE_DATA_4 = 1u << 2u , CLOSURE_DATA_5 = 1u << 3u ,
  NORMAL_DATA_1 = 1u << 4u , NORMAL_DATA_2 = 1u << 5u , ADDITIONAL_DATA = 1u << 6u , OBJECT_ID = 1u << 7u
}

Variables

static constexpr int GBUFFER_LAYER_MAX = 3

Utilities

enum  gbuffer::GBufferMode : uchar {
  gbuffer::GBUF_NONE = 0u , gbuffer::GBUF_DIFFUSE = 1u , gbuffer::GBUF_REFLECTION = 2u , gbuffer::GBUF_REFLECTION_COLORLESS = 3u ,
  gbuffer::GBUF_UNLIT = 4u , gbuffer::GBUF_TRANSMISSION_BIT = 1u << 3u , gbuffer::GBUF_REFRACTION = 0u | GBUF_TRANSMISSION_BIT , gbuffer::GBUF_REFRACTION_COLORLESS = 1u | GBUF_TRANSMISSION_BIT ,
  gbuffer::GBUF_TRANSLUCENT = 2u | GBUF_TRANSMISSION_BIT , gbuffer::GBUF_SUBSURFACE = 3u | GBUF_TRANSMISSION_BIT , gbuffer::GBUF_THIN_REFRACTION = 4u | GBUF_TRANSMISSION_BIT , gbuffer::GBUF_THIN_REFRACTION_COLORLESS = 5u | GBUF_TRANSMISSION_BIT
}
GBufferMode gbuffer::closure_type_to_mode (ClosureType type, bool is_grayscale)
ClosureType gbuffer::mode_to_closure_type (uint mode)
bool gbuffer::color_is_grayscale (float3 color)
bool gbuffer::closure_is_empty (ClosureUndetermined cl)

Pack / Unpack Utils

static constexpr float gbuffer::closure_10bit_unit = (1.0f / 1023.0f)
static constexpr float gbuffer::ior_packed_lt_1_scale = (511.0f * closure_10bit_unit)
static constexpr float gbuffer::ior_packed_eq_1 = (512.0f * closure_10bit_unit)
static constexpr float gbuffer::ior_packed_gt_1_bias = (510.0f * closure_10bit_unit)
float2 gbuffer::normal_pack (float3 N)
float3 gbuffer::normal_unpack (float2 N_packed)
float gbuffer::ior_pack (float ior)
float gbuffer::ior_unpack (float ior_packed)
float gbuffer::thickness_pack (Thickness thickness)
Thickness gbuffer::thickness_unpack (float thickness_packed)
float4 gbuffer::closure_color_pack (float3 color)
float3 gbuffer::closure_color_unpack (float4 color_packed)
float4 gbuffer::sss_radii_pack (float3 sss_radii)
float3 gbuffer::sss_radii_unpack (float4 sss_radii_packed)
float gbuffer::object_id_f16_pack (uint object_id)
uint gbuffer::object_id_f16_unpack (float object_id_packed)
uint gbuffer::geometry_normal_pack (float3 Ng, float3 N)
float3 gbuffer::geometry_normal_unpack (uint data, float3 N)

Enumeration Type Documentation

◆ UsedLayerFlag

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:

  • per "bin": same closure indices as during the material evaluation pass. Can have none-closures.
  • per "layer": gbuffer internal storage order. Tightly packed, will only have none-closures at the end of the array.

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.

Enumerator
CLOSURE_DATA_2 
CLOSURE_DATA_3 
CLOSURE_DATA_4 
CLOSURE_DATA_5 
NORMAL_DATA_1 
NORMAL_DATA_2 
ADDITIONAL_DATA 
OBJECT_ID 

Definition at line 31 of file eevee_gbuffer_types.bsl.hh.

Variable Documentation

◆ GBUFFER_LAYER_MAX

int GBUFFER_LAYER_MAX = 3
staticconstexpr

Definition at line 48 of file eevee_gbuffer_types.bsl.hh.