SkyMaterial Light

I have some questions about the skymaterial. In the playground below, neither of the two has any lights. The sky model of the skyboxMaterial looks very dark. I learned through the query that the lights may be brought by createDefaultSkybox. Now I want to pass without adding The way the light makes the model in the skyboxMaterial light up like the one in createDefaultSkybox, how can I do it

I didn’t understand this part. If you want to light your scene you have to add lights. At least one. HemisphericLight is a good candidate. For example like this:

Sorry, what I said here is not very clear. What I am wondering is why there is an ambient light effect through createDefaultSkybox. If I want to add such an effect to skymaterial, do I have to add HemisphericLight?

The question is why are the objects lit (not black) when using a default skybox and why are they black when using a skybox material?

Yes you are right, I want to understand the difference between these two methods

Your scene contains meshes with PBRMaterials. (Introduction to Physically Based Rendering | Babylon.js Documentation) These receive light from the environment texture.

You’re creating one in your code:

SkyMaterial doesn’t create an environment texture so it doesn’t light the meshes, this why you need to add another light source, for example the HemisphericLight.

If you add a mesh with StandardMaterial to the PG with the environment texture it will be not lit:

If you change it’s material to PBRMaterial it will start to receieve lights from the environment texture.

Please read the documentation for your own good to master lights, materials and all the stuff around it :wink:



Thank you for your patience and detailed answers, I will read the document carefully to understand

1 Like

You are welcome!