summaryrefslogtreecommitdiffstats
path: root/yum_lighting.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-06-15 13:00:42 -0700
committeryum <yum.food.vr@gmail.com>2025-06-15 13:00:42 -0700
commitb57eb0894b8abef05db7648addf089cdd3773b54 (patch)
tree08bc3e91d6cf587e130e8fed31b257a027be1a55 /yum_lighting.cginc
parentfbcd6a84b64018a93a3fd4e3e15260d921e93d8e (diff)
add pixel padding to blender plugin
Diffstat (limited to 'yum_lighting.cginc')
-rw-r--r--yum_lighting.cginc21
1 files changed, 0 insertions, 21 deletions
diff --git a/yum_lighting.cginc b/yum_lighting.cginc
index a8e5d4b..a77114f 100644
--- a/yum_lighting.cginc
+++ b/yum_lighting.cginc
@@ -219,23 +219,6 @@ float3 yumSH9(float4 n, float3 worldPos, inout YumLighting light) {
#endif
}
-float3 SubtractMainLightWithRealtimeAttenuationFromLightmap(float3 lightmap, float attenuation, float4 bakedColorTex, float3 normalWorld) {
- float3 shadowColor = unity_ShadowColor.rgb;
- float shadowStrength = _LightShadowData.x;
-
- // Calculate estimated light contribution that should be shadowed
- float ndotl = saturate(dot(normalWorld, _WorldSpaceLightPos0.xyz));
- float3 estimatedLightContributionMaskedByInverseOfShadow = ndotl * (1.0 - attenuation) * _LightColor0.rgb;
- float3 subtractedLightmap = lightmap - estimatedLightContributionMaskedByInverseOfShadow;
-
- // Apply shadow color and strength
- float3 realtimeShadow = max(subtractedLightmap, shadowColor);
- realtimeShadow = lerp(realtimeShadow, lightmap, shadowStrength);
-
- // Pick darkest color
- return min(lightmap, realtimeShadow);
-}
-
YumLighting GetYumLighting(v2f i, YumPbr pbr) {
YumLighting light = (YumLighting) 0;
@@ -247,11 +230,7 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) {
light.direct = _LightColor0.rgb;
// Calculate attenuation first, before diffuse lighting
-#if defined(LIGHTMAP_ON)
- light.attenuation = 1;
-#else
light.attenuation = getShadowAttenuation(i);
-#endif
float3 tangentNormal = mul(pbr.normal, transpose(float3x3(i.tangent, i.binormal, i.normal)));
float3x3 tangentToWorld = float3x3(i.tangent, i.binormal, i.normal);