public static void uniqueMaterialWithClickableEmission(MeshInstance mesh, out SpatialMaterial material) { // copy the material to be able to set different seedssss material = (SpatialMaterial)mesh.GetSurfaceMaterial(0).Duplicate(true); MaterialUtils.setClickableEmission(material); mesh.SetSurfaceMaterial(0, material); }
private void uniqueMaterial() { var mesh = (MeshInstance)GetNode("DepotMesh"); // copy the material to be able to set different seeds material = (SpatialMaterial)mesh.GetSurfaceMaterial(0).Duplicate(true); MaterialUtils.setClickableEmission(material); mesh.SetSurfaceMaterial(0, material); }
private void randomizeGround() { var mesh = (MeshInstance)this.GetNode("TileMesh"); // copy the material to be able to set different seeds material = (SpatialMaterial)mesh.GetSurfaceMaterial(0).Duplicate(true); var noise = (OpenSimplexNoise)((NoiseTexture)material.RoughnessTexture).Noise; noise.Seed = rnd.Next(); material = MaterialUtils.setClickableEmission(material); mesh.SetSurfaceMaterial(0, material); }