Pierre Glibert Posted June 16, 2017 Share Posted June 16, 2017 Hi community, I want to propose you some addition to assetManager and sceneOptimizer. If the solution already exist, said me assetManager : 1. Get loading percent, not on x file loaded but on stream data loaded when it's possible. > for more precision and to show state if you load some big files. 2. Add "abort" function and "onAbort" callback to cancel running tasks and loading files. > Currently "clean" function delete tasks in assetManager but not abort current loads. That mean if you have a big file in loading, it don't stop. sceneOptimizer : 1. Add a starter level to try optimizing render : > I tested the current sceneOptimizer and the problem is it try the best render first. If you have an older device, the website crash and the browser reload page before that sceneOptimizer can downgrade the render. So, it's a loop without ending. 2. Create two steps to optimize render : > First : upgrading. The sceneOptimizer try to reach "x" FPS with the starter level. If it's ok, it upgrade render again until when it can't reach "x" FPS. > Second : dowgrading. If the last try (or the first try with the starter level ) not reach FPS, the sceneOptimizer downgrade until when it can reach FPS. If the sceneOptimizer reach "x" FPS, it stop. > Of course, we keep "trackerDuration" : time in milliseconds between passes. > You will can restart the sceneOptimizer when you add or change something like the current version What do you think about this ? Have a nice day ! wilson, Wingnut and Dad72 3 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 16, 2017 Share Posted June 16, 2017 Hey! They are really good and useful ideas!!! Do you plan to submit a PR for it? Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted June 19, 2017 Author Share Posted June 19, 2017 Hi @Deltakosh, Thank you for your quick answer. I will begin with sceneOptimizer first. I think it's more easier and faster to do For assetManager and "abort", I must to see which files i need to change. I have a lot of work at this moment. So ... soon as possible. I hope add this before babylon 3.0 Have a nice day, Pierre. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 3, 2017 Author Share Posted August 3, 2017 Hi community, I can't just change the current code for sceneOptimizer... So, I make a new proposition called renderGradingSceneOptimizer and write it in sceneOptimizer file : https://github.com/pierreglibert/Babylon.js/blob/76ed247b1c81f24913c458f0501d06d5667ae8b4/src/Tools/babylon.sceneOptimizer.ts What's the purpose of this ? : - Associate render performance ( accessibility ) and dynamic loading performance ( plug and play ) in one new user friendly optimization system. The code not working at this moment, I just write class and method to illustrate how it could work. for exemple : - 1. You can preset some "grades" render like : low, medium and hight quality render. - 2. You can add scene or mesh asset you need for low "grade". So if your hardware is not enough powerfull for medium "grade", you don't need to load and show asset of this "grade". - 3. On asset, you can add LOD version for textures, meshes and (NEW) animations. - 4. Of course, you can also add, like before, optimization like HardwareScalingOptimization, etc. Here, renderGradingSceneOptimizer load asset by "grade" but you can also activate the dynamic load by distance ( calculate on a virtual box and the frustrum of camera). All bounding boxes of meshes, that are not in frustrum, is disabled. There is more feature, see the commented code to see more. what do you think about that ? Have a nice day, Pierre. @Deltakosh Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 3, 2017 Share Posted August 3, 2017 Hello this is an interesting concept. I would like to see it running to understand if it fits in the engine or as an extension Pierre Glibert 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 3, 2017 Author Share Posted August 3, 2017 @Deltakosh Ok thanks. I will do that to present you a first basic version with a little demo . GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 23, 2017 Author Share Posted August 23, 2017 Hi @Deltakosh, I'm almost finished a first version But I have some questions : 1) About FPS average in performanceMonitor class : I saw that, before 1 seconde, the fps increases like if the average is not good calculated. ( I test it with nothing in my scene ) > https://playground.babylonjs.com/#B9MNBA#1 2) About some textures optimization : - Is it possible to rescale textures based on a picture without reload a smaller version ? That will be really powerful for optimization to rescale a texture dynamically. 3) Disable to not render without dispose function. - Is it possible to disable entities ( textures, particules, ... ) like mesh.isVisible to not render it ? For exemple, to not render bump. 4) About culling : - Is culling, or occlusion culling already exist ? 5) About demo : - How can i share a demo ? On a playground after a commit ? If some fonctionnalities are not already exist, is it possible to create it ? ( of course, with my help ). I will not include a load system directly in new optimizer class to remplace the old and to not create an extension. Of course, I will correct AssetManager like mentioned in the first post . Thank you in advance for your answer, Pierre. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 23, 2017 Share Posted August 23, 2017 Hey! 1. Yes the accumulator needs 1s worth of data but you can still rely on https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.performanceMonitor.ts#L56 2. you can use TextureTools.CreateResizedCopy: https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.textureTools.ts 3.You can turn individual channels with these booleans: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/babylon.standardMaterial.ts#L1419 4.Culling is on by default. You can turn it off with material.backFaceCulling = false. Occlusion queries are coming to webgl2 part of the engine 5.Once your extensions will be in the Extension repo, you will be able to use it in the PG Pierre Glibert 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 23, 2017 Author Share Posted August 23, 2017 Thanks for your reply Just one thing ... I want to try to replace the current scene optimizer by the new and not like an extension... The reasons are in the first post But perhaps you said me that for test it before to merge it with babylon.js after ... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 23, 2017 Share Posted August 23, 2017 Sorry I was completely unclear: We just need to test it first before integrating it into the "highly secured" core engine Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 25, 2017 Author Share Posted August 25, 2017 Hi @Deltakosh I have some others questions and remarks ... 1) About particules : Is it possible to not render particules without 'stop' function ? ( like particulesSystem.isVisible = false ) The stop function don't stop immediatly the render of particules. 2) About textureTools : I have a problem with textureTools.CreateResizedCopy. I need to know if the textures are loaded before to resize ... Here an example of what I'm looking for : https://playground.babylonjs.com/#7BI0R2#2 EDIT : FOUND : https://playground.babylonjs.com/#7BI0R2#3 3) About bump textures I saw that renderTargetsEnabled disable bump ... So, I think that it's not important to disable bumpTexture for this version. EDIT : In fact, it disable diffuseTexture too ... is it normal ? EDIT : It's on my side. It's working here : https://playground.babylonjs.com/#95UJ4P Have a nice day, Pierre. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 25, 2017 Share Posted August 25, 2017 1. this coudl be done with scene.particlesEnabled = false 2. Cool 3. Cool again (kind of:)) Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 28, 2017 Author Share Posted August 28, 2017 hi @Deltakosh , I see that 'textureTools.CreateResizedCopy' create a BABYLON.renderTargetTexture if I copy a BABYLON.Texture. That's why I had a bug with scene.renderTargetEnabled = false ... My texture disappeared ^^ so ... some questions : 1) What's the difference between the both ? ( performance, dynamics/static textures, ... ? ) 2) Do you think that will be good to add a condition on 'textureTools.CreateResizedCopy' ? If ( instance of renderTargetTexture ) ... return renderTargetTexture. else ( instance of texture ) ... return texture. Have a nice day, Pierre. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 28, 2017 Share Posted August 28, 2017 1. I need a RTT to resize the initial texture using shaders. I have no other options. A RTT is just a texture where the content will be defined using a render list of meshes or shaders. perfromance wise a texture is similar to a RTT. 2. Unfortunately as mentioned in 1 I cannot do that. Do you have a PG with your initial bug with scene.renderTargetEnabled = false? This is not supposed to break the CreateResizedCopy Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 29, 2017 Author Share Posted August 29, 2017 Thanks for your answers, it's clear Here, the playground https://playground.babylonjs.com/#95UJ4P#5 Uncomment the 42th line to see the RTT disappears EDIT : - RTT.scale() not working too ... - Material.DiffuseTextureEnabled = false not disable diffuse channel ... ( same thing with others channels like bump ) - Normally with RTT.scale(), can I scale to 0.5 first and rescale to 1 later without degradations ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 29, 2017 Share Posted August 29, 2017 Hello! so 1.DiffuseTextureEnabled is a static property of the StandardMaterial: https://playground.babylonjs.com/#95UJ4P#6 2. scale is a destructive operation. It will rescale the container by creating a new one 3. I've fixed the rendersTargetEnabled issue Pierre Glibert 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted August 31, 2017 Author Share Posted August 31, 2017 Hi @Deltakosh , Thanks again for all your answers. I have others problems with renderTargetEnabled and shadows : 1) Poisson shadow look different if all others shadows type are false... 2) renderTargetEnabled destroy or make disappear shadows ... I made a playground for that : https://playground.babylonjs.com/#S3YG63#1 I hope it's not a big bug ... Pierre. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 1, 2017 Share Posted September 1, 2017 1. this is also expected: when you set a specific shadow to false it actually set the filter to NONE: https://github.com/BabylonJS/Babylon.js/blob/2abd0c332ac26b8fbfa47eaec330f6cc68a955b3/src/Lights/Shadows/babylon.shadowGenerator.ts#L189. I will update this behavior to make it a bit more obvious 2. is absolutely expected. Shadows are renderTargets Pierre Glibert 1 Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted September 1, 2017 Author Share Posted September 1, 2017 Ok good ! I have a mistake with useBlurExponentialShadowMap. Shadows are everywhere on spheres. here the playground https://playground.babylonjs.com/#S3YG63#3 Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 1, 2017 Share Posted September 1, 2017 here we are: https://playground.babylonjs.com/#S3YG63#4 and doc: http://doc.babylonjs.com/tutorials/shadows#close-exponential-shadow-map Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted September 4, 2017 Author Share Posted September 4, 2017 Hi @Deltakosh I will put the new grading scene optimizer in Extension repo very soon. I tested it with a little scene, so ... I will test it on a project that I'm doing ( on a bigger scene ). Of course, It's an alpha version at this moment ^^. One bonus for you : demo.mp4 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 5, 2017 Share Posted September 5, 2017 Looks really good! Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted September 20, 2017 Author Share Posted September 20, 2017 Hi @Deltakosh I did a PR for the new grading scene optimizer : https://github.com/BabylonJS/Extensions/tree/master/gradingSceneOptimizer I will create the demo when the PR will accepted. I will do a bigger description for the next post with the demo. I have some questions and comments to do . Have a nice day, Pierre. ps : how can I call an extension in a playground ? thanks. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 20, 2017 Share Posted September 20, 2017 Hey to call the extension in the playground you can rely on cdn.rawgit.com to get a link to it and use it directly Quote Link to comment Share on other sites More sharing options...
Pierre Glibert Posted October 19, 2017 Author Share Posted October 19, 2017 Hi @Deltakosh Sorry for the late post, I have full works at this moment ^^. I write the doc for the new optimizer here : https://github.com/pierreglibert/Extensions/tree/master/gradingSceneOptimizer I will do the demo tomorrow and add comments on the next post. I hope you enjoy. Have a nice day, Pierre. 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.