Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualmhagain

Posted 06 March 2013 - 05:38 AM

The only output of a fragment shader is going to be a vec4, since you are writing a color (or value) to a render target.

Also depth.

 

And you can have multiple render targets.

 

But in this case, since there is only one vec4 output, and since (in general) outputting colour is something you will always be doing, the GLSL compiler is clever enough to figure out for itself that this vec4 output must be colour.  Personally I'm apprehensive about any kind of mysterious behind-the-scenes ill-defined magic, but that's the decision the ARB have made for GLSL.

 

However, and following a quick read through the GLSL 150 spec, gl_FragColor is still available for use but just marked as deprecated.  That doesn't mean that you can't use it - it just means that it may be removed in a future version.


#1mhagain

Posted 06 March 2013 - 04:08 AM

The only output of a fragment shader is going to be a vec4, since you are writing a color (or value) to a render target.

Also depth.

 

And you can have multiple render targets.

 

But in this case, since there is only one vec4 output, and since (in general) outputting colour is something you will always be doing, the GLSL compiler is clever enough to figure out for itself that this vec4 output must be colour.  Personally I'm mildly suspicious of this kind of mysterious behind-the-scenes ill-defined magic, but that's the decision the ARB have made for GLSL.

 

However, and following a quick read through the GLSL 150 spec, gl_FragColor is still available for use but just marked as deprecated.  That doesn't mean that you can't use it - it just means that it may be removed in a future version.


PARTNERS