shifted forward lit probe lighting to pre-rt lighting in keeping with the deferred methodologies. in diong so, also needed to add a vertex feature for in/out tangent space normals detection. also in keeping with the fact we sample the deferred albedo result-buffer, fed the createForwardSurface the output target so that can take color multiplication et al instead of just raw albedo

This commit is contained in:
AzaezelX 2019-04-29 17:39:47 -05:00
parent a67e6d109c
commit cd937fca30
4 changed files with 22 additions and 35 deletions

View file

@ -360,11 +360,8 @@ float4 computeForwardProbes(Surface surface,
{
blendFactor[i] *= invBlendSumWeighted;
contribution[i] *= blendFactor[i];
//alpha -= contribution[i];
}
}
//else
// alpha -= blendSum;
float3 irradiance = float3(0, 0, 0);
float3 specular = float3(0, 0, 0);
@ -387,11 +384,11 @@ float4 computeForwardProbes(Surface surface,
}
}*/
//if (hasSkylight && alpha > 0.001)
//{
if (hasSkylight && alpha > 0.001)
{
irradiance += TORQUE_TEXCUBELOD(skylightIrradMap, float4(surface.R, 0)).xyz;
specular = TORQUE_TEXCUBELOD(skylightSpecularMap, float4(surface.R, lod)).xyz;
//}
}
float3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness);
@ -408,7 +405,5 @@ float4 computeForwardProbes(Surface surface,
float3 diffuse = kD * irradiance * surface.baseColor.rgb;
float4 finalColor = float4(diffuse + specular, 1.0);
//finalColor = float4(max(diffuse, specular),1);
return finalColor;
}