Page 1 of 1

Color of all lights

PostPosted: Sun Dec 23, 2018 10:48 pm
by mossman
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

Re: Color of all lights

PostPosted: Thu Dec 27, 2018 3:01 pm
by Ricardo Teixeira
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!

Re: Color of all lights

PostPosted: Tue Jan 01, 2019 5:08 pm
by mossman
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

Re: Color of all lights

PostPosted: Thu Jan 03, 2019 2:20 pm
by Amplify_Borba
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

Re: Color of all lights

PostPosted: Fri Jan 04, 2019 12:09 am
by mossman
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

Re: Color of all lights

PostPosted: Fri Jan 04, 2019 11:27 am
by Amplify_Borba
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.

Re: Color of all lights

PostPosted: Sat Jan 05, 2019 8:26 pm
by mossman
Hello,

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

Thanks

Re: Color of all lights

PostPosted: Mon Jan 07, 2019 4:23 pm
by Amplify_Borba
No problem, please let us know if you have any further questions!