Jump to content

RenderRenderer::get_material_size(): can't get screen


photo

Recommended Posts

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.

image.png.1fd27adee566973b0ede06213c0fd20e.png

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 by naumova.natalya
Link to comment

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

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:

Link to comment
×
×
  • Create New...