Color of all lights

Node-based Shader Editor

Color of all lights

Postby mossman » Sun Dec 23, 2018 10:48 pm

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
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Color of all lights

Postby Ricardo Teixeira » Thu Dec 27, 2018 3:01 pm

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


Hey there,

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!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Color of all lights

Postby mossman » Tue Jan 01, 2019 5:08 pm

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
Attachments
multiplelights1.unitypackage
(9.86 KiB) Downloaded 70 times
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Color of all lights

Postby Amplify_Borba » Thu Jan 03, 2019 2:20 pm

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:

Image
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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Color of all lights

Postby mossman » Fri Jan 04, 2019 12:09 am

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
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Color of all lights

Postby Amplify_Borba » Fri Jan 04, 2019 11:27 am

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.
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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Color of all lights

Postby mossman » Sat Jan 05, 2019 8:26 pm

Hello,

Thanks for your reply. I will test some things now.

Thanks
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Color of all lights

Postby Amplify_Borba » Mon Jan 07, 2019 4:23 pm

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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 138 guests