Black patches on sclaing a 3D image

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.

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 :slight_smile:

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. You can use textures directly available or your own textures in the playground

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.

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

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 :slight_smile:

Even a fixed playground does not help much :frowning: https://www.babylonjs-playground.com/index.html#1NURBM#1

Could you change the texture path ?

Hi @sebavan,

Thanks for fixing the playground :slight_smile:

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 :slight_smile:

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

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

I would suggest to use unlit in this situation:

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

https://www.babylonjs-playground.com/index.html#1NURBM#5

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 :slight_smile:

1 Like

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

Yeah… I thought that was intentional :smiley:

Updated at my end.

Thanks