asperger Posted August 19, 2018 Share Posted August 19, 2018 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? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 19, 2018 Share Posted August 19, 2018 This would be interesting indeed. I will add tomorrow an unlit mode to the material. Quote Link to comment Share on other sites More sharing options...
asperger Posted August 19, 2018 Author Share Posted August 19, 2018 That would indeed be cool. Thanks. At first I tried to add a PointLight but that didnt make it. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 19, 2018 Share Posted August 19, 2018 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! :) Quote Link to comment Share on other sites More sharing options...
asperger Posted August 19, 2018 Author Share Posted August 19, 2018 The fire material actually works. I tested it. The lava material however isnt really working in respect to that matter. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 20, 2018 Share Posted August 20, 2018 Done and deployed: https://www.babylonjs-playground.com/#1BLVWO#22 asperger 1 Quote Link to comment Share on other sites More sharing options...
asperger Posted August 20, 2018 Author Share Posted August 20, 2018 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. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 20, 2018 Share Posted August 20, 2018 you might need to add more subdivision or you will have less vertex moving. asperger 1 Quote Link to comment Share on other sites More sharing options...
asperger Posted August 20, 2018 Author Share Posted August 20, 2018 Yep. You are right. 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.