lightmap Posted January 15, 2018 Share Posted January 15, 2018 Hello. How to change main viewport image size so I can fit multiple camera views? (Like 3dMax divide screen with 1,2,3,4 views) Viewport class do not set output size, only image dimensions https://developer.unigine.com/en/docs/2.5/api/library/rendering/class.viewport?rlang=cpp&words=viewport#highlight Searching forum I found that I can render to Image/texture and place it above main render window using WidgetSprite , but overlapping render images just waste of performance. how to setup proper multi-camera-view in main view? thanks Link to comment
silent Posted January 15, 2018 Share Posted January 15, 2018 Hi, As far as I understand - you can disable main renderer (Render::setEnabled(0)) and replace it with set of in-depended viewports that can be placed in whatever position you want via WidgetSprite or any other method. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
lightmap Posted January 16, 2018 Author Share Posted January 16, 2018 ok, I'm done multiview with 3 WidgetSprite and got frame rate drop from ~600 to ~40 on scene with one simple object. each view has struct like: public WidgetSprite spr; public TextureRender m_pTextureRender; public Texture m_pTexture; public Texture m_pTextureDS; in render, for each frame and each view, I have: if (m_pTextureRender.isEnabled() == 0) m_pTextureRender.enable(); m_pTextureRender.setColorTexture(0, m_pTexture); viewport.render(Game.get().getPlayer().getCamera());// one camera for tests m_pTextureRender.disable(); m_pTexture.getImage(viewportImage); w_sprite.setImage(viewportImage); I suppose it do a lot of texture copying Is there any possibility to make it work faster? Link to comment
silent Posted January 16, 2018 Share Posted January 16, 2018 Any possibility to check the small test scene? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
lightmap Posted January 17, 2018 Author Share Posted January 17, 2018 Yes, test project in https://drive.google.com/open?id=1N5QViEu5XuYOkC-E79sRAw01Uw6IQ2GY code from unigine wpf example All related code can be found in .Renderer3D\Views\UnigineControl.cs in class public class UnigineApp : App in method public void OnPaint() thanks Link to comment
lightmap Posted January 22, 2018 Author Share Posted January 22, 2018 Hello, Any comments on test project code? Link to comment
silent Posted January 22, 2018 Share Posted January 22, 2018 Hi, We didn't have much time to get this working yet, sorry. Is there any chance to have 'Release' build working? It's required because there is big overhead with debug builds. Right now I already have quite big spikes with a single window running (30-70 fps on GTX 970): With multiple windows (Operators Cam button pressed): The Average FPS is not changed much. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
lightmap Posted January 22, 2018 Author Share Posted January 22, 2018 Hello, Here link to release version https://drive.google.com/open?id=1HNzGvQYlXRAnfKy46R5jHorM9SO3FuUN for me debug fps drop are not noticeable, comparing to release Link to comment
silent Posted January 23, 2018 Share Posted January 23, 2018 We've checked your test scene. The performance drop is caused mostly by constantly copying textures from GPU to CPU and vice-versa. You can use WidgetSpriteVIewport to avoid this. Please, check the attached modified sources. Thanks! UnigineApp.cs UnigineRenderTarget.cs 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
lightmap Posted January 23, 2018 Author Share Posted January 23, 2018 Thank you now replacing WidgetSprite to WidgetSpriteVievport makes fps drops from 400 to 300, acceptable Link to comment
Recommended Posts