#ifndef __DATA_INC #define __DATA_INC #include "globals.cginc" // From filament: min roughness s.t. MIN_PERCEPTUAL_ROUGHNESS^4 > 0 in target // precision. Although we use fp32, the higher min roughness gives us a broader // specular highlight, which is preferable. #define MIN_PERCEPTUAL_ROUGHNESS 0.045 #define MIN_ROUGHNESS 0.002025 struct Pbr { float4 albedo; float3 normal; float3x3 tbn; float smoothness; float roughness_perceptual; float roughness; float metallic; #if defined(_EMISSIONS) && defined(FORWARD_BASE_PASS) float3 emission; #endif #if defined(_BENT_NORMALS) float3 bent_normal; #endif #if defined(_CLEARCOAT) float3 cc_normal; float cc_roughness; float cc_roughness_perceptual; float cc_strength; #endif }; struct LightCommon { float3 V; float3 N; float NoV; float ao; float spec_ao; #if defined(_CLEARCOAT) float NoV_cc; #endif }; struct LightDirect { float3 dir; float3 H; float NoH; float NoL; #if defined(_CLEARCOAT) float NoH_cc; float NoL_cc; #endif float LoH; float LoV; float double_LoV; float3 color; }; struct LightIndirect { float3 dir; float3 H; float NoH; float NoL; float LoH; float LoV; float double_LoV; float3 specular; #if defined(_CLEARCOAT) float3 specular_cc; #endif float3 diffuse; float3 L00; float3 L01r; float3 L01g; float3 L01b; }; struct LightData { LightCommon common; LightDirect direct; LightIndirect indirect; }; struct BrdfData { float direct_d; float3 direct_f; float direct_g; #if defined(_CLEARCOAT) float direct_d_cc; float direct_f_cc; float direct_g_cc; #endif float3 ibl_dfg; #if defined(_CLEARCOAT) float3 ibl_dfg_cc; #endif }; #endif // __DATA_INC