GLSLCompat: The Matrix3 Sub-Constructor is called mat3_sub and defers to the builtin mat3 if available.

This commit is contained in:
MeFisto94 2020-04-04 14:07:58 +02:00 committed by Stephen Gold
parent 728a07a25f
commit f68d88937f
2 changed files with 5 additions and 2 deletions

View File

@ -43,9 +43,11 @@ out vec4 outFragColor;
#endif
#if __VERSION__ == 110
mat3 mat3(mat4 m) {
mat3 mat3_sub(mat4 m) {
return mat3(m[0].xyz, m[1].xyz, m[2].xyz);
}
#else
#define mat3_sub mat3
#endif
#if __VERSION__ <= 140

View File

@ -143,7 +143,8 @@ float renderProbe(vec3 viewDir, vec3 worldPos, vec3 normal, vec3 norm, float Rou
if(lightProbeData[0][3] != 0.0){
// oriented box probe
mat3 wToLocalRot = inverse(mat3(lightProbeData));
// mat3_sub our compat wrapper for mat3(mat4)
mat3 wToLocalRot = inverse(mat3_sub(lightProbeData));
vec3 scale = vec3(lightProbeData[0][3], lightProbeData[1][3], lightProbeData[2][3]);
#if NB_PROBES >= 2