Jump to content

Make Your Wanted Shader In StandardMaterial [ coming soon ]


NasimiAsl
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
       

 

 

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...