setContext()- Multiple render targets

Is there a way to write to two or three different images with setContext?
Doing deferred rendering requires you to have depth, normals and colors available for one pixel, and I would not like to render my scene 3 times!
I suppose you would use gl_FragData[0] to write to the first one and gl_FragData[2] for the second one…
Anyway, this would be a great feature!

setContext only draws to one image at a time. You could use setContext with a shader to calculate depths and write them to an image, then repeat with normals to a different image, but it would require multiple passes.

Yes, that’s why I would like this feature in Codea

@Simeon, could this be implemented?

I think that multiple render targets weren’t added to Open GLES until 3.0, and Codea uses 2.0. It would be interesting to have GLES 3.0 in Codea (I’d like to use batched drawing), though I think it needs an A7 chip or higher?