tooyamk Posted July 21, 2018 Share Posted July 21, 2018 scene.autoClear = false; scene.autoClearDepthAndStencil = false; autoClear and autoClearDepthAndStencil set false, but there is not effect index.html Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 21, 2018 Share Posted July 21, 2018 Hello and welcome to the forum. I've taken the liberty to convert your index.html into what is hopefully am equivalent playground. https://playground.babylonjs.com/#C72SYZ Seems to work the same as your example. I was expecting moving the camera to blur the scene with artifacts. There is also a preserveDrawingBuffer on the engine options (see engine creation in playground liink). Quote Link to comment Share on other sites More sharing options...
tooyamk Posted July 21, 2018 Author Share Posted July 21, 2018 https://www.babylonjs-playground.com/#GEAUD5#2 This has effect. Then click zip and download index.html. Run index.html. But there was no effect. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 21, 2018 Share Posted July 21, 2018 Yes, you are right! I have included code to fix the problem. The zip download is missing not only a check for createEngine(), but also not exporting the Engine construction parameters the same as the default playground. I would call this is a bug in the Playground zip exporter To see, have a look here and update your index.html https://github.com/BabylonJS/Babylon.js/blob/master/Playground/js/index.js#L557 ie: create your engine like this: var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true }); I did try to explicitly create an engine, but it's not also used by the exporter. You could overwrite the engine in the playground and export, but better to edit the HTML directly. edit: I think the exported script should look more like this with engine declared after createScene() function: var engine = (typeof (createEngine === 'function')) ? createEngine() : new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true }); var scene = createScene() Here is the page that creates the engine, so doesn't look too hard to fix.? https://github.com/BabylonJS/Babylon.js/blob/master/Playground/zipContent/index.html#L45 Sebavan 1 Quote Link to comment Share on other sites More sharing options...
tooyamk Posted July 21, 2018 Author Share Posted July 21, 2018 41 minutes ago, brianzinn said: Yes, you are right! I have included code to fix the problem. The zip download is missing not only a check for createEngine(), but also not exporting the Engine construction parameters the same as the default playground. I would call this is a bug in the Playground zip exporter To see, have a look here and update your index.html https://github.com/BabylonJS/Babylon.js/blob/master/Playground/js/index.js#L557 ie: create your engine like this: var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true }); I did try to explicitly create an engine, but it's not also used by the exporter. You could overwrite the engine in the playground and export, but better to edit the HTML directly. edit: I think the exported script should look more like this with engine declared after createScene() function: var engine = (typeof (createEngine === 'function')) ? createEngine() : new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true }); var scene = createScene() perfect!!! thank you Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 21, 2018 Share Posted July 21, 2018 It worked for me - you are missing the 3rd parameter for Engine constructor: <script> var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true }); // ... </script> Quote Link to comment Share on other sites More sharing options...
tooyamk Posted July 21, 2018 Author Share Posted July 21, 2018 7 minutes ago, brianzinn said: It worked for me - you are missing the 3rd parameter for Engine constructor: <script> var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true, { preserveDrawingBuffer: true, stencil: true }); // ... </script> Yeah, I changed the wrong place.Now it's working properly. Thank you brianzinn 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.