thaichris53 opened this issue on Aug 21, 2008 · 56 posts
bagginsbill posted Thu, 11 September 2008 at 10:38 AM
On the top right, there is a Math:Pow function with Value_1 = 30. This value is your "reference distance". This is what it means: as the light moves away from the source, at what distance is the intensity exactly 1 times your dial setting? I entered 30. This means that my light will be exactly at the dialed Intensity (1.0 in this case) at that distance from the point light. Anything closer than that will be brighter than the dialed intensity. Anything farther will be darker.
The reference distance needs to be squared, so I have it in a Math:Pow node with Value_2 = 2, thus it is distance ^ 2.
Now the coordinates of the light need to be entered in the User_Defined node. Red,Green,Blue corresponds with X, Y, Z. My position was 0, 50, 0. If you move the light, just enter the new coordinates.
The P node delivers the position of the rendered point, in units of 1/10 of an inch. (Why I don't know. Strange choice.) By setting the P node factors to .1, I convert those coordinates to inches exactly.
The Color_Math:Subtract node is finding the difference in xyz position between the light coordinates and the rendered point coordinates. (This is why units matter - gotta pick a unit and go with that. If you subtract inches from meters or whatever, it's all screwed up.)
The Color_Math:Multiply squares each of those values. So now we have dx^2, dy^2, dz^2. (dx is delta x, dy is delta y, etc.)
Finally there is a Math:Divide. This computes the ratio of the reference distance and the measured distance, squared. ( thus it is d^2 / r^2). Whend d=r, this is 1. See?
Note: I had to use 3 times the delta. This seems strange, right? Well the reason is simple. When you plug a color into a number, Poser averages the three values, i.e. it is (x ^2 + y^2 + z^2) / 3. Since I actually want the x^2+y^2+z^2, I multiply by 3 and that business gets canceled out.
So the output of the divide node is the proportional light intensity at the rendered point. Plugging that into my Light Intensity gives me my final value.
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)