Panda3D

Functions
lightRampAttrib.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

`#include "lightRampAttrib.h"`
`#include "graphicsStateGuardianBase.h"`
`#include "dcast.h"`
`#include "bamReader.h"`
`#include "bamWriter.h"`
`#include "datagram.h"`
`#include "datagramIterator.h"`

Go to the source code of this file.

## Functions
CPT(RenderAttrib) LightRampAttrib | CPT (RenderAttrib) LightRampAttrib
| Constructs a new LightRampAttrib object. More...

## Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
  drose

Date
  2002-03-04

Definition in file lightRampAttrib.cxx.

## Function Documentation

## ◆ CPT()

CPT (RenderAttrib) LightRampAttrib CPT | ( | RenderAttrib |  | ) |

Constructs a new LightRampAttrib object.

This is the standard OpenGL lighting ramp, which clamps the final light total to the 0-1 range.

This differs from the usual OpenGL lighting model in that it does not clamp the final lighting total to (0,1).

This causes the luminance of the diffuse lighting contribution to be quantized using a single threshold:

if (original_luminance > threshold0) {
luminance = level0;
} else {
luminance = 0.0;
}

This causes the luminance of the diffuse lighting contribution to be quantized using two thresholds:

if (original_luminance > threshold1) {
luminance = level1;
} else if (original_luminance > threshold0) {
luminance = level0;
} else {
luminance = 0.0;
}

This causes an HDR tone mapping operation to be applied.

Normally, brightness values greater than 1 cannot be distinguished from each other, causing very brightly lit objects to wash out white and all detail to be erased. HDR tone mapping remaps brightness values in the range 0-infinity into the range (0,1), making it possible to distinguish detail in scenes whose brightness exceeds 1.

However, the monitor has finite contrast. Normally, all of that contrast is used to represent brightnesses in the range 0-1. The HDR0 tone mapping operator 'steals' one quarter of that contrast to represent brightnesses in the range 1-infinity.

FINAL_RGB = (RGB^3 + RGB^2 + RGB) / (RGB^3 + RGB^2 + RGB + 1)

This causes an HDR tone mapping operation to be applied.

Normally, brightness values greater than 1 cannot be distinguished from each other, causing very brightly lit objects to wash out white and all detail to be erased. HDR tone mapping remaps brightness values in the range 0-infinity into the range (0,1), making it possible to distinguish detail in scenes whose brightness exceeds 1.

However, the monitor has finite contrast. Normally, all of that contrast is used to represent brightnesses in the range 0-1. The HDR1 tone mapping operator 'steals' one third of that contrast to represent brightnesses in the range 1-infinity.

FINAL_RGB = (RGB^2 + RGB) / (RGB^2 + RGB + 1)

This causes an HDR tone mapping operation to be applied.

Normally, brightness values greater than 1 cannot be distinguished from each other, causing very brightly lit objects to wash out white and all detail to be erased. HDR tone mapping remaps brightness values in the range 0-infinity into the range (0,1), making it possible to distinguish detail in scenes whose brightness exceeds 1.

However, the monitor has finite contrast. Normally, all of that contrast is used to represent brightnesses in the range 0-1. The HDR2 tone mapping operator 'steals' one half of that contrast to represent brightnesses in the range 1-infinity.

FINAL_RGB = (RGB) / (RGB + 1)

Definition at line 30 of file lightRampAttrib.cxx.