Multiple render targets

Is there a way to use multiple render targets in Codea? OpenGL ES 3 supports it, but I see no way to utilize this.

@dave1707 Probably. I’m talking about fragment shader having multiple outputs. I know it’s possible to draw to a texture instead of the actual screen, but what about several at once? Would love to see your example regardless.

@SamTheMadRabbit
Codea does not support MRT since setContext() can only render to one image at a time. Are you trying to create a deferred renderer?

@MMGames i hoped to use it to get a depth map for SSR and other things.

@SamTheMadRabbit I have been doing deferred rendering on codea for a while now (mostly for things like VCT, LPV and PBGI because I am obsessed with real time GI).

I render the scene once and output ViewPos.z encoded i 3 channels (only have 8-bit precision per channel), and color i w.
Then I calculate the normals from the depthbuffer in another shader which goes into my second texture.
And then direct light and so on

Maybe you know how to tackle this already, but if you search for voxel cone tracing in this forum you will see my old deferred engine with VCT (if you’re interested of course)