webgl - Using gl_FragData[] from multiple shader files -


i have webgl shader set shaders. i'm using multiple render targets (gl_fragdata[])

in first shader, can output

gl_fragdata[0] = vec4(..); gl_fragdata[1] = vec4(..); gl_fragdata[2] = vec4(..); 

now second shader, want output gl_fragdata[3] , save texture pass third shader.

the second shader doesn't seem output gl_fragdata[3], yet works if use in first shader. want output of gl_fragdata[3] stored in texture , sent third shader.

i think may have framebuffer, i've tried changing , have had no luck. missing?

if want use same framebuffer, you'll need mask off unused draw buffers: drawbuffers([color_attachment0, color_attachment1, color_attachment2]) first shader, , drawbuffers([none, none, none, color_attachment3]) second shader.

from ext_draw_buffers:

any colors, or color components, associated fragment not written fragment shader undefined.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -