From c8cfc043c105a32e1efab341536311277bfc90eb Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 9 Mar 2026 21:07:15 -0700 Subject: Fix clearcoat IBL --- data.cginc | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) (limited to 'data.cginc') diff --git a/data.cginc b/data.cginc index 34eacd6..e0fcd77 100644 --- a/data.cginc +++ b/data.cginc @@ -20,9 +20,6 @@ struct Pbr { #if defined(_EMISSIONS) && defined(FORWARD_BASE_PASS) float3 emission; #endif -#if defined(_AMBIENT_OCCLUSION) - float ao; -#endif #if defined(_BENT_NORMALS) float3 bent_normal; #endif @@ -33,4 +30,60 @@ struct Pbr { #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; +}; + #endif // __DATA_INC -- cgit v1.2.3