diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-20 22:01:22 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-20 22:01:22 -0800 |
| commit | ffb4b6b861a7f4a5c2468824e16872883f64c290 (patch) | |
| tree | b009b9e619d4ca94e5fc0c6d9b0cdc8c83de75e8 /yum_lighting.cginc | |
| parent | 0ef282da6a87c27e4056faaedb2847eed1f5a8a7 (diff) | |
Add fur shader, and begin slimming interpolators
Diffstat (limited to 'yum_lighting.cginc')
| -rw-r--r-- | yum_lighting.cginc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/yum_lighting.cginc b/yum_lighting.cginc index a0a4a2e..b8dcf31 100644 --- a/yum_lighting.cginc +++ b/yum_lighting.cginc @@ -347,8 +347,9 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) { // Calculate attenuation first, before diffuse lighting light.attenuation = getShadowAttenuation(i); - float3 tangentNormal = mul(pbr.normal, transpose(float3x3(i.tangent, i.binormal, i.normal))); - float3x3 tangentToWorld = float3x3(i.tangent, i.binormal, i.normal); + float3 binormal = cross(i.tangent, i.normal); + float3 tangentNormal = mul(pbr.normal, transpose(float3x3(i.tangent, binormal, i.normal))); + float3x3 tangentToWorld = float3x3(i.tangent, binormal, i.normal); // Use Bakery-aware irradiance function #if defined(LIGHTMAP_ON) @@ -367,7 +368,7 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) { light.diffuse.gb = light.diffuse.r; #endif #else - light.diffuse = getIndirectDiffuse(i, pbr.normal, float4(i.vertexLight, 0), light); + light.diffuse = getIndirectDiffuse(i, pbr.normal, float4(i.vertexLight.xyz, 0), light); light.occlusion = 1; #endif |
