Skip to content

Commit

Permalink
[macOS] support OpenGL < 4.2 in PBS shader (#377)
Browse files Browse the repository at this point in the history
- 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 <rhys.mainwaring@me.com>
  • Loading branch information
srmainwaring authored Aug 12, 2021
1 parent 44a1948 commit f11d8d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ogre2/src/media/Hlms/Pbs/GLSL/BRDFs_piece_ps.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f11d8d1

Please sign in to comment.