# Black patches on sclaing a 3D image

**URL:** <https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600>\
**Category:** Questions\
**Created:** [May 30, 2019, 9:00am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600 "2019-05-30T09:00:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keshav\_Bisarwal](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/keshav_bisarwal/32/2642_2.png) [@Keshav\_Bisarwal](https://forum.babylonjs.com/u/Keshav_Bisarwal)\
**Post date:** [May 30, 2019, 9:00am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/1 "2019-05-30T09:00:34Z")

</div>

Hi,

I am using BabylonJs to render 3D view of a field. The 3D is ok if the elevation is not too much but if the field is on mountain, i am seeing black surface on sclaing the 3D image.

 ![3D_blackPatches](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/2/29edc7f10aa29359b8fe9a5b8d69c60c593f6b23.png)

I have attached an image to help you visualize the issue better.

Please let me know if more information is required on this.

Thanks a lot in adcance 🙂

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [May 30, 2019, 9:12am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/2 "2019-05-30T09:12:48Z")

</div>

Hi and welcome @Keshav_Bisarwal and I would need a lot more information

1. What mesh are you using?
2. How is the elevation achieved?

Best way to show us the issue is to create a [playground](https://doc.babylonjs.com/babylon101/first#the-playground). You can use [textures directly available](https://doc.babylonjs.com/resources/Playground_Textures) or [your own textures](https://doc.babylonjs.com/resources/External_PG_assets) in the [playground](https://www.babylonjs-playground.com/#)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 30, 2019, 9:38am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/3 "2019-05-30T09:38:27Z")

</div>

Welcome to the forum !!!

It looks like either a texture setup issue or a shader issue to me. What material are you using ?

As @JohnK said as well a playground would be great.

---

<div class="post-metadata">

**Author:** ![Keshav\_Bisarwal](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/keshav_bisarwal/32/2642_2.png) [@Keshav\_Bisarwal](https://forum.babylonjs.com/u/Keshav_Bisarwal)\
**Post date:** [May 31, 2019, 7:22am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/4 "2019-05-31T07:22:16Z")

</div>

Hi @JohnK / @sebavan,

Thanks for your quick response.

i have created a playground example but i am getting an error about eventListener.

[https://www.babylonjs-playground.com/index.html#1NURBM](https://www.babylonjs-playground.com/index.html#1NURBM)

But i guess you should have all the required info from the above playground.

Also, i am using babylonJs version 3.3.0

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 31, 2019, 9:34am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/5 "2019-05-31T09:34:18Z")

</div>

Even a fixed playground does not help much ☹ [https://www.babylonjs-playground.com/index.html#1NURBM#1](https://www.babylonjs-playground.com/index.html#1NURBM#1)

Could you change the texture path ?

---

<div class="post-metadata">

**Author:** ![Keshav\_Bisarwal](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/keshav_bisarwal/32/2642_2.png) [@Keshav\_Bisarwal](https://forum.babylonjs.com/u/Keshav_Bisarwal)\
**Post date:** [June 1, 2019, 5:12am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/6 "2019-06-01T05:12:18Z")

</div>

Hi @sebavan,

Thanks for fixing the playground 🙂

[https://www.babylonjs-playground.com/index.html#1NURBM#3](https://www.babylonjs-playground.com/index.html#1NURBM#3)

I have changed the texture image path and it works now.  
I have also scaled the ground and it works now. // this.ground.scaling.y = 10;

Please have a look 🙂

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [June 1, 2019, 10:04am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/7 "2019-06-01T10:04:08Z")

</div>

Cannot give you a definitive answer about the workings of a spot light as to why but maybe sebvan can. It is certainly something to do with the spot light and the values you use. I have added a light and you should know that a color3 takes vales from 0 to 1, not 0 to 255 [Color3 - Babylon.js Documentation](https://doc.babylonjs.com/api/classes/babylon.color3#constructor)

Suggest you play around with the spot light position and diffuse and specular values [https://www.babylonjs-playground.com/index.html#1NURBM#4](https://www.babylonjs-playground.com/index.html#1NURBM#4)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 1, 2019, 11:11am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/8 "2019-06-01T11:11:45Z")

</div>

I would suggest to use unlit in this situation:

```auto
groundMaterial.emissiveColor = BABYLON.Color3.White();
groundMaterial.diffuseTexture.disableLighting =-true;

```

[https://www.babylonjs-playground.com/index.html#1NURBM#5](https://www.babylonjs-playground.com/index.html#1NURBM#5)

---

<div class="post-metadata">

**Author:** ![Keshav\_Bisarwal](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/keshav_bisarwal/32/2642_2.png) [@Keshav\_Bisarwal](https://forum.babylonjs.com/u/Keshav_Bisarwal)\
**Post date:** [June 3, 2019, 6:01am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/9 "2019-06-03T06:01:57Z")

</div>

Hi @sebavan / @JohnK,

Thanks a lot guys for your suggestions.

groundMaterial.emissiveColor = BABYLON.Color3.White();  
groundMaterial.diffuseTexture.disableLighting =-true;

The above code works perfectly for me. I am in process of testing to see that it doesn’t impact elsewhere.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 3, 2019, 7:23am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/10 "2019-06-03T07:23:23Z")

</div>

should be true and not -true (guess I put a typo there :-))

---

<div class="post-metadata">

**Author:** ![Keshav\_Bisarwal](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/keshav_bisarwal/32/2642_2.png) [@Keshav\_Bisarwal](https://forum.babylonjs.com/u/Keshav_Bisarwal)\
**Post date:** [June 3, 2019, 8:19am UTC](https://forum.babylonjs.com/t/black-patches-on-sclaing-a-3d-image/3600/11 "2019-06-03T08:19:54Z")

</div>

Yeah… I thought that was intentional 😃

Updated at my end.

Thanks
