Hi everyone,
I’m trying to write a “simple” cel shaded material. I’m struggling with the possibility of having a varying number of lights that all work with the material.
The best thing I came up with until now is creating a Custom Node that takes the VertexNormalWS, the 1D texture with the cel shade’s gradient and a texture that contains in its pixels the data of the lights that I have in the scene and does his things in a for loop (for every light I have) and outputs a sort of a lightmap.
The texture with the lights data is generated in real time and is 2 x nLights pixels and contains in his pixels every lights’ direction and color.
**
Actually my problem is that I can’t figure out how to read the texture’s dimensions and the single pixel value inside my custom node.**
Maybe this is a dumb question but I never programmed a custom node. If you came up with a simpler way to do this thing, like putting in my material editor directly an array with that data would be awesome.