Dad72 Posted April 19, 2018 Share Posted April 19, 2018 I get a lot of errors with CustomMaterial and on my project it makes a lot of shifting and even crashing the page. I have a huge drop in FPS going up and down constantly. I'm going to have 15 fps 2, 3 seconds, then 55, then 50, then 10, then 60. In short, it's random and a little later, the page crashes. If, I do not use CustomMateriel for verification purposes that this is the problem or not, I do not have these delays. I guess CustomMateriel has optimization problems The errors I receive are: Quote [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT RENDU: aucune texture n'est liée à l'unité 5 [.Offscreen-For-WebGL-000001C312A51F00] ATTENTION: la texture liée à l'unité de texture 6 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT DE RENDU: la texture liée à l'unité de texture 7 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT RENDU: la texture liée à l'unité de texture 8 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT RENDU: la texture liée à l'unité de texture 9 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT RENDU: la texture liée à l'unité de texture 10 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT RENDU: la texture liée à l'unité de texture 11 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT RENDU: la texture liée à l'unité de texture 12 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. [.Offscreen-For-WebGL-000001C312A51F00] AVERTISSEMENT DE RENDU: la texture liée à l'unité de texture 13 n'est pas rendue. Il peut être non-power-of-2 et avoir un filtrage de texture incompatible. On my project I have his mistakes there in addition that appears randomly on the PG Quote [.Offscreen-For-WebGL-0000026D37EF1FA0] AVERTISSEMENT RENDU: il n'y a pas de texture liée à l'unité 0 (index): 1 WebGL: trop d'erreurs, plus d'erreurs seront rapportées à la console pour ce contexte. Voici le PG: http://www.babylonjs-playground.com/#ICIAGK#15 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 19, 2018 Author Share Posted April 19, 2018 In fact I notice that the number of texture increases very quickly and I find myself with more than 100 000 000 of textures. Because of this : terrainMaterial.onBindObservable.add(() => { terrainMaterial.getEffect().setTexture('texture', new BABYLON.Texture("texture.png", scene)); }; It's an infinite loop that loads the textures infinitely. The textures instead of being loaded once, have it infinite to plant the page. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 19, 2018 Share Posted April 19, 2018 Beware, onBindObservable is called on every frame so you are instantiating a new texture per frame. Not a good idea Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 19, 2018 Author Share Posted April 19, 2018 It worked well before. what should be used in this case as observable ? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 19, 2018 Share Posted April 19, 2018 onCompiled maybe? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 19, 2018 Author Share Posted April 19, 2018 No onCompiled does not work, or maybe I do not know how to use it. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 19, 2018 Author Share Posted April 19, 2018 How to use setTexture once and not every image. Before I did not have this problem since onBindObservable exists, but now yes. @Deltakosh What is the alternative to onBindObservable because whatever else I try nothing works ? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 19, 2018 Author Share Posted April 19, 2018 I do not know if it's a good solution, but by adding that, it solves the problem. But I do not feel like it's a good solution. if(scene.isReady()) { terrainMaterial.onBindObservable.clear(); } Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 19, 2018 Share Posted April 19, 2018 http://www.babylonjs-playground.com/#ICIAGK#17 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 19, 2018 Author Share Posted April 19, 2018 The ground is black Pryme. It does not work. It works if I do as before with clear() But it is not the right solution even if it works in part. http://www.babylonjs-playground.com/#ICIAGK#20 By cons I use only 11 textures and it tells me that I use 43 to 59 ??? There is a problem of calculation. Bug ? this loads the textures 5 times for each in onBindObservable. Nothing else works only onBindObservable. Is this a problem in CustomMaterial? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 19, 2018 Share Posted April 19, 2018 I have had a lot of problems with the CustomMaterial lately as well Quote Link to comment Share on other sites More sharing options...
Guest Posted April 19, 2018 Share Posted April 19, 2018 You can keep it, just remove the instanciation: var texture = new BABYLON.Texture("texture.png", scene); terrainMaterial.onBindObservable.add(() => { terrainMaterial.getEffect().setTexture('texture', texture ); }; Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 19, 2018 Author Share Posted April 19, 2018 Ok, that's something to know. If we instantiate a texture in the onBindObservable we end up with an infinite loop therefore. Thank you Deltakosh Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 19, 2018 Share Posted April 19, 2018 1 hour ago, Dad72 said: Ok, that's something to know. If we instantiate a texture in the onBindObservable we end up with an infinite loop therefore. Thank you Deltakosh I actually think this might solve the trouble I have been having as well. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 20, 2018 Author Share Posted April 20, 2018 17 hours ago, Deltakosh said: You can keep it, just remove the instanciation: var texture = new BABYLON.Texture("texture.png", scene); terrainMaterial.onBindObservable.add(() => { terrainMaterial.getEffect().setTexture('texture', texture ); }; No, it does not work better. I have the number of corresponding textures (that's ok) but setTexture () is run in infinite loop so that I end up with a loading of the terrain with a texturing randomly. I turn at 1 FPS. There is really a problem Dk. It's been at least 8 months that I use onBindObservable in this way that Nasinmi advised me to use and I never had this problem. But since a few weeks, can be (I do not check my projects every day working on other) then, that's not good anymore. All my projects are broken: HeroonEngine, TerrainEditor, and another project that I'm working on too ... I can not fix them. It worked for several months, why not now? I almost want to abandon all my projects that I fail to make them work as before. I lost 100% of users because of this, without realizing it. No other solution that onBindObservable works, it's the only thing I can use it seems. When you advise me, it works well, why now it would be a bad idea. I am convinced that there is a bug somewhere that I can not say where and how, but it has always worked well for more than 6 months or 1 year. Why would it be normal that I have his problems on all my projects. They are all unusable, but they have worked for a long time. Thank you Dk to check, there is really a problem that is huge. See this PG and in the console : http://www.babylonjs-playground.com/#ICIAGK#23 I still have his mistakes in the console? Quote [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: there is no texture bound to the unit 6 /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 7 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 8 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 9 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 10 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 11 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 12 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 13 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. /#ICIAGK#21:1 [.Offscreen-For-WebGL-000001D42CD40130]RENDER WARNING: texture bound to texture unit 14 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 20, 2018 Share Posted April 20, 2018 I have been having other problems as well which is kinda documented at the end of this thread: Quote Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2018 Share Posted April 20, 2018 I'm so sorry guys but the CustomMaterial is not a project I'm supporting. I'm ok to help of course but I have already a lot to do with the framework itself Please ping @NasimiAslfor help The error I'm seeing are not linked to the onBindObservable Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 20, 2018 Author Share Posted April 20, 2018 I think I have more to close all my projects that does not work anymore and where everything depends on CustomMaterial. Unless Nasimi can do something, but I have the impression that it will still take several weeks or months before this is fixed and in the meantime my projects are out of order, I can not do anything and I pass for that who does not care about its users, but hey I think there are more users, so more problem. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 20, 2018 Share Posted April 20, 2018 If I get time this weekend Ill dive in and see what I can find Dad. This has been hindering me as well. Dad72 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 21, 2018 Share Posted April 21, 2018 hi sorry i see that so late problem 1. onBindObservable run in each frame 2. onBindObservable is only way to update texture uniform in CustomMaterial solution 1 make counter for each texture ready and stop update your textures after that called one time solution 2 make new method in standard material for do update texture (specifically) for custom material * that method be exist in old version babylonJS but that is not optimized http://www.babylonjs-playground.com/#ICIAGK#24 ping @Dad72 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 21, 2018 Author Share Posted April 21, 2018 Thank you @NasimiAsl I'm not sure this is a final solution, something should be done in CustomMateriel I think. You can add functions in CustomMateriel as it is extended from StandardMaterial. This currently seems like a half-way fix solution because sometimes a texture is black, but not all and sometimes it works well. Otherwise I have another bug (which exists since the old version): When I create a light after the scene is created, the terrain becomes black. See this PG: Light not work: http://www.babylonjs-playground.com/#ICIAGK#26 Also getEffect (). SetVector2 () seems to no longer work on my projects (it worked before) See this PG: setVector2 not work: http://www.babylonjs-playground.com/#ICIAGK#27 The fog and shadow seems to work. Thank you Nasimi. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 21, 2018 Share Posted April 21, 2018 hi if we cant fix that in standard material we cant fix that in custom material too because we can overwrite any standard material function and all effect management be accessed inside of that i fixed in that step but we have this conversation before and i see a lot changes in standard material and i most check it and find reason so i most check it in weekend fix that again Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 21, 2018 Share Posted April 21, 2018 On 4/20/2018 at 8:31 PM, Deltakosh said: I'm so sorry guys but the CustomMaterial is not a project I'm supporting. I'm ok to help of course but I have already a lot to do with the framework itself Please ping @NasimiAslfor help The error I'm seeing are not linked to the onBindObservable it is time to make interface for classes Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 22, 2018 Author Share Posted April 22, 2018 19 hours ago, NasimiAsl said: so i most check it in weekend fix that again Thank you. CustomMaterial is almost perfect, it missing some retouching to stabilize it: The addition of light and also when we remove a light The setVector2() that does not work anymore uniform texture update (setTexture()) in onBindObservable the errors : RENDER WARNING: there is no texture bound to the unit num x I think CustomMaterial should be flawless then On 20/04/2018 at 6:01 PM, Deltakosh said: The error I'm seeing are not linked to the onBindObservable Do you have an error track that you see to help Nasimi find/fix the error ? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 23, 2018 Share Posted April 23, 2018 Hey d72... if you use a slightly-older version of the framework, will your products work again? That might provide less stress, temporarily, right? Perhaps this subject needs some added think-time. Does anyone have a link to the PR that did the framework change... that started this add-on/extension backward-compat problem? Was the reason for that PR/change... told/detailed, there? If not, can somebody explain the reasons? ( I probably would not understand them, though. ) I understand BJS workload overload... as DK describes. It happened with me with BJS docs. I needed to quit working on docs... so I could learn the framework. I had task overload, and the BJS enjoyment levels were dropping. I hope we can all be kind to each other. Dad72... put me to work on something helpful. Can I do/collect some research that will help? I can make/publish a webpage about this issue... all pertinent links, begging for ideas/work-arounds. I can also, simply, buy the beer for my think-tank friends, if that would help. 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.