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

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -