Render to and take screenshots from a buffer that isn't the main frame buffer
Posted: Tue Nov 29, 2022 7:17 pm
Hi all
I was taking a look at the createScreenshot function and saw that it takes two optional arguments, the second of which being a render target. I am currently trying to get a headless copy of minetest running that will still allow you to take screenshots of what is going on "behind the scenes" (for reinforcement learning), so this was of interest to me. I thought that it could be possible to set this texture to something other than the main frame buffer and just "render" to this.
However, the argument accepted by createScreenshot is an enum that allows you to choose between a few "special" render targets. Even more strangely, one of the options is ERT_RENDER_TEXTURE, with the accompanying description "Render target is a render texture". On paper this sounds like the behaviour I want, but why is this a fixed-value enum? (I want to create a dummy target and pass it in here). I am very confused and would like this clearing up, and more generally if anyone has any suggestions as to how I might achieve my goal that would be awesome.
Thank you for your patience.
I was taking a look at the createScreenshot function and saw that it takes two optional arguments, the second of which being a render target. I am currently trying to get a headless copy of minetest running that will still allow you to take screenshots of what is going on "behind the scenes" (for reinforcement learning), so this was of interest to me. I thought that it could be possible to set this texture to something other than the main frame buffer and just "render" to this.
However, the argument accepted by createScreenshot is an enum that allows you to choose between a few "special" render targets. Even more strangely, one of the options is ERT_RENDER_TEXTURE, with the accompanying description "Render target is a render texture". On paper this sounds like the behaviour I want, but why is this a fixed-value enum? (I want to create a dummy target and pass it in here). I am very confused and would like this clearing up, and more generally if anyone has any suggestions as to how I might achieve my goal that would be awesome.
Thank you for your patience.