Refactor material shaders generator to use modular features as extensions

This commit is contained in:
Wojtek Figat
2021-02-04 10:43:04 +01:00
parent a560b19cbc
commit 2a3b6edf50
29 changed files with 877 additions and 711 deletions

View File

@@ -173,24 +173,4 @@ float3 AOMultiBounce(float visibility, float3 albedo)
return max(visibility, ((visibility * a + b) * visibility + c) * visibility);
}
#if CAN_USE_LIGHTMAP
// Evaluates the H-Basis coefficients in the tangent space normal direction
float3 GetHBasisIrradiance(in float3 n, in float3 h0, in float3 h1, in float3 h2, in float3 h3)
{
float3 color = 0.0f;
// Band 0
color += h0 * (1.0f / sqrt(2.0f * PI));
// Band 1
color += h1 * -sqrt(1.5f / PI) * n.y;
color += h2 * sqrt(1.5f / PI) * (2 * n.z - 1.0f);
color += h3 * -sqrt(1.5f / PI) * n.x;
return color;
}
#endif
#endif