[tuhopuu-devel] Re: Minnaert diffuse shader
Jonathan Merritt
j.merritt at pgrad.unimelb.edu.au
Wed Jan 12 13:09:30 CET 2005
Hi Everyone,
I have committed a slightly modified version of Jorge's Minnaert shader
patch. So far, it implements both the "original" and the "nVIDIA"
versions of the shader. However, I'm not 100% happy with either of them
at the moment. I'll expand on this... :-)
Basically, the two versions of the shader implement the same kind of
limb darkening effect, which is an extra coefficient multiplied by the
standard Lambertian shading model. This coefficient is <= 1.0, and
hence selectively darkens certain parts of the surface. The magnitude
of this limb darkening is controlled by a "darkening" parameter. The
main difference between the two implementations (original vs nVIDIA) is
the range of the "darkening" parameter, and the direction in which this
parameter should move to introduce a greater darkening effect:
1. Original: "darkening" should be in the range [1,2], with increasing
values showing increasing limb darkening.
2. nVIDIA: "darkening" should be in the range [0,1], with decreasing
values showing increasing limb darkening.
I'm personally not happy that the "darkening" parameter is as intuitive
as it could be for either of these cases. What I would suggest is a
"Blender" version of this shader, in which "darkening" lies in the range
[0,1], with increasing values showing increasing limb darkening. I
think that would be a range that a user might expect for this parameter,
and certainly having "increased darkening" ought to result in an
increase of the darkening effect, wouldn't you think? This is unlike
the nVIDIA version, where "decreased darkening" results in an increase
of the darkening effect.
To implement this "Blender" version, I would propose a straightforward
modification of the current nVIDIA model (refer to
source/blender/render/intern/source/rendercore.c):
i = nl * pow( nl, 1-k ) * pow( (1.001-nv), k )
o "darkening" = k, and is in the range [0,1]
o increasing k increases the limb darkening effect.
o (NB: I'm not sure 100% how Alfredo's energy conservation term fits
into all of this yet.)
What does everyone think? Have I messed anything up really badly here?
:-) If people are happy about using this new definition for darkening
then I'll go ahead and implement it.
Jonathan Merritt.
More information about the tuhopuu-devel
mailing list