summaryrefslogtreecommitdiffstats
path: root/brdf.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2026-07-20 18:42:56 -0700
committeryum <yum.food.vr@gmail.com>2026-07-20 18:42:56 -0700
commitf3918c9bc9938d6412e0f79ea9201022567dcddc (patch)
tree5a0043bb354ffd9664ccda2a3bed079bcefd820b /brdf.cginc
parent0aa2636033ce27156c387b5cfbb19ed4ca29d12a (diff)
Clanker vertex light support
Diffstat (limited to 'brdf.cginc')
-rwxr-xr-xbrdf.cginc12
1 files changed, 10 insertions, 2 deletions
diff --git a/brdf.cginc b/brdf.cginc
index 22e0de9..93157e8 100755
--- a/brdf.cginc
+++ b/brdf.cginc
@@ -107,7 +107,7 @@ float G_Estevez(float roughness, float NoL, float NoV) {
return 1.0 / ((1.0 + lambda_l + lambda_v) * 4.0 * NoL * NoV);
}
-float4 brdf(v2f i, Pbr pbr, LightData data, out BrdfData bd) {
+float4 brdf(v2f i, Pbr pbr, LightData data, bool direct_only, out BrdfData bd) {
bd = (BrdfData)0;
float3 specular = 0;
float3 diffuse = 0;
@@ -235,6 +235,8 @@ float4 brdf(v2f i, Pbr pbr, LightData data, out BrdfData bd) {
// Indirect
#if !defined(FURNACE_TEST_DIRECT) && (defined(FORWARD_BASE_PASS) || defined(OUTLINES_PASS))
+ [branch]
+ if (!direct_only)
{
float3 remainder = 1.0f;
#if defined(_CLEARCOAT)
@@ -282,6 +284,8 @@ float4 brdf(v2f i, Pbr pbr, LightData data, out BrdfData bd) {
#endif
#if defined(FORWARD_BASE_PASS)
+ [branch]
+ if (!direct_only)
{
[branch]
if (_UdonLightVolumeEnabled) {
@@ -306,7 +310,7 @@ float4 brdf(v2f i, Pbr pbr, LightData data, out BrdfData bd) {
diffuse *= data.common.ao;
#if (defined(_EMISSIONS) || defined(_LETTER_GRID)) && defined(FORWARD_BASE_PASS)
- float3 emission = pbr.emission;
+ float3 emission = direct_only ? 0 : pbr.emission;
#else
float3 emission = 0;
#endif
@@ -315,4 +319,8 @@ float4 brdf(v2f i, Pbr pbr, LightData data, out BrdfData bd) {
return float4(lit.rgb * lit.a, lit.a);
}
+float4 brdf(v2f i, Pbr pbr, LightData data, out BrdfData bd) {
+ return brdf(i, pbr, data, false, bd);
+}
+
#endif // __BRDF_INC