Jump to content

[SOLVED] Best way to have a gui viewport rendering the same as main window


photo

Recommended Posts

Hi,

I have a Unigine::Widgets::Window with a virtual monitor that it's displaying the same image as main viewport. I already done using a WidgetSpriteViewport and the engine.game player. I suspect I'm rendering the same image twice.

I wonder if there is another way more efficent to do this. Something similar to image_00 sample but instead of calling engine.render.renderImage2D(), using the already rendered image created by main viewport.

 

Thanks in advance,

Iván.

Link to comment

just brainstorming without too much of thinking: maybe new unigine custom post-processing shader could be used to copy final rendered main viewport image to a (smaller) GPU-side material texture that can be used on the next frame for gui viewport rendering. 1-frame-delay shouldn't be a problem in most cases.

 

not sure if this is actually possible, but maybe a starting point for some experimenting

Link to comment
  • 1 month later...

If you don't need the rendering inside the main window just call engine.render.setEnabled(0). Or as an option you can create a custom App which will be replicate the final image into the external one. Inside Unigine API you can find a ready to use stack of textures, render targets and shaders.

Link to comment
×
×
  • Create New...