# NME material reflections

**URL:** <https://forum.babylonjs.com/t/nme-material-reflections/54521>\
**Category:** Questions\
**Created:** [November 3, 2024, 12:16pm UTC](https://forum.babylonjs.com/t/nme-material-reflections/54521 "2024-11-03T12:16:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![acero](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/acero/32/32831_2.png) [@acero](https://forum.babylonjs.com/u/acero)\
**Post date:** [November 3, 2024, 12:16pm UTC](https://forum.babylonjs.com/t/nme-material-reflections/54521/1 "2024-11-03T12:16:46Z")

</div>

Hi all,

I am using NME material on t-shirt model, it does not reflect any light, how can i fix that?  
DisableLighting property is false, so it is something else, here is link to my nme material (I removed some textures because of size):

> **[Babylon.js Node Material Editor](https://nodematerial-editor.babylonjs.com/#1UL800)**
>
> Babylon.js Node material editor - shader-based materials editor for Babylon.js

Thnx

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [November 4, 2024, 9:26am UTC](https://forum.babylonjs.com/t/nme-material-reflections/54521/3 "2024-11-04T09:26:55Z")

</div>

Summoning @PatrickRyan !  
Do you have an example or an idea of what you want to achieve?

---

<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:** [November 4, 2024, 9:30am UTC](https://forum.babylonjs.com/t/nme-material-reflections/54521/4 "2024-11-04T09:30:10Z")

</div>

Note that you only display the `diffuseDir` component. You should probably use the `lighting` output instead.

---

<div class="post-metadata">

**Author:** ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)\
**Post date:** [November 4, 2024, 6:30pm UTC](https://forum.babylonjs.com/t/nme-material-reflections/54521/5 "2024-11-04T18:30:55Z")

</div>

@acero, I will back up with @Evgeni_Popov said about using the `lighting` output from the `PBRMetallicRoughness` block. This is the easiest way to wire to the `FragmentOut` since it has combined all contributions for diffuse and specular components and has been converted to gamma space which the `FragmentOut` expects by default. However, if you want to do anything to the contributions individually before combining them, you will want to add the direct and indirect components of both diffuse and specular before adding them together for the final contribution. Note that the color space of each component output is in linear space so that you can do mathmatical operations on them immediately from the output so you will need to convert to gamma space as a final step. This can easily be done by using the `convert to gamma` property on the `FragmentOut` block.

Using this method will allow you to do whatever operation you like on each component like add a glow for example. In your attached shader above, since you are only using the diffuse direct component, you won’t see any lighting on your material if you don’t have direct lights in your scene like a point light or a directional light. If you only have indirect sources like an environment IBL, those come from the indirect components.

If you want the simplest output from the PBR nodes, definitely use the `lighting` output but know that @Evgeni_Popov gave us complete control over each component coming out of the `PBRMetallicRoughness` block so that we have flexibility in adding effects to the output. Just remember that the color space will need to be managed if using the individual components.

---

<div class="post-metadata">

**Author:** ![acero](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/acero/32/32831_2.png) [@acero](https://forum.babylonjs.com/u/acero)\
**Post date:** [November 5, 2024, 7:04am UTC](https://forum.babylonjs.com/t/nme-material-reflections/54521/6 "2024-11-05T07:04:20Z")

</div>

Yes, that was it, thnx 🙂

---

<div class="post-metadata">

**Author:** ![acero](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/acero/32/32831_2.png) [@acero](https://forum.babylonjs.com/u/acero)\
**Post date:** [November 5, 2024, 7:09am UTC](https://forum.babylonjs.com/t/nme-material-reflections/54521/7 "2024-11-05T07:09:38Z")

</div>

Thank you @PatrickRyan for clarifications, for now I will go `lighting` route. 🙂
