View Full Version : Gradient editor enhancements?

04-08-2004, 03:09 PM
I'm pretty green in LW so if this is a dumb request let me know. If this is already in LW8, never mind. :p

I'm playing around with Dean Scott's photorealistic earth tutorial (http://personal.southern.edu/~dascott/tutorial01/nasa-earth.htm), and it seems to me that the Surface Editor's Gradient Editor could benefit from the following:

1. The planet in this tut has an outer atmosphere object faked with gradients, which looks nice under most lighting except back lighting - if the picture below were a real NASA one, the limb would be brightly lit with sunset colors. The gradient can color a surface based on "Incidence Angle" (from the camera) and "Light Incidence" (from a light), but if it had an additional source option which was the angle from a light to the surface and back to the camera (same angle one that generates specularity), you could easily punch up the glow etc. at that area.

2. Also, if the start and end angle options were actually editable, especially up to 180 degrees, that would provide even more possibilities. By allowing more than 90 degrees, which does seem silly at first, you can easily select areas which fall on the dark side of objects, away from the light. For example, if you want to put city lights or volcanoes on the dark side of the earth, you could use this feature to set up a gradient to create an alpha on a second bitmap with the lights. The alpha would start at 90 degrees (light is glancing the poly) and go up to 180 degrees (light is directly behind the poly). Angles from 90 to 180 degrees don't make much sense for the actual lighting, but in terms of surfacing they could be very useful.

Thanks for listening! -MG

04-08-2004, 03:11 PM
Oops, pictures:

04-08-2004, 03:13 PM
And: (is there a way to attach more than one picture?)

04-09-2004, 04:46 AM
Well, that would be tricky to say the least (actually more like impossible from a mathematical point of view). It's kind of the same problem all rotation and angular calculations suffer from - only values between 0 and 90 degrees are unique. Also Incidence Angle is based upon projecting rays from the camera/ light. Extending and evaluating this data beyond the point of visibility (from the respective source) could only be done by extrapolating it (with more or less accuracy depending on the situation).


04-09-2004, 09:39 AM
What's hard about it? You just compare vectors ...

04-09-2004, 01:33 PM
Nope, it's not... It's more like comparing the angles of those vectors and not the vectors themselves and you surely know the problems that may arise. Surely there may be a way to cleverly implement such functionality, but I'm not aware of how to avoid certain issues.


04-09-2004, 10:06 PM
Vectors are an angle .. :confused:

I don't know what problems you're talking about, if you could point me somewhere that'd be good, but I have an lscript for modeler that will colour an objct based on the vector, and that reaches around the other side, so that's 180 degrees ...

04-10-2004, 06:32 AM
Yea two vectors define an angle between 0 and 180, there's no uniqueness problem since vectors have a direction.
Just calc the dot-product and you have the cosine, which goes from 1 at 0 to -1 at 180...

I also wondered why Newtek did that with 90.
But one could write a shader with its own gradient inputs (well if you want gradient inputs in plugins you actually have to write your own implementation, only "previous layer" is available by default).

Angle between light and incidence shouldn't be that hard either...so who wants tp write a gradient-madness shader? :D