# How to improve lighting/coloring?

**URL:** <https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606>\
**Category:** Questions\
**Tags:** lighting\
**Created:** [April 4, 2023, 9:23am UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606 "2023-04-04T09:23:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 9:23am UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/1 "2023-04-04T09:23:38Z")

</div>

Hello Babylon Forum 🙂

I have been working on my project for a while now and tried rendering my test-scene in Playcanvas as a reference. The results look AMAZING (in my humble opinion) 😃 The results in PlayCanvas look richer in color and sharper. Also, the metallic effects on the chrome parts look better… 😕 I don’t seem to be able to recreate this look in Babylon and would like to know your thoughts on this.

This is my [PG](https://playground.babylonjs.com/#WRBQCP#39).

I am using ACES Tone mapping in both engines and a directional Light in the same angle. I know that there are different environments used, but I can’t imagine that this is the only reason for this immense difference… (they are also similar in their color theme)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/d/9d8f7a34394d24b2c7a3d41644205260275192f9.jpeg)  
PlayCanvas

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/7/a74b43dd884442d7a0a3ea5dc149a4be84636c17.jpeg)  
Babylon

Thank you for any Help you can provide \<3

PS: ChatGPT could not help me this time…

---

<div class="post-metadata">

**Author:** ![Dok11](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dok11/32/25754_2.png) [@Dok11](https://forum.babylonjs.com/u/Dok11)\
**Post date:** [April 4, 2023, 10:06am UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/2 "2023-04-04T10:06:48Z")

</div>

Maybe it has different hdr?

Look at the bg:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/5/7559f3bc314969f590da9bd33067ca237bc19efc.jpeg)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 10:37am UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/3 "2023-04-04T10:37:18Z")

</div>

Yes, I would say about the same. Looks like you have a different env. If I change some of the skybox mat properties and lower the env intensity, I tend to get a similar result.

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 10:57am UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/4 "2023-04-04T10:57:17Z")

</div>

I am using the sky material as skybox in Babylon. I thought this does not have any effect on the lighting/coloring of the scene. But yes, like i said, there are different environments used. I just did not think it would have such a great effect. I am not sure if i can get my hands on the hdr / env used in Play Canvas but i’ll give it a try.

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 11:00am UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/5 "2023-04-04T11:00:16Z")

</div>

> [@mawa](#):
>
> Looks like you have a different env.

Yes, i know, but they are similar in their color theme and i thought it would not have such a great impact.

> [@mawa](#):
>
> If I change some of the skybox mat properties and lower the env intensity, I tend to get a similar result.

Oh, I did not know that you could change those properties via code. I’ll see what i can find and try it out 🙂

Thank you

---

<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:** [April 4, 2023, 11:30am UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/6 "2023-04-04T11:30:38Z")

</div>

Tone mapping is not enabled in your PG, you must set `postprocess.toneMappingEnabled = true;`.

Also, to compare with Playcanvas, in addition to making sure you use the same env texture, you should also make sure you create the same directional light with the same direction / intensity.

Note that you have an error in your PG because `mesh` is undefined (line 47).

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 12:09pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/7 "2023-04-04T12:09:35Z")

</div>

Thank you!

I am pretty sure it has nothing to do with the environment. I disabled both environments and made sure the light is exactly the same (angle/intensity) but there is still a large difference in the color tone (see images). I thought it could have something to do with the Gamma Correction? I am still relatively new to all of this, as you might notice…

[PlayGround](https://playground.babylonjs.com/#WRBQCP#41)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/7/87b70789e88de81a74e21940b135eecc75e25827.jpeg)  
Play Canvas with Gamma Correction=2.2

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/d/3d55edefec9c93341de4d6e3a9ff07e3fef980ed.jpeg)  
Play Canvas with Gamma Correction=1.0 → colors appear not that rich but a bit more pale

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

Firstly: Could it be that the gamma correction causes the richer colors, and if so, can i adjust the gamma correction value for Babylon? I thought that Babylon has a gamma correction value of 2.2 by default?

Secondly: Even with just the Object and one simple light, the Scene looks different (brighter in Play Canvas). It seems to me that the light intensity value of the both engines is not comparable…

I am very grateful for all your support. Could not do it without you 🙂

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 12:19pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/8 "2023-04-04T12:19:53Z")

</div>

> [@Sarrus4x4](#):
>
> made sure the light is exactly the same (angle/intensity)

and what about the distance vs scaling of the scene? I’m not gonna ask about the type of light as I believe it is the same.

Problem is I do not know about Play Canvas so it’s hard for me to answer. But obviously, the lighting conditions are very different (looking at how the ground is ‘exploded’ in the play canvas version with correction gamma 1.0 VS the BJS screenshot). This is something that exposure and contrast cannot modify globally while keeping with the walls nearly black. So I’d say, either it’s a problem with the channelling or values of ‘metallic’ or/and something with the lighting.

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 12:21pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/9 "2023-04-04T12:21:54Z")

</div>

> [@Sarrus4x4](#):
>
> I am still relatively new to all of this, as you might notice

No way we can notice that in this topic. The handling of colors, lights and materials across apps (and even within a single app) is already an expert subject. And experts themselves aren’t always quite sure which one influences or handles the other 😁

---

<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:** [April 4, 2023, 12:31pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/10 "2023-04-04T12:31:11Z")

</div>

You should also try to display your model in another glTF viewer (like [https://gltf-viewer.donmccurdy.com/](https://gltf-viewer.donmccurdy.com/)).

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 12:31pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/11 "2023-04-04T12:31:41Z")

</div>

Position and Scaling of the (directional) lights is also the same 😃

Is there a way to change the gamma correction for the whole Scene in Babylon?

> [@mawa](#):
>
> problem with the channelling

Could you please explain what you mean by that?

Thank you for your time!

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 12:38pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/12 "2023-04-04T12:38:13Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/2/c239cdbea779a167afd768c3db1131e230ed1a45.jpeg)  
PlayCanvas Gamma = 2.2

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

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/5/a5f6c3f689041c80cfae594e74c1e94c123dcb49.jpeg)  
glTF Viewer

In the viewer i tried to use simmilar settings. It looks closer to PlayCanvas I’d say…  
Again the wood texture is more colorful

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 12:42pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/13 "2023-04-04T12:42:46Z")

</div>

First and foremost, you should listen to evgeni’s advise. He’s the true expert 😜

Next, check out my screnshot, with my twisted directional light.  
Doesn’t it look pretty similar to your 1.0 gamma Play Canvas version?

Here I pushed the direction to \*100 essentially, so the ground is now ‘exploded’ as in your play canvas screenshot and the walls nearly black.

 ![Capture d’écran 2023-04-04 à 14.36.06](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/1/817f46ed9a92a1b4a2ea8359946c3eaa576fc188.jpeg)

Note that the gamma correction on the entire scene will make the black point whiter (greyish) or the white point less white (greyish) ALTOGETHER. So this alone cannot explain why the walls would be nearly black while the ground texture is ‘exploded’/overexposed)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 12:46pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/14 "2023-04-04T12:46:55Z")

</div>

Can you take both (gltf viewer and bjs) screenshots from (roughly) the same angle, distance and position?

Edit: Look at your latest screenshots. In the BJS version the wall to the right is nearly black as opposed to gltf-viewer version. It could be a clue to a difference in the light position/direction/intensity but without shots from the same view it’s hard to tell.

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 12:54pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/15 "2023-04-04T12:54:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/4/34de6e516c5e6beb9ca1df4d2d13c3fff61f59b4.jpeg)  
BJS

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/a/cacc388ee2ff58a5915b145fcaa88d4231482682.jpeg)  
glTF Viewer

Is this good enough? It realy looks like the lighting i totally different… I cant explain myself why.

EDIT: [Here](https://playground.babylonjs.com/#WRBQCP#42) is the newsest version of the PG where the light is simply added by giving it a direction.

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 12:57pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/16 "2023-04-04T12:57:54Z")

</div>

Sure is. What I can notice instantly in these 2 screenshots is that the wall to the left is darker in the bjs version than the one in the gltf-viewer. Whereas, interesting enough, the right wall is darker (nearly black) in bjs but is lighter than the left wall in the gltf-viewer.  
Also, the backwall, in gltf-viewer is darker than the side-walls where in BJS, it’s the other way round…

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 12:58pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/17 "2023-04-04T12:58:19Z")

</div>

right-handed vs left-handed, may be? @Evgeni_Popov

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 1:16pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/18 "2023-04-04T13:16:38Z")

</div>

Do you think that the reason for this behavior also causes the pale color of the wood texture?

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [April 4, 2023, 1:19pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/19 "2023-04-04T13:19:46Z")

</div>

Are you sure you are using a directional light in play canvas?  
I think for once you have an issue with scaling. May be also with left-handed vs right-handed and if I displace a directional light slightly from the center, I will always have one wall not lit correctly! The more I think of it, the more I believe we are just cumulating issues/discrepancies here.  
In the below SS, I revamped the values of the directional light (/10) and inverted the z-axis.  
I now have a backwall darker then the left wall side, but I cannot have the right wall correctly??!!

 ![Capture d’écran 2023-04-04 à 15.13.45](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/f/efcc35198e99ca294cceb42921d57b2dd2c7c664.jpeg)

---

<div class="post-metadata">

**Author:** ![Sarrus4x4](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sarrus4x4/32/30205_2.png) [@Sarrus4x4](https://forum.babylonjs.com/u/Sarrus4x4)\
**Post date:** [April 4, 2023, 1:25pm UTC](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606/20 "2023-04-04T13:25:52Z")

</div>

> [@mawa](#):
>
> Are you sure you are using a directional light in play canvas?

Yes I am 😃  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/a/aab772c61702a9483fa7d3a54e006bb72bbe6ff0.png)

[Next page](https://forum.babylonjs.com/t/how-to-improve-lighting-coloring/39606.md?page=2)
