Godot Version
4.3
Question
I’m trying to implement the technique used by Sébastien Hillaire’s “A Scalable and Production Ready Sky and Atmosphere Rendering Technique” (see links below). The method involves rendering 2D and 3D LUTs to use as part of the next step of the computation. Is there a way to achieve this in Godot?
Basically, I need to write a shader that can generate a texture (2D and 3D). Then another shader that can take that texture as an input. Ideally all this should stay in GPU memory without having to move data to/from the CPU.
I saw posts about rendering to a ViewportTexture as an intermediate buffer. But that is very clunky to set up, presumably needs to move data back to the CPU, and I don’t see how you could use this workaround for 3D/higher dimensional textures.
Links
The paper is on the author’s website. He also provides an example implementation in this GitHub repo, and someone else implemented it in ShaderToy here. (The relevant part for this question is probably easiest to see on ShaderToy: look at the “channels” - multiple tabs in the code editor on the website).