cinetec_tech Posted March 16, 2016 Share Posted March 16, 2016 we would like a feature which could do an engine render update from the script like in script init() { forloop(int i=0;5){ LightOmni omni=new LightOmni(); render_world(); ..................... } } render_world() will render the engine for just one frame. it's useful for some cases like getProceduralTextureImage...etc those function have to be rendered one frame to get the correct image. Link to comment
grmmvv Posted March 18, 2016 Share Posted March 18, 2016 Hi,Unfortunately right now we have no plans to add such feature.Anyway, please describe in more details what do you want to do, maybe we can provide a workaround.Sorry for the inconvenience caused. Link to comment
cinetec_tech Posted March 19, 2016 Author Share Posted March 19, 2016 Hi, Unfortunately right now we have no plans to add such feature. Anyway, please describe in more details what do you want to do, maybe we can provide a workaround. Sorry for the inconvenience caused. just a example: int init(){ forloop (int i=0;5){ LightOmni newLight=add_editor(new LightOmni()); newLight.setPosition(vec3(i,0,0)); Image image=new Image(); //now use renderimage2d to render the screen to image renderImage2D(.....) image.save(format("%i.dds",i)); } } you can see those lights added on the dds file but no shadow. it might be not actually updated in the scene so they couldn't be rendered. Link to comment
maxi Posted March 22, 2016 Share Posted March 22, 2016 Hi, You can separate code with creating nodes and other with rendering into image. And execute second block in next update. For example, using script thread: int init(){ thread([]() { LightOmni newLight=add_editor(new LightOmni()); newLight.setPosition(vec3(i,0,0)); Image image=new Image(); // wait one frame to render new node wait; renderImage2D(.....) image.save(format("%i.dds",i)); }); } Link to comment
unclebob Posted March 23, 2016 Share Posted March 23, 2016 Hi there! It looks like a bug inside renderNode2D to me as it must render shadows properly without any delays. Also, if you're worrying about node not being updated in the scene, use can use engine.world.updateSpatial function for such cases. Link to comment
cinetec_tech Posted March 24, 2016 Author Share Posted March 24, 2016 i think properly rendering and node updates are seperated threads? so when renderimage2d it don't know there is a new light in the scene? Link to comment
unclebob Posted March 29, 2016 Share Posted March 29, 2016 Hi, No, world update and render routines are in the same thread. Unless you create new node in flush (which could be in separate thread depending on the value of physics_threaded console variable), there'll be no issues like that. Link to comment
Recommended Posts