فهرست منبع

doublesided material renderfix
as per the OG writeup, need to apply horizon trick strictly to the specular component

AzaezelX 3 سال پیش
والد
کامیت
1f7d06542e

+ 3 - 3
Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl

@@ -496,9 +496,9 @@ vec4 computeForwardProbes(Surface surface,
    float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
    horizon *= horizon;
 #if CAPTURING == 1
-    return vec4(mix(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
+    return vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
 #else
-   return vec4((irradiance + specular) * horizon, 0);//alpha writes disabled
+   return vec4((irradiance + specular* horizon) , 0);//alpha writes disabled
 #endif
 }
 
@@ -657,5 +657,5 @@ vec4 debugVizForwardProbes(Surface surface,
    float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
    horizon *= horizon;
 
-   return vec4((irradiance + specular) * horizon, 0);//alpha writes disabled
+   return vec4((irradiance + specular* horizon) , 0);//alpha writes disabled
 }

+ 3 - 3
Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl

@@ -501,9 +501,9 @@ float4 computeForwardProbes(Surface surface,
    float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
    horizon *= horizon;
 #if CAPTURING == 1
-    return float4(lerp(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
+    return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
 #else
-   return float4((irradiance + specular) * horizon, 0);//alpha writes disabled
+   return float4((irradiance + specular* horizon) , 0);//alpha writes disabled
 #endif
 }
 
@@ -662,5 +662,5 @@ float4 debugVizForwardProbes(Surface surface,
    float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
    horizon *= horizon;
 
-   return float4((irradiance + specular) * horizon, 0);//alpha writes disabled
+   return float4((irradiance + specular* horizon) , 0);//alpha writes disabled
 }

+ 2 - 2
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl

@@ -200,8 +200,8 @@ void main()
    float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
    horizon *= horizon;
 #if CAPTURING == 1
-   OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
+   OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
 #else
-   OUT_col = vec4((irradiance + specular) * horizon, 0);//alpha writes disabled
+   OUT_col = vec4((irradiance + specular* horizon) , 0);//alpha writes disabled
 #endif
 }

+ 2 - 2
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl

@@ -188,8 +188,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET
    float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
    horizon *= horizon;
 #if CAPTURING == 1
-    return float4(lerp(surface.baseColor.rgb,(irradiance + specular) * horizon,surface.metalness/2),0);
+    return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0);
 #else
-   return float4((irradiance + specular) * horizon, 0);//alpha writes disabled
+   return result = float4((irradiance + specular* horizon) , 0);//alpha writes disabled   
 #endif
 }