P
P
Prizm2020-05-14 18:37:28
C++ / C#
Prizm, 2020-05-14 18:37:28

How to get object lighting information in unity?

I recently came across these videos:
https://youtu.be/g8eBXCgWwrk
https://youtu.be/CVhyQHJPK7M
They show how you can make a "cartoon" shader with lighting from several light sources. But at the end of the 2nd video they show that the number of incident light sources must be set in the shader settings, which is very strange. After searching the web for a while, I found out that it is possible to create custom shader graph nodes, such as here:
https://connect.unity.com/p/getting-light-informat...
It describes how to create a node that receives a color and the direction of the main lighting, which is not very useful in scenes with complex lighting.
So, is it possible to create a custom node that would give out light data? (vector of its fall to the surface, color, intensity or similar) And if possible, how?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question