From f11d8d1689add10107cd5395450110a3c72bc757 Mon Sep 17 00:00:00 2001 From: Rhys Date: Thu, 12 Aug 2021 02:40:48 +0100 Subject: [PATCH] [macOS] support OpenGL < 4.2 in PBS shader (#377) - 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: