david.sanda Posted January 19, 2020 Share Posted January 19, 2020 (edited) I use this code in plugin to add glow to selected nodes in the world. auto obj = Unigine::checked_ptr_cast<Unigine::Object>(node); for (int i = 0; i < obj->getNumSurfaces(); i++) { obj->setMaterialState("auxiliary", 1, i); obj->setMaterialParameterFloat4("auxiliary_color", color, i); } with the generic initialization being Unigine::Console::run("render_auxiliary 1"); Unigine::Render::setPostMaterials("post_filter_selection"); This works in the initial world loaded, as editor is started, but it does not work after another world is loaded like this... auto resu=World::loadWorld(world_name); auto pl = PlayerSpectator::create(); pl->setPosition(Math::Vec3(0.0f, 3.401f, 1.5f)); Game::setPlayer(pl); pl->setMainPlayer(1); Game::setEnabled(1); I know this is demonstrated in post_selection demo, but the loadWorld somehow breaks it. Edited January 20, 2020 by david.sanda Link to comment
silent Posted January 20, 2020 Share Posted January 20, 2020 Hi David, Could you please send us a minimal test scene (data and source folders will be enough) and some step-by-step guide how to reproduce this behavior? Right now it's not completely clear the whole pipeline that you are using in your projects. 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
david.sanda Posted January 21, 2020 Author Share Posted January 21, 2020 (edited) Anyway, if instead of World::loadWorld("xy"); I use Console::run("world_load xy"); the post_selection works as in your examples. Not sure what difference is there between these two methods of world loading, but as the problem is solved, you can close it. Edited January 21, 2020 by david.sanda Link to comment
silent Posted January 21, 2020 Share Posted January 21, 2020 Hi David, That's interesting because internal implementation of these world loading methods are the identical. If you will have some additional time and could prepare a small test scene - we would glad to see what is going on and fix. 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
Recommended Posts