Search the Community
Showing results for tags 'savestate'.
-
Hi All, I'm currently implementing a custom fisheye viewport since the panoramic rendering is not open enough for our needs. As described in other posts I'm disabling various screen space effects. However, there might be other viewports that still can have the SS effekts enabled. So in in my FisheyeViewport::render() I want to disable and later reenable the render settings. Currently the Code looks like this: void FisheyeViewport::render() { // ... // save current render settings // Unigine::BlobPtr render_settings_blob = Unigine::Blob::create(); // Unigine::Render::saveState(render_settings_blob); Unigine::XmlPtr render_settings = Unigine::Xml::create(); Unigine::Render::saveWorld(render_settings); Unigine::Render::setTAA(false); Unigine::Render::setSSAO(false); Unigine::Render::setSSR(false); Unigine::Render::setWhiteBalance(false); Unigine::Render::setExposureMode(Unigine::Render::EXPOSURE_DISABLED); Unigine::Render::setExposure(2); Unigine::Render::setBloom(false); Unigine::Render::setFilmic(false); Unigine::Render::setLightsLensFlares(false); // do the fisheye rendering // ... // restore render settings // Unigine::Render::restoreState(render_settings_blob); Unigine::Render::loadWorld(render_settings); } The Render::restoreState() function is marked as deprecated (although it still exists in 2.12). The Render::saveState() function is not marked as deprecated which irritates me as I don't see how to use it without Render::restoreState(). Also using Render::restoreState() as described above results in an Exception: terminate called after throwing an instance of 'char const*' Signal: SIGABRT (Aborted) which is why I switched to using an XML node. This works, but feels more like a workaround. Whats the intended workflow for saving and restoring the state? Thanks and greetings!