-
Multiple writes to gl_FragColor within main
Hi all,
I had to modify a little shader wrote in GLSL someone else than me wrote. In this shader, there are several lines like this:
From what I am use to do (and from what I read here and there), I always write the color to a temporary value (a vec4) and at the end of the main function, effectively write to gl_FragColor.
I tried to find out if this could be a performance issue (since there are several write calls to the fragment), but could achieve to find anything related.
So I hope some people here could say me if that's not a problem at all, or if we should write to a temporary value to avoid effective writes to the fragment color.
Regards.
-
Senior Member
OpenGL Pro
The compiler will create a temporary automatically, if it needs one.
-
Thanks for this quick answer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules