Hi, I’m trying to make a supernova effect by creating a mesh sphere then modifying it with a displacement map but I can’t get the sphere to change shape. Any advice as to what I am doing wrong would be appreciated! Here’s the code I am using. What I get is two perfect translucent spheres stacked on the same point, but no displacement.
var star = new BABYLON.MeshBuilder.CreateSphere(i, {diameter: 45, sideOrientation: BABYLON.Mesh.DOUBLESIDE}, scene, true);
star.applyDisplacementMap(star_displace1.jpg, {minheight: 1, maxheight: 250, forceUpdate: true});
var texture = new BABYLON.StandardMaterial('texture', scene);
texture.emissiveTexture = new BABYLON.Texture(star_supernova_ii_shell.png, scene);
star.material = texture;
// x, y, and z are spacial coordinates established in flow of program
star.position = new BABYLON.Vector3(x, y, z);
texture.backFaceCulling = false;
star.material.alpha = 0.5;
// second star inside first to created layer affect
var star2 = new BABYLON.MeshBuilder.CreateSphere(i, {diameter: 25, sideOrientation: BABYLON.Mesh.DOUBLESIDE}, scene, true);
star2.applyDisplacementMap(star_displace2.jpg, {minheight: 1, maxheight: 250, forceUpdate: true});
var texture2 = new BABYLON.StandardMaterial('texture', scene);
texture2.emissiveTexture = new BABYLON.Texture(star_array[i].second_url, scene);
star2.material = texture2;
// this x-y-z is the same as above in order to stack the graphics
star2.position = new BABYLON.Vector3(x, y, z);
star2.material.alpha = 0.5;