RobynsVeil opened this issue on Jan 24, 2009 · 490 posts
bagginsbill posted Sun, 25 January 2009 at 8:47 PM
I disconnect the Diffuse node, and build an equivalent from raw math.
The N node is key here.
The N node gives us information about our surface normal vector, N. Not only does it do that, but it muliplies each component of N (using the parameters) with any values we like.
So if I plug in the components of L for an infinite light with yRotate = 45 degrees, guess what?
This node will give me the value of N dot L!!!
The normalized vector for such a light is approximately [ .707107, 0, .707107 ]. (1 / sqrt(2) is the component value)
The only complication is that we want this as a single number, not a tuple. So we have to plug that into a number. Whenever Poser converts a tuple to a single number, it averages the 3 parts. I.e. it uses (x + y + z) / 3. But we want (x + y + z). So we have to multiply that with 3 to cancel out the average.
This will give us Nx * Lx + Ny * Ly + Nz * Lz, which is our dot product between N and L.
I give you the shader and render. You may not believe it, but this produces nearly identical results to a "lit" prop, but you could completely delete your light here and it would still look like that.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)