On Fri, Feb 12, 2010 at 1:01 PM, Erik Hofman <[email protected]> wrote:

> Tim Moore wrote:
> >  That's not a problem. Color values are allowed to be any value and are
> > clamped at the end of the pipeline. However, we do some other clamping
> > so that the appearance isn't too different when shaders are turned on.
> > We have a general lighting problem: our ambient, diffuse and specular
> > colors often add up to more than 1.0, which means that the diffuse
> > shading can be completely washed out.
>
> Are you saying that ambient + diffuse + specular added together may not
> exceed 1.0? I alway thought their maximum value was 1.0 (also for
> individual channels).
>
> Ambient, diffuse, specular and emission material values are not clamped by
OpenGL, though values > 1.0 don't make physical sense. The corresponding
LightSource values are not clamped either; even if they were, you could
easily get color values greater than 1.0 when you add up all the lighting
contributions. In the fixed function pipeline the color produced by lighting
is clamped before being modulated by the texture. In the shader pipeline it
is not (because the math is all done in the shader program), but the final
output color has to be clamped unless your using an exotic floating point
frame pointer. The results are visibly different if you do the clamping
before or after the texture multiply, so our shaders do clamp before in
order to avoid nasty artifacts.

Of course, you have to clamp the color values before they are sent to the
screen, but that's what tone mapping and HDR are all about: mapping a wide
range of color values to the gamut supported by the display.

Tim
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to