[Bf-committers] Re: Minnaert diffuse shader
GSR - FR
famrom at infernal-iceberg.com
Sat Jan 8 17:46:12 CET 2005
lordloki at vodafone.es (2005-01-08 at 0221.00 +0100):
> +/* Minnaert diffuse */
> +float Minnaert_Diff(float *n, float *l, float *v, float darkness)
> +{
> + float i, nv, nl;
> +
> + nl= n[0]*l[0]+n[1]*l[1]+n[2]*l[2]; /* Dot product between surface normal and light vector */
> + if(nl<=0.0) nl= 0.0;
> +
> + nv= n[0]*v[0]+n[1]*v[1]+n[2]*v[2]; /* Dot product between surface normal and view vector */
> + if(nv<=0.0) nv= 0.0;
> +
> + i = nl * pow (nl, darkness) * pow ( (1.001 - nv), (1 - darkness) );
> + return i;
> +}
> +
I have been looking and found:
http://accad.osu.edu/~bwatkins/ADC/Hw6/hw.html
With proposed shaders:
http://accad.osu.edu/~bwatkins/ADC/Hw6/minnaert.slim
http://accad.osu.edu/~bwatkins/ADC/Hw6/minnaertB.slim
And talking about most sources:
http://www.cs.princeton.edu/~smr/cs348c-97/surveypaper.html
And nvidia "flipped" method:
http://cvs1.nvidia.com/DEMOS/OpenGL/src/cg_lightmodel/Surface%20Reflection%20Models.doc
I wonder, which one did you implemented? I am trying to compare to
that RMan shaders, and yours seems a mix of both (they could be wrong,
of course).
Also, it seems that guy implemented it in such way that allows both
effects, by allowing a bigger range of input, 0 to 2. OTOH, probably
if the paramenter is called darkness, it should be -1 to 1 (like
negative lights and so on).
GSR
More information about the Bf-committers
mailing list