Hello,
I want to get the color of all the lights in the scene. The Light Color node only get the color of first light in the scene.
How I get this?
Thanks
Color of all lights
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: Color of all lights
Hey there,mossman wrote:Hello,
I want to get the color of all the lights in the scene. The Light Color node only get the color of first light in the scene.
How I get this?
Thanks
Can you elaborate on your specific use case, or perhaps share a sample shader? The Light Color node should be picking up more than just the first light.
Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Color of all lights
Hello Ricardo,
Thanks for your reply.
I investigated the node and I prepared a simple scene with a shader. (I attached the package)
The shader is a Surface shader with a Custom lightning model. With the Light color node and the Light attenuation node I get the color of all lights as you explained. but the result in the example is very ugly. How I smooth the colors in the surface of the mesh?
And I want to apply the colors of different lights with the attenuation value in a emission input of a Surface shader and in a Frag color input of a Unlit shader.
Thanks
Thanks for your reply.
I investigated the node and I prepared a simple scene with a shader. (I attached the package)
The shader is a Surface shader with a Custom lightning model. With the Light color node and the Light attenuation node I get the color of all lights as you explained. but the result in the example is very ugly. How I smooth the colors in the surface of the mesh?
And I want to apply the colors of different lights with the attenuation value in a emission input of a Surface shader and in a Frag color input of a Unlit shader.
Thanks
- Attachments
-
- multiplelights1.unitypackage
- (9.82 KiB) Downloaded 297 times
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Color of all lights
Hello, you'll need to provide the shader with the necessary data in order for it to be able to perform the lighting calculations that you require, which will depend on the effect you want to create and the type of light sources in your scene and might involve specific Light nodes.
Please refer to the simple example below:

Please refer to the simple example below:

Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Color of all lights
Hello,
Your solution is awesome. The color of the light that collide to the mesh is smooth now.
I want to apply the colors of different lights with the attenuation value in a emission input of a Surface shader and in a Frag color input of a Unlit shader. How I get this?
Thanks
Your solution is awesome. The color of the light that collide to the mesh is smooth now.
I want to apply the colors of different lights with the attenuation value in a emission input of a Surface shader and in a Frag color input of a Unlit shader. How I get this?
Thanks
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Color of all lights
Most of the lighting nodes we provide are built specifically for our Custom Lighting model, meaning that they can't be used in other contexts. Also, the Standard Surface shader has its own lighting calculations, while the Unlit shader template has none.
Ideally, you should use the Custom Lighting model to create unique node-based lighting for your Surface shader, but you may also use the Unlit template as a base to build your own custom template in order to suit a specific pipeline or purpose, although you'll need some shader knowledge in order to edit or create templates.
If you could further elaborate on what type of shader / effect you're trying to build, we might be able to provide additional insight.
Ideally, you should use the Custom Lighting model to create unique node-based lighting for your Surface shader, but you may also use the Unlit template as a base to build your own custom template in order to suit a specific pipeline or purpose, although you'll need some shader knowledge in order to edit or create templates.
If you could further elaborate on what type of shader / effect you're trying to build, we might be able to provide additional insight.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Color of all lights
Hello,
Thanks for your reply. I will test some things now.
Thanks
Thanks for your reply. I will test some things now.
Thanks
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Color of all lights
No problem, please let us know if you have any further questions!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!