18 float clearcoat_roughness,
21 const float use_clearcoat,
32 clearcoat_roughness =
saturate(clearcoat_roughness);
37 ClosureEmission emission_data;
38 emission_data.emission = emissive.rgb * weight;
40 ClosureTransparency transparency_data;
41 transparency_data.transmittance =
float3(transp * weight);
42 transparency_data.holdout = 0.0f;
44 float alpha = (1.0f - transp) * weight;
46 ClosureDiffuse diffuse_data;
47 diffuse_data.color = diffuse.rgb * alpha;
50 ClosureReflection reflection_data;
55 reflection_data.color = brdf * weight;
56 reflection_data.N =
N;
57 reflection_data.roughness = roughness;
60 ClosureReflection clearcoat_data;
62 float weight = alpha * clearcoat * 0.25f;
66 clearcoat_data.color = brdf * weight;
67 clearcoat_data.N = CN;
68 clearcoat_data.roughness = clearcoat_roughness;
71 if (use_clearcoat != 0.0f) {
72 result =
closure_eval(kg, sd, diffuse_data, reflection_data, clearcoat_data);
75 result =
closure_eval(kg, sd, diffuse_data, reflection_data);
float3 brdf_lut(KernelGlobals &kg, float3 F0, float3 F90, float cos_theta, float roughness, bool do_multiscatter)
void node_eevee_specular(float4 diffuse, float4 specular, float roughness, float4 emissive, float transp, float3 N, float clearcoat, float clearcoat_roughness, float3 CN, float weight, const float use_clearcoat, KernelGlobals &kg, ShadingData &sd, Closure &result)