# Get the incoming light intensity in fragment shader

**URL:** https://forum.babylonjs.com/t/get-the-incoming-light-intensity-in-fragment-shader/26446
**Category:** Questions
**Tags:** lighting, shader
**Created:** [January 4, 2022, 6:17am UTC](https://forum.babylonjs.com/t/get-the-incoming-light-intensity-in-fragment-shader/26446 "2022-01-04T06:17:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![udemegane](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/udemegane/32/20928_2.png) [@udemegane](https://forum.babylonjs.com/u/udemegane)
#### Post date: [January 4, 2022, 6:17am UTC](https://forum.babylonjs.com/t/get-the-incoming-light-intensity-in-fragment-shader/26446/1 "2022-01-04T06:17:17Z")

</div>

Hello!  
As the title says, I want to get the incoming light intensity and color per pixel for my custom post process.  
I understand from the forum below that I can get diffuse and specular, but don’t know how to do the subject. How can I do this?  
Thanks!

> [@Global Light Info in Custom Shader, similar to the Lights Node](https://forum.babylonjs.com/t/global-light-info-in-custom-shader-similar-to-the-lights-node/10109):
>
> What would be the best way to get all the lights in the scenes contributions in a custom shader? I have sneaking suspicion its a couple steps.

---

<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: [January 4, 2022, 4:22pm UTC](https://forum.babylonjs.com/t/get-the-incoming-light-intensity-in-fragment-shader/26446/2 "2022-01-04T16:22:17Z")

</div>

Incoming light is basically passing the lights uniforms or ubo containing all the setup info. You d need to bind all of them to your custom shader.

---

<div class="post-metadata">

### Author: ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)
#### Post date: [February 3, 2022, 11:31am UTC](https://forum.babylonjs.com/t/get-the-incoming-light-intensity-in-fragment-shader/26446/3 "2022-02-03T11:31:39Z")

</div>

Hi @udemegane welcome to the Babylon community! Just checking in if your question was answered or if you have any more questions 😃
