# How to delete a reflectionTexture from an imported material

**URL:** <https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305>\
**Category:** Questions\
**Created:** [August 11, 2020, 6:36pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305 "2020-08-11T18:36:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [August 11, 2020, 6:36pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/1 "2020-08-11T18:36:56Z")

</div>

Hi,

I made two materials for a ball in Blender (just two color materials). I want to delete a reflectionTexture. I have one mesh. It means that the zero element in meshes must be a ball. I tried to find material array but autocomplete says that the ball has only one material. I try to print this material but I see null.

[Playground](https://plnkr.co/edit/93X85tTmLBgEYd0D?preview)

Code:

```auto
        BABYLON.SceneLoader.Append("models/", "Ball.glb", scene,
            (loadedScene) =>
            {
                scene.createDefaultEnvironment();

                console.log(loadedScene);

                const material = loadedScene.meshes[0].material;
                console.log(material);
            });

```

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 11, 2020, 6:40pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/2 "2020-08-11T18:40:37Z")

</div>

`scene.createDefaultEnvironment();` actually creates the environment reflection texture.

You should be able to do `scene.environmentTexture = null` to remove it.

---

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [August 11, 2020, 6:57pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/3 "2020-08-11T18:57:45Z")

</div>

> [@Evgeni\_Popov](#):
>
> scene.environmentTexture = null

I added it:

```typescript
        BABYLON.SceneLoader.Append("models/", "Ball.glb", scene,
            (loadedScene) =>
            {
                scene.createDefaultEnvironment();

                scene.environmentTexture = null;
            });

```

And the ball is black:

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/7/77fdc1cd5ba4b6ea676b3e4e6da58ec0b41bce29.png)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 11, 2020, 7:39pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/4 "2020-08-11T19:39:38Z")

</div>

This is expected as the PBR materials use the env texture as source of lightning 😉

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 11, 2020, 8:10pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/5 "2020-08-11T20:10:09Z")

</div>

Just add static lights like hemispherical / point / directional or spot lights.

---

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [August 11, 2020, 8:15pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/6 "2020-08-11T20:15:24Z")

</div>

If you [open my code example](https://plnkr.co/edit/93X85tTmLBgEYd0D?preview) you will see that I use the DirectionalLight. But it does not work with the HemisphericLight light too.

How to export without PBR? I export one selected object. I just want to export a simple diffuse color material from Blender.

How to solve the problem? Full code of my example:

```auto
import * as BABYLON from "babylonjs";
import "babylonjs-loaders";

export default class Game
{
    public constructor(canvasName: string)
    {
        const canvas = document.getElementById(canvasName) as HTMLCanvasElement;
        const engine = new BABYLON.Engine(canvas, true);
        const scene = new BABYLON.Scene(engine);
        const camera = new BABYLON.ArcRotateCamera("camera", 0, 0, 3, BABYLON.Vector3.Zero(), scene);
        camera.attachControl(canvas, true);
        // const light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
        const light = new BABYLON.DirectionalLight("dirLight", new BABYLON.Vector3(0, 1, 0), scene);

        BABYLON.SceneLoader.Append("models/", "Ball.glb", scene,
            (loadedScene) =>
            {
                scene.createDefaultEnvironment();
                console.log(loadedScene);
                const material = loadedScene.meshes[0].material;
                console.log(material);
                //scene.environmentTexture = null;
            });

        engine.runRenderLoop(() => scene.render());
        window.onresize = () => engine.resize();
    }
}

```

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 11, 2020, 8:33pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/7 "2020-08-11T20:33:46Z")

</div>

maybe you can simply keep the PBR material but set metallic property to 0 to remove shininess?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 11, 2020, 8:41pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/8 "2020-08-11T20:41:05Z")

</div>

Your directional light does not work as expected because it has not a right direction: try -1 for the y axis instead of 1. You could also raise its intensity (light.intensity = 20 for eg).

I think the Blender exporter exports a PBR material because you use in Blender such a material (I think it is called “principled material” in Blender).

---

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [August 11, 2020, 8:54pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/9 "2020-08-11T20:54:09Z")

</div>

> [@Evgeni\_Popov](#):
>
> try -1 for the y axis instead of 1

Yes, this code works now:

```typescript
        const light = new BABYLON.DirectionalLight("dirLight", new BABYLON.Vector3(0, -1, 0), scene);

        BABYLON.SceneLoader.Append("models/", "Ball.glb", scene,
            (loadedScene) =>
            {
                scene.createDefaultEnvironment();

                scene.environmentTexture = null;
            });

```

But it looks strange with dark bar:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/6/6a2d9ff01c4b081b1bf47af638a921f4e8f4456a.png)

---

<div class="post-metadata">

**Author:** ![LeJohn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lejohn/32/35093_2.png) [@LeJohn](https://forum.babylonjs.com/u/LeJohn)\
**Post date:** [August 11, 2020, 8:59pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/10 "2020-08-11T20:59:25Z")

</div>

Hi,

Here is a little warning about your way of getting the material : you are loading a glb file, in this case, babylon wrap your ball in a “\__root_\_” mesh. So, your materials are not available on _loadedScene.meshes[0]_ but from _loadedScene.meshes[1]_ and _loadedScene.meshes[2]_.  
By the way, you’d better use [https://doc.babylonjs.com/api/classes/babylon.scene#getmeshbyname](https://doc.babylonjs.com/api/classes/babylon.scene#getmeshbyname) to pick your mesh instead of using the index.

more info about the \__root_\_ wrapper : [Blender to glTF - Babylon.js Documentation](https://doc.babylonjs.com/resources/blender_to_gltf)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 11, 2020, 9:00pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/11 "2020-08-11T21:00:13Z")

</div>

here is a version that works:

> **[Plunker - Import a ball to Babylon.js](https://plnkr.co/edit/F1IcORScUBGqQiNx)**
>
> Created on https://plnkr.co: Helping you build the web.

No need to add additional ligths. Just metallic to 0 and roughness to 1

---

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [August 11, 2020, 9:01pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/12 "2020-08-11T21:01:06Z")

</div>

> [@Deltakosh](#):
>
> maybe you can simply keep the PBR material but set metallic property to 0 to remove shininess?

Do you mean to delete it in Blender? I use Blender 2.76 (because of performance of my laptop) in the “Blender Render” mode and I do not see “Metallic” and “Shininess” properties. Or do you mean to delete them in Babylon.js? But I cannot find where are materials as I described in the first message of my topic.

---

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://forum.babylonjs.com/u/8Observer8)\
**Post date:** [August 11, 2020, 9:03pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/13 "2020-08-11T21:03:38Z")

</div>

> [@Deltakosh](#):
>
> here is a version that works:

Good! Thank you! Now I see where materials are. But why do I see a gradient at the background color of the scene behind the ball when I rotate the camera?

---

<div class="post-metadata">

**Author:** ![LeJohn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lejohn/32/35093_2.png) [@LeJohn](https://forum.babylonjs.com/u/LeJohn)\
**Post date:** [August 11, 2020, 9:08pm UTC](https://forum.babylonjs.com/t/how-to-delete-a-reflectiontexture-from-an-imported-material/13305/14 "2020-08-11T21:08:05Z")

</div>

It’s the default environment skybox:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/3/3e9602208618a18a364675525e0cea59d8f25ab6.jpeg)
