Is it currently possible to retrieve the output of a compute shader and read it in a buffer? Essentially, I want to initialize some values into a buffer, pass them into a compute shader as a texture to do some math, and then get the values back from the compute shader and have them read in a game object script.
Not at the moment no. We do have a ReadPixels function that grabs all pixels from the backbuffer and puts them into a buffer object, but unfortunately it doesn’t work on any texture and is only exposed via the sdk / native extensions. At least for Vulkan, it would be trivial to support reading from any texture, but it’s not something we are supporting right now. You can file a feature request on our github: GitHub - defold/defold: Defold is a completely free to use game engine for development of desktop, mobile and web games.
2 Likes