Multiple subroutine types defined in the same fragment shader does not work correctly using GLSL Shaders
I'm working on a program using GLSL shaders. I coded 2 different ways to compute ADS (Ambient + Diffuse + Specular) shading in 2 different methods. To do the job properly I used subroutines to use one or the other method to compute ADS shading. Here's a piece of the fragment shader code : subroutine vec3 LightShadingEffectType(int idx, vec3 normal, vec3 lightDir); subroutine uniform LightShadingEffectType LightShadingEffect; subroutine (LightShadingEffectType) vec3 Basic_ADS_Shading(int idx, vec3 normal, vec3 lightDir) { vec3 reflectDir = reflect(-lightDir, normal); vec3 viewDir = normalize(