Dad72 Posted December 22, 2017 Share Posted December 22, 2017 @NasimiAsl before, I could paint my terrain using CustomMaterial, but now when I paint, it happens strange thing when the dynamic texture is updated. (with texture.update(); line : 151) Bug with CustomMaterial : http://www.babylonjs-playground.com/#FC4IX#96 By using StandardMaterial, it works. I think CustomMaterial has some concern to update the changes after compiling or adding light like the previous bug .. Work with StandardMaterial http://www.babylonjs-playground.com/#1OQFOC#60 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 22, 2017 Share Posted December 22, 2017 http://www.babylonjs-playground.com/#FC4IX#99 is that work? as @Deltakosh say all about timing look line 55 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 22, 2017 Author Share Posted December 22, 2017 I do not know why but on my project TerrainEditor it does not work like that. since onBindObservable with CustomMaterial, I'm having a lot of trouble now, for the cost it was not backward compatible at all. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 22, 2017 Share Posted December 22, 2017 need know more about how effect work on StandardMaterial because all this stuff back to Effect need time for check it from first Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 22, 2017 Author Share Posted December 22, 2017 Yes of course, let me know that you will have news or fixes for it to work. because. I think it actualy will also create problems with shadows and anything else created after loading the scenes. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 22, 2017 Share Posted December 22, 2017 we most look what happend in dynamic textureing too Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 30, 2017 Share Posted December 30, 2017 @Deltakosh hi any method you called after scene setting is changed for update Scene uniforms(like light and shadow ) for standard Material? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 2, 2018 Share Posted January 2, 2018 Hi, Sorry @NasimiAsl but I'm not sure to understand the question. let me try anyway - All materials have a onBindObservable to let you update uniforms manually on the effect - This can also be done on mesh.OnDrawObservable Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 2, 2018 Share Posted January 2, 2018 hi happy new year we have problem in CustomMaterial after we add a new light in scene if i know where you update dependent uniform in Standard material i fix this in custom material too @Deltakosh Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 2, 2018 Share Posted January 2, 2018 Sure Everything related to lights is here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/babylon.materialHelper.ts#L128 and there: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/babylon.materialHelper.ts#L372 It is shared among all core materials Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 16, 2018 Author Share Posted January 16, 2018 @NasimiAsl Do you find a solution for the problem with CustomMaterial for all that is add after the creation of the scene (light, shadows ...) that do not update. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 16, 2018 Share Posted January 16, 2018 hi sorry for that i read source but cant understand it correctly i think i need debug that is real sample to find a correct place to update light and shadow Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 16, 2018 Author Share Posted January 16, 2018 Here, a simple PG that reproduces the problem. I think something like material.update () needs to be rather than recreating the material. http://www.babylonjs-playground.com/#FC4IX#92 The post of the problem is here: http://www.html5gamedevs.com/topic/34711-custommaterial-and-create-light-after-scene-load/ Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 16, 2018 Author Share Posted January 16, 2018 (edited) ... Edited January 17, 2018 by Dad72 PG not work now Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 17, 2018 Author Share Posted January 17, 2018 My previous PG does not work anymore, I do not know why. So I redid a PG or I reduced everything to the bare minimum with only one texture. The bug this product always. As soon as a light is created, either the texture disappears or becomes black, or the first light is no longer taken into account. Maybe @Deltakosh has an idea of what's going on to help you @NasimiAsl if you can not do it. But this seems like a major bug, CustomMaterial should not live with this bug that has been around since version 3.0. http://www.babylonjs-playground.com/#FC4IX#105 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 17, 2018 Share Posted January 17, 2018 Hello, I'm willing to help but I cannot maintain external dependencies unfortunately. If you need me to update things on the core engine to support CustomMaterial I will gladly do it Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 17, 2018 Author Share Posted January 17, 2018 @NasimiAsl An idea of what is missing to solve this bug? I think it's because you have blocked re-compilation when it was compile. so this does not update. in "CustomMaterial.prototype.Builder" I'm sure this bug is not much. A material.update () function to recompile would not solve the problem easily? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 17, 2018 Share Posted January 17, 2018 it is nice idea to make it standard material customizable ( that is good for keep both in current version ) actually standardmaterial is a custommaterial ( in class design system ) but for now we make it wrong we can fix it now but i know that happen again after we change standard material anyway i just want make useful tools but for now wrong dependency damage that tools i can fix this bug but when i was start debug it i look to next what happen if that method change in standard material so for my recommend a one material system is best solution but you notice that is just my personal opinion Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 17, 2018 Author Share Posted January 17, 2018 So do you leave CustomMateriel as it is with this problem? I'm not sure I understand everything you say. Why not add a simple function material.update ()? Should we continue to use CustomMateriel or should it be removed because abandoned ? Currently, there are no materials that can create up to 8 textures, there is an extension that allows 3 textures max, but not 8 as can CustomMateriel. I feel that CustomMateriel is a bad idea to use if it is not maintained now. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 17, 2018 Share Posted January 17, 2018 @NasimiAsl How would you want to change the stdMaterial to improve it? I can add more observables if you want for instance? Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 17, 2018 Author Share Posted January 17, 2018 In fact all the materials use this rebuild(); But not CustomMaterial. Would that not help things? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 17, 2018 Author Share Posted January 17, 2018 21 minutes ago, Deltakosh said: I can add more observables if you want for instance? The problem is that CustomMaterial does not use the StandardMaterial changes, but a version_old (StandardMaterial_OldVer) directly embed in the CustomMaterial file, so any changes made in the parent class, create problems in CustomMaterial. I do not think that the addition of observables is taken into account in CustomMaterial. On the other hand an observable in CustomMaterial to recompile would be useful to solve this problem or redo this class with extend StandardMaterial. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 18, 2018 Share Posted January 18, 2018 @Deltakosh that can possible if we Split Standard material Shader code to some part and append Custom material methods between them but for step 1 standard material most can create different shader for any instance ( if that required ) and we test all bugs for that and the step 2 is much easer than because we just migrate custom material method inside of standard material Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 18, 2018 Share Posted January 18, 2018 after that we don't have custom material any more all is Standard material Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 18, 2018 Share Posted January 18, 2018 @Deltakosh i am fully tamed for do but that is your decision solution 1 : fix custom material bug for now - a short way but not standard way solution 2 : mix standard material and custom material solution 3 : something new ? 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.