Skip to content

How can one write to multiple textures from a fragment shader (a la opengl's COLOR_ATTACHMENT's)? #2767

Answered by bkaradzic
Qix- asked this question in Q&A
Discussion options

You must be logged in to vote

See MRT example: https://bkaradzic.github.io/bgfx/examples.html#deferred

Writing into MRT:

gl_FragData[0] = texture2D(s_texColor, v_texcoord0);
gl_FragData[1] = vec4(encodeNormalUint(wnormal), 1.0);

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Qix-
Comment options

@bkaradzic
Comment options

@Qix-
Comment options

@Qix-
Comment options

@Qix-
Comment options

Answer selected by Qix-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants