From c4279afdb9b47374ff71c83cded80f011dd7313f Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Wed, 11 Aug 2021 22:19:57 +0100 Subject: [PATCH] [macOS] support OpenGL < 4.2 in PBS shader - OpenGL < 4.2 does not support swizzling built in types (e.g. float). - Update the definition of @piece( maxR1F0 ) to work in OpenGL 4.1 Signed-off-by: Rhys Mainwaring --- ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl b/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl index 2aba21aa7..9db4c8608 100644 --- a/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl +++ b/ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl @@ -12,7 +12,7 @@ @property( !fresnel_scalar ) @piece( maxR1F0 )max( 1.0 - ROUGHNESS, @insertpiece( F0 ).x )@end @end @property( fresnel_scalar ) - @piece( maxR1F0 )max( (1.0 - ROUGHNESS).xxx, @insertpiece( F0 ).xyz )@end + @piece( maxR1F0 )max( (1.0 - vec3(ROUGHNESS, 0.0, 0.0)).xxx, @insertpiece( F0 ).xyz )@end @end //For mortals: