Jump to content

Making lava texture self lit?


asperger
 Share

Recommended Posts

I got the following setup for my mesh:

var box = BABYLON.MeshBuilder.CreateBox("box", {height: 5, width: 2, depth: 0.5}, scene);
var lavaMaterial = new BABYLON.LavaMaterial("lava", scene); 
lavaMaterial.noiseTexture = new BABYLON.Texture("img/noise.jpg", scene);
lavaMaterial.diffuseTexture = new BABYLON.Texture("img/diffuse.jpg", scene);
lavaMaterial.speed = 1;
box.material = lavaMaterial;

Now the problem im having is that I dont want any external shadows, lights or hemispheral lights to affect my mesh.
Instead I want my mesh to show the material even if I dont have any lights on my scene.

Is this possible? If so then how?

Link to comment
Share on other sites

Welcome to the forum, asperger.  Nice feature idea, thx!  Thanks to Sebavan, too, for the mod consids/try.  I love animated materials.

Is there still a fire material in BJS?  Perhaps that needs the same mod?  *shrug*  Do we have animated clouds?  That, too?

I must say, I have not been a good animated materials fan-club member.  I should have all the animated materials well-memorized, but I don't.  Embarrassing on my part!   :) 

Link to comment
Share on other sites

Hey Sebavan, that is really cool and was really missing! I just encountered something by the way.
I dont know if it is a bug or a limitation but if you increase the size of the mesh the lava vertex distortion effect becomes less visible (less waves). The bigger the less of an effect the lava material has. Do you think thats normal? I think one of the variables that affect the distortion amount in the vertex shader is a constant or something.

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...