shift ambient occlusion to the ibl terms only

This commit is contained in:
AzaezelX 2019-07-02 19:20:31 -05:00
parent e87dc787ee
commit 679197d7ca
2 changed files with 4 additions and 6 deletions

View file

@ -218,7 +218,7 @@ inline float3 getDirectionalLight(in Surface surface, in SurfaceToLight surfaceT
float3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor;
float3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor;
float3 final = max(0.0f, diffuse + spec * surface.ao);
float3 final = max(0.0f, diffuse + spec);
return final;
}
@ -230,7 +230,7 @@ inline float3 getPunctualLight(in Surface surface, in SurfaceToLight surfaceToLi
float3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor;
float3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor;
float3 final = max(0.0f, diffuse + spec * surface.ao * surface.F);
float3 final = max(0.0f, diffuse + spec * surface.F);
return final;
}
@ -462,7 +462,6 @@ float4 computeForwardProbes(Surface surface,
//final diffuse color
float3 diffuse = kD * irradiance * surface.baseColor.rgb;
float4 finalColor = float4(diffuse + specular * surface.ao, 1.0);
float4 finalColor = float4(diffuse* surface.ao + specular * surface.ao, 1.0);
return finalColor;
}

View file

@ -199,7 +199,6 @@ float4 main(PFXVertToPix IN) : SV_TARGET
//final diffuse color
float3 diffuse = kD * irradiance * surface.baseColor.rgb;
float4 finalColor = float4(diffuse + specular * surface.ao, 1.0);
float4 finalColor = float4(diffuse* surface.ao + specular * surface.ao, 1.0);
return finalColor;
}