naumova.natalya Posted February 8, 2019 Share Posted February 8, 2019 (edited) Hello! I try to create a class which contains camera, viewport and sprite. The idea is to create multiple instances and some of them will be rendered with different post materials. I managed to do so but my program wouldn't work with some of default materials. After some debugging I realized that the following exception was caused by tag <texture /> with "materials" parameter in it. I tried to insert this material ("post_sensor_heat") to TextureRender sample instead of "render_copy_2d" and it also throws this exception. Screenshot sample doesn't suit me because I have multiple viewports and callbacks work only with the last set viewport (Unigine::Render::get()->setViewport()). May be there is another way to render multiple sprites from their cameras using post materials? Thank you in advance! Edited February 8, 2019 by naumova.natalya Link to comment
silent Posted February 8, 2019 Share Posted February 8, 2019 Hi Natalya, Could you please give us more details about this use-case? What is the input and how the final output should look like? A simple test scene where you get crashes would be also very helpful in debugging. 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
naumova.natalya Posted February 8, 2019 Author Share Posted February 8, 2019 Hi, silent! You could use TextureRender sample but instead of "render_copy_2d" in "copy_texture()" write "post_sensor_heat". I'll create test project and send it next. Link to comment
naumova.natalya Posted February 8, 2019 Author Share Posted February 8, 2019 Here is the test project with comments where it crashes. TestPostMaterials.7z Link to comment
silent Posted February 8, 2019 Share Posted February 8, 2019 post_sensor* material is pretty complex and requires multiple additional textures that available only if you have viewport - that's why it as materials section defined in XML. As far as I know TextureRender is not using any Viewports, that's why you get this assert in debug. To fix this you need manually set post material via Render::setPostMaterial() before the viewport->renderTexture2D(camera, texture) (see previous sample TestCopy2D with viewports usage). 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
silent Posted February 8, 2019 Share Posted February 8, 2019 Please, check the attached sources - source.7z. Is that what you want to achieve in general? 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
naumova.natalya Posted February 8, 2019 Author Share Posted February 8, 2019 Yes!! Thank you a lot!! Link to comment
Recommended Posts