Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

setContext()- Multiple render targets

edited July 2015 in Suggestions Posts: 105

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!

Comments

  • IgnatzIgnatz Mod
    Posts: 5,396

    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.

  • Posts: 105

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

  • Posts: 105

    @Simeon, could this be implemented?

  • edited July 2015 Posts: 2,020

    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?

Sign In or Register to comment.