Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | RaXaR | |
Old Version | Published before Godot 3 was released. |
I am currently generating a texture with a custom shader. I"ve got two scenes, my Main scene and a TextureGenerator scene.
The TextureGenerator scene has two Nodes, a Vieport as the root and TextureRect as the only child. The TextureRect uses my custom shader and I use the Viewport.get_texture() method to return a copy of the rendered view.
All of this works fine, but it seems a bit slow.
Does anyone know of a more performant way to do the above in Godot?
Maybe some direct rendering to a buffer or something? I dunno.
Thanks.
Documentation mentions:
viewport.queue_screen_capture()
andviewport.get_screen_capture()
(takes a couple of frames).viewport.get_render_target_texture()
when the viewport is used as a render target (rendering not visible onscreen).
snwflk | 2017-11-30 16:35
Those methods you mention are for the 2.x branch.
Thanks anyway.
RaXaR | 2017-11-30 17:36
Literally “for nothing” Indeed I haven’t tested them but the documentation should be amended. It is also for 3.x (latest version): Using Viewports — Godot Engine (latest) documentation in English
Although I don’t need it right now, I’m curious about this too as I’m going to need/use it very often.
snwflk | 2017-11-30 17:52