Dad72 Posted June 13, 2017 Author Share Posted June 13, 2017 Ok, I do it in the day. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 13, 2017 Author Share Posted June 13, 2017 Ok is that the refractive create the problem. 1) Terrain without water => 60 FPS 2) Water without terrain and no refraction => 60 FPS 3) Terrain with water and no reflexion. But with only refraction => 9 FPS Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 14, 2017 Share Posted June 14, 2017 I don't know why but I'll fix that ! Can you give me these informations: - terrain width/height - water mesh width / height and quality so I can reproduce the same scene. Thanks again Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 14, 2017 Author Share Posted June 14, 2017 Ok, I have put you in a zip everything I use. I have not rebuilt the scene, but I've put the functions that create the terrain with the .babylon file, The function to create the water and sky. with all images. I use ShaderBuilder CustomMaterial and also to generate the material on the ground. But I've put all in the zip. I tested with a single camera too, but the problem was the same. I thought maybe it was because I use two camera, but no, it is apparently not that. Link: http://www.babylon.actifgames.com/Water_bug.zip If you prefer me to build a complete scene, I can also make you if you wish. julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 15, 2017 Share Posted June 15, 2017 @Dad72 I'm trying to manipulate your code but I always get a black screen Can you try to repro on the playground instead ? The problem should happen if you create a ground with the same number of vertices than your terrain Or, can you share a link where the scene is working well ? I'll use SpectorJS to debug. Would be awsome if you can put the non-minified files too (I mean water material etc ^^) Thanks! Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 15, 2017 Author Share Posted June 15, 2017 Sorry you receive a black screen. I'll recreate the stage and you provide the zip of the stage. while the files will not be minimifier. I do not know if I can do it tonight, but promised, tomorrow morning I send you the zip. Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 15, 2017 Share Posted June 15, 2017 No problems @Dad72, I thank you a lot because you help me a lot to debug Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 16, 2017 Author Share Posted June 16, 2017 Ok, I recreate the scene. Today I turn to 1 FPS with this scene. I disable refraction, I am a 60 FPS. I even try with a smaller amount of water by dividing by 2 and same thing. It does not come from the size of the water. The ground is very large, I had to rescale. It is possible that this comes from too large a ground. But maybe the rescale is not taken into account by the refraction. I do not know what it is, I make only assumptions. Thank you Luuacro Link: http://www.babylon.actifgames.com/water.zip julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 16, 2017 Share Posted June 16, 2017 Thanks a lot! I found that when I remove the terrain material (created from custom material), I get 60FPS. I'm digging why Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 16, 2017 Share Posted June 16, 2017 Ok I found the problem, it comes from the custom material, the effect is recompiled each time, digging why ^^ (CustomMaterial.prototype.Builder) Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 16, 2017 Share Posted June 16, 2017 Ok I found, the reflection and refraction textures set a clip plane to save pixel performances. So, the terrain material is dirty (should be replaced by another one for the subMesh). With the standard material, the shader is already in cache. With Custom Material, the ShaderIndexer variable is changed then it is not found in shaders cache -> the material is re-created each frame @NasimiAsl do you have a solution for that ? Thanks!!! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 16, 2017 Share Posted June 16, 2017 @Luaacro i don't have any plan yet but need check it julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 16, 2017 Share Posted June 16, 2017 Thanks! Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 16, 2017 Author Share Posted June 16, 2017 Thank you Nasimi for verifying it, because currently, if you use CustomMaerial, you can not use refraction for water or other. The FPS are falling vertiginously. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 16, 2017 Share Posted June 16, 2017 anyone can make sample in PG for this (i need see the fps ) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 16, 2017 Author Share Posted June 16, 2017 I have created a functional scene here. http://www.babylon.actifgames.com/water.zip But I can try to reproduce it the PG too if you want. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 16, 2017 Share Posted June 16, 2017 try in PG i can solve it faster just make low fps Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 16, 2017 Author Share Posted June 16, 2017 I have a version on PG that I managed to display with a can of difficulty : http://www.babylonjs-playground.com/#ICIAGK#6 Otherwise you have a version here directly online: http://www.babylon.actifgames.com/ Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 16, 2017 Share Posted June 16, 2017 i make PR before i test it in your project you can see it now Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 16, 2017 Author Share Posted June 16, 2017 2 minutes ago, NasimiAsl said: you can see it now Can I see where? And what must I see? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 16, 2017 Share Posted June 16, 2017 https://github.com/BabylonJS/Babylon.js/blob/master/materialsLibrary/src/custom/babylon.customMaterial.ts#L602 that force it to run in one time Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 16, 2017 Author Share Posted June 16, 2017 I can not see any change yet. The file has not yet been compiled in JS to http://preview.babylon.com But thanks. I hope that will be enough. I would keep you informed. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 17, 2017 Author Share Posted June 17, 2017 @NasimiAsl Ok, this is compiled. It does not change anything. The FPS are still very low and it seems that refraction is no longer taken into account for water. We should see the sand underwater in refraction. If I disable refraction with the inspector, nothing happens and the FPS does not increase either. I have a version on PG that I managed to display with a can of difficulty : You can test it on its links : http://www.babylonjs-playground.com/#ICIAGK#6 http://www.babylon.actifgames.com/ Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 17, 2017 Share Posted June 17, 2017 Builder is run one time in custom Material Maybe the other Problem kill fps? i cant see your sample yet "Error : create scene most return the scene" Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 17, 2017 Author Share Posted June 17, 2017 see this link : http://www.babylon.actifgames.com/ There is no refraction, before there was. We should see this if we disable reflection in the inspector 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.