Winterclaw opened this issue on Jul 28, 2010 · 100 posts
bagginsbill posted Fri, 30 July 2010 at 11:46 AM
It will probably be till next week that I finish this. I'm having to do a lot of measurement of how Poser's spotlight works.
I'm taking advantage of the UV "mapping" of a light. The light cone is mapped onto a UV space, with U=.5, V=.5 in the center of the light cone, and the edge of the light cone at the edge of the UV space (0 to 1). Any point being rendered (lit) corresponds with some point on that UV map.
I'm having two problems.
The first trouble I'm having is that the UV distance to the center does not correspond exactly with the angle within the cone. The correspondence is a non-linear function. If it was linear, then halfway between center and edge would be half the cone angle. But it isn't.
I did a quick and dirty approximation just to verify the concept. But now I'm trying to get the exact function. Given r, the distance from the UV center to the point being rendered, what is the angle? I have built a goniometer in Poser so I can take a bunch of measurements but it is tedious work. Then I have to figure out what the function is.
The second problem is that spotlights are set up with a maximum cone angle of 160 degrees (giving a maximum deviation from center of 80 degrees). But some of the IES lights produce non-zero light between 80 and 90 degrees. In fact, some go all the way to 180 degrees. (They emit light up and down.) Such lights must be modeled as two spot lights in Poser. I'm not trying to tackle that yet. I'm just trying to get the angle UV mapping to go out to 180 or at least really close.
The strange thing is that as the cone is widened, the UV mapping changes non-linearly. I.e. if the UV radius r = .09 matches 45 degrees with a 160 degree spot cone, it should be expected that it would not change by a lot with a 170 degree spot cone. It should be something like .09 * 160/170 which is not a big change. But it does by a lot.
I suspect there is a 1/sin(theta) term in the equation somewhere. As the deviation angle theta approaches 90 degrees, 1/sin(theta) goes to infinity.
If the UV mapping of the light was public knowledge, I would not have to do all this experimenting.
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)