Biz Posted December 20, 2016 Share Posted December 20, 2016 Hello, I am trying to figure out how to make part of my ground transparent. I create the ground from a height map and then apply a bitmap texture to it. var seisMaterial = new BABYLON.StandardMaterial("seismic", scene); seisMaterial.diffuseTexture = new BABYLON.Texture(urlColor, scene); seisMaterial.diffuseTexture.hasAlpha = true; seisMaterial.backFaceCulling = false; var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", fauxFile, 106, 121, 100, 0, 10, scene, false); //seisMaterial.emissiveColor = BABYLON.Color3.Blue(); //seisMaterial.wireframe = true; ground.material = seisMaterial; getting the image below. I want the white area around the black blob to be transparent. The bitmap I used to create the texture has the alpha component set to 0. Is there a setting I am missing? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 20, 2016 Share Posted December 20, 2016 use a png 24 and just do the alpha how you want it on the png. Try this img: Nabroski 1 Quote Link to comment Share on other sites More sharing options...
Biz Posted December 20, 2016 Author Share Posted December 20, 2016 Thanks for the quick reply. Much better. Another question if you dont mind. Is there a way to eliminate the edge you see around the ground without making the ground flat? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 20, 2016 Share Posted December 20, 2016 do a distance calculation on how close it is to the edge and use that as a scalar, or put a smooth transition on your heightmap with a gradient. Quote Link to comment Share on other sites More sharing options...
Biz Posted December 20, 2016 Author Share Posted December 20, 2016 cool. thanks again. 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.