html5 canvas - taking a 'snapshot' of babylonjs scene sometimes works, sometimes doesn't -
i trying take 'snapshot' of babylon3d scene ... in other words: trying clone babylon3d canvas when user presses button, , append new <canvas>
<body>
.. works, other times not.
however, if use simple canvas (ie. using fillrect), cloning/appending works expected.
i have set test on plunker demonstrate problem: plunker: press button on , on again see how sporadic behaves when there babylon scene. and note: can toggle between simple canvas , babylon canvas within _jquery(document).ready(...) handler.
thanks, shannon
this because version 2.3.0 of babylonjs :
engine initialize webgl preservedrawingbuffer = false default.
you need initialize engine passing {preservedrawingbuffer: true}
object third parameter.
but unfortunately kill canvas' performances.
i'm not specialist of babylonjs, , didn't find way make call scene.render
method use flag method proposed @capse. there babylon.tools.createscreenshot(engine, camera, size)
method, make downloadable png scene ; maybe you.
Comments
Post a Comment