How to RTT(Render To Texture)

Intro:

Hello Lumberyard Community.

I’m coming from development on another engine and recently discovered lumberyard and how polished it is. I’m trying to port over some functionally and there are a few question I have. I’m mainly wondering if I need to develop something or if its part of the lumberyard core.

Question:

Is it possible to pass a pixel buffer and render to a texture? And are there any examples of doing this? What part of the API should I be looking at? To explain I previously was rendering different cameras and a chromium instance to textures and was wondering if it was possible to do the same.

The only previous reference I found was this post, which doesn’t help much:

https://forums.awsgametech.com/t/render-to-texture/1019/1

Hope my question makes sense.

Thanks!

Hi @Spex1848, one method you can pursue is using the same code path that rendering environment probes uses, or use the screenshot system and copy the framebuffer to a texture. This would not be a real time solution, but might be a work around you can use for now. I recommend turning off multi-threaded rendering (r_multithreaded 0) as well if you go this route.

I have an experimental version of render to texture that is not part of the engine yet, but I am looking into other options for distributing this code in a way where it won’t be supported, but would at least be available for testing by a wider audience. I’ve created an internal issue to track this request LY-84395.

UPDATE: Lumberyard 1.18 introduces the render to texture component which can be used to draw a scene to a texture https://docs.aws.amazon.com/lumberyard/latest/userguide/component-render-to-texture.html

Hi @petrocket I am also looking for a solution to RTT which is one of the major things holding me back in LY. Have you made any progress on that in the last month by any chance? :slight_smile:

Also, we can’t access your jira. :wink:

Thanks

Hi @petrocket, I probably could integrate it, but I can just wait if it will be released in an upcoming version. Greatly looking forward to it! Thanks for the reply!

Thanks @Uriah, we just use the issues for tracking internally. We are still testing the feature. How comfortable are you with integrating large code changes?

Actually @petrocket if you can post your code there are a few people on Discord and Slack who would like to test it and provide feedback! =)

Thank you for the follow up! Really excited to use the feature. Also really appreciate all the hard-work by the lumberyard team!