3d - Render the shadows once for all -


given cost of shadow casting, wondering if there feature or possible/experimental way render shadowmap once in three.js (even in webgl), static objects positionned dynamically (ex: procedural city). result can used in next frames static objects, @ no cost. shadow rendering done when moves.

edit

mrdoobs approved :

renderer.shadowmap.autoupdate = false; renderer.shadowmap.needsupdate = true; // when scene changes 

original answer :

i found way : copied way verticesneedupdate works. added shadowmapneedsupdate = true parameter webglrenderer. in render function of shadowmapplugin check if paramater true , set false after :

if( _renderer.shadowmapenabled===false || _renderer.shadowmapneedsupdate===false ) return;  _renderer.shadowmapneedsupdate = false

this way shadowmap rendered once @ first rendering, , if scene requires realtime shadowmap has precised in render loop. otherwise computational power freed


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -