Refactor material shaders generator to use modular features as extensions

This commit is contained in:
Wojtek Figat
2021-02-04 14:58:01 +01:00
parent 2a3b6edf50
commit 9e6243adcc
14 changed files with 308 additions and 677 deletions

View File

@@ -61,9 +61,6 @@
#ifndef MAX_TESSELLATION_FACTOR
#define MAX_TESSELLATION_FACTOR 15
#endif
#ifndef IS_MOTION_VECTORS_PASS
#define IS_MOTION_VECTORS_PASS 0
#endif
#ifndef PER_BONE_MOTION_BLUR
#define PER_BONE_MOTION_BLUR 0
#endif
@@ -164,6 +161,12 @@ float3x3 CalcTangentBasisFromWorldNormal(float3 normal)
return float3x3(tangent, bitangent, normal);
}
float3x3 CalcTangentBasis(float3 normal, float4 tangent)
{
float3 bitangent = cross(normal, tangent.xyz) * tangent.w;
return float3x3(tangent.xyz, bitangent, normal);
}
// [Jimenez et al. 2016, "Practical Realtime Strategies for Accurate Indirect Occlusion"]
float3 AOMultiBounce(float visibility, float3 albedo)
{