mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
simplify calcs, account for roughness for better defered vs translucent pairing outcomes when fed textures
This commit is contained in:
parent
f00b1d955f
commit
5893355d0a
|
|
@ -593,9 +593,7 @@ vec4 computeForwardProbes(Surface surface,
|
|||
}
|
||||
|
||||
float reflectionOpacity = clamp(surface.baseColor.a, max(length(specular),length(irradiance)),1.0);
|
||||
float reflectionInfluence = max(surface.metalness, reflectionOpacity);
|
||||
surface.metalness = reflectionInfluence;
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, vec3(1.0,1.0,1.0), reflectionInfluence);
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, vec3(1.0,1.0,1.0), reflectionOpacity*surface.roughness);
|
||||
updateSurface(surface);
|
||||
vec2 envBRDF = textureLod(BRDFTexture, vec2(surface.NdotV, surface.roughness),0).rg;
|
||||
vec3 diffuse = irradiance * lerp(surface.baseColor.rgb, vec3(0.04f,0.04f,0.04f), surface.metalness);
|
||||
|
|
@ -613,7 +611,7 @@ vec4 computeForwardProbes(Surface surface,
|
|||
return vec4(lerp((finalColor), surface.baseColor.rgb,surface.metalness),surface.baseColor.a);
|
||||
else
|
||||
{
|
||||
return vec4(finalColor, reflectionInfluence);
|
||||
return vec4(finalColor, reflectionOpacity);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -596,11 +596,8 @@ float4 computeForwardProbes(Surface surface,
|
|||
irradiance = lerp(irradiance,TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.N, skylightCubemapIdx, 0).xyz,alpha);
|
||||
specular = lerp(specular,TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz,alpha);
|
||||
}
|
||||
|
||||
float reflectionOpacity = clamp(surface.baseColor.a, max(length(specular),length(irradiance)),1.0);
|
||||
float reflectionInfluence = max(surface.metalness, reflectionOpacity);
|
||||
surface.metalness = reflectionInfluence;
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, float3(1.0,1.0,1.0), reflectionInfluence);
|
||||
surface.baseColor.rgb = lerp(surface.baseColor.rgb, float3(1.0,1.0,1.0), reflectionOpacity*surface.roughness);
|
||||
surface.Update();
|
||||
float2 envBRDF = TORQUE_TEX2DLOD(BRDFTexture, float4(surface.NdotV, surface.roughness,0,0)).rg;
|
||||
float3 diffuse = irradiance * lerp(surface.baseColor.rgb, 0.04f, surface.metalness);
|
||||
|
|
@ -618,7 +615,7 @@ float4 computeForwardProbes(Surface surface,
|
|||
return float4(lerp((finalColor), surface.baseColor.rgb, surface.metalness),surface.baseColor.a);
|
||||
else
|
||||
{
|
||||
return float4(finalColor, reflectionInfluence);
|
||||
return float4(finalColor, reflectionOpacity);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue