Dad72 Posted May 16, 2017 Share Posted May 16, 2017 PBR material also, it would be great. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 16, 2017 Share Posted May 16, 2017 Actually, I was thinking a lot about changing ShaderBuilder to add functionality for generating in Javascript for the functionality of BuildMaterial(), maybe toScript(). This way you would not need to deploy ShaderBuilder itself. It would be not only save 78 kb, but be cleaner due to being self contained. Interested in me updating the repo? BTW, I published my first scene using it, thanks. NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 21, 2017 Author Share Posted May 21, 2017 http://www.babylonjs-playground.com/#FC4IX#61 @Dad72 that is finished but Have UV Problem I am on That too Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 21, 2017 Share Posted May 21, 2017 This is a very good start. What is Shader.Join ? Is ca must always remain like this ? This part Shader.Join seems complicate I try to add the fog and it seems to work well. http://www.babylonjs-playground.com/#FC4IX#66 It remains that this problem UV indeed. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 21, 2017 Author Share Posted May 21, 2017 join just simple string join i try to do it in customMAterial but about UV i need enable DeffiuseTexture test // blanck texture sMat.diffuseTexture = new BABYLON.Texture("http://i.imgur.com/o5iHzN8.png",scene); http://www.babylonjs-playground.com/#FC4IX#68 http://www.babylonjs-playground.com/#FC4IX#69 Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 23, 2017 Share Posted May 23, 2017 Hi, @NasimiAsl I no longer able to use SetTexture() and setVector2(). Is there a replacement function or is this a bug? http://www.babylonjs-playground.com/#FC4IX#77 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 23, 2017 Author Share Posted May 23, 2017 CustomMaterial is not a ShaderMaterial so that have not SetUniform you can find this function after mat.getEffect() is ready you can use AddUniform sMat.AddUniform('dyTexture', 'sampler2D', new BABYLON.Texture('http://www.babylon.actifgames.com/TerrainEditor/data/Delos.png',scene)); sMat.AddUniform('scaleTxt1', 'vec2', {x: 2.0, y: 2.0}); http://www.babylonjs-playground.com/#FC4IX#78 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 23, 2017 Share Posted May 23, 2017 So AddUniform update the old values ? For example for my editor field, I would like updated value if it changes. Thanks Nasimi Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 23, 2017 Share Posted May 23, 2017 Ok, I understand, do as this: terrain.material.getEffect().setTexture('texture1', new BABYLON.Texture(data.textures, scene)); terrain.material.getEffect().setVector2('scaleTxt1', {x: 10.0, y: 10.0)}); NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 12, 2017 Share Posted June 12, 2017 @NasimiAsl, Apparently material.getEffect().setVector2 and material.getEffect().setTexture longer works. material.getEffect() also. Something has to change or this is a bug Babylon? http://www.babylonjs-playground.com/#FC4IX#82 I think it's a bug because a standarMarerial also: http://www.babylonjs-playground.com/#I0NPUS#1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 12, 2017 Author Share Posted June 12, 2017 you most check material.getEffect And material.getEffect() like this sample http://www.babylonjs-playground.com/#FC4IX#84 but if you use AddUniform( name, type , texture ) that check it automatic Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 12, 2017 Share Posted June 12, 2017 Ok, So with setTimeOut the problem is solves. I did not need to do this before. I suppose that there is a problem somewhere. setTimeout(function() { console.log(terrain.material.getEffect()); }, 1000); Thanks Nasimi 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.