Change dome texture

Hi , i am traying to change the texture of a dome but it is not working , any help ?

dome = new BABYLON.PhotoDome(“testdome”,img1.jpg ,{resolution: 512,size: 1000},scene);
var mat = new BABYLON.StandardMaterial(“mat”, scene);
var texture = new BABYLON.Texture(“img2.jpg”, scene);
mat.diffuseTexture = texture;
dome.material = mat;

Thanks

Can you repro in the playground?

yes , thanks ! Babylon.js Playground

https://playground.babylonjs.com/#28MX9F#1

sorry i dont see difference ?

no answer ? please it is important ! Thanks

https://playground.babylonjs.com/#28MX9F#2

As @Devin_Wright highlights there is no material on the photoDome but only a photoTexture property you can swap on demand:

dome.photoTexture = new BABYLON.Texture(actual, scene, false, false);

https://playground.babylonjs.com/#28MX9F#4

1 Like