LightRampAttrib

from panda3d.core import LightRampAttrib
class LightRampAttrib

Bases: RenderAttrib

A Light Ramp is any unary operator that takes a rendered pixel as input, and adjusts the brightness of that pixel. For example, gamma correction is a kind of light ramp. So is HDR tone mapping. So is cartoon shading. See the constructors for an explanation of each kind of ramp.

Inheritance diagram

Inheritance diagram of LightRampAttrib

LRTDefault = 0
LRTDoubleThreshold = 3
LRTHdr0 = 4
LRTHdr1 = 5
LRTHdr2 = 6
LRTIdentity = 1
LRTSingleThreshold = 2
LRT_default = 0
LRT_double_threshold = 3
LRT_hdr0 = 4
LRT_hdr1 = 5
LRT_hdr2 = 6
LRT_identity = 1
LRT_single_threshold = 2
__init__(*args, **kwargs)
class_slot = 18
getClassSlot()

C++ Interface: get_class_slot()

getClassType()

C++ Interface: get_class_type()

getLevel()

C++ Interface: get_level(LightRampAttrib self, int n)

/**
  • Returns the nth lighting level.

*/

getMode()

C++ Interface: get_mode(LightRampAttrib self)

/**
  • Returns the LightRampAttrib mode.

*/

getThreshold()

C++ Interface: get_threshold(LightRampAttrib self, int n)

/**
  • Returns the nth threshold level.

*/

get_class_slot()

C++ Interface: get_class_slot()

get_class_type()

C++ Interface: get_class_type()

get_level()

C++ Interface: get_level(LightRampAttrib self, int n)

/**
  • Returns the nth lighting level.

*/

get_mode()

C++ Interface: get_mode(LightRampAttrib self)

/**
  • Returns the LightRampAttrib mode.

*/

get_threshold()

C++ Interface: get_threshold(LightRampAttrib self, int n)

/**
  • Returns the nth threshold level.

*/

makeDefault()

C++ Interface: make_default()

/**
  • Constructs a new LightRampAttrib object. This is the standard OpenGL

  • lighting ramp, which clamps the final light total to the 0-1 range.

*/

makeDoubleThreshold()

C++ Interface: make_double_threshold(float thresh0, float lev0, float thresh1, float lev1)

/**
  • Constructs a new LightRampAttrib object. This causes the luminance of the

  • diffuse lighting contribution to be quantized using two thresholds:

  • @code

  • if (original_luminance > threshold1) {

  • luminance = level1;

  • } else if (original_luminance > threshold0) {

  • luminance = level0;

  • } else {

  • luminance = 0.0;

  • }

  • @endcode

*/

makeHdr0()

C++ Interface: make_hdr0()

/**
  • Constructs a new LightRampAttrib object. 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.

  • @code

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

  • @endcode

*/

makeHdr1()

C++ Interface: make_hdr1()

/**
  • Constructs a new LightRampAttrib object. 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.

  • @code

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

  • @endcode

*/

makeHdr2()

C++ Interface: make_hdr2()

/**
  • Constructs a new LightRampAttrib object. 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.

  • @code

  • FINAL_RGB = (RGB) / (RGB + 1)

  • @endcode

*/

makeIdentity()

C++ Interface: make_identity()

/**
  • Constructs a new LightRampAttrib object. This differs from the usual

  • OpenGL lighting model in that it does not clamp the final lighting total to

  • (0,1).

*/

makeSingleThreshold()

C++ Interface: make_single_threshold(float thresh0, float lev0)

/**
  • Constructs a new LightRampAttrib object. This causes the luminance of the

  • diffuse lighting contribution to be quantized using a single threshold:

  • @code

  • if (original_luminance > threshold0) {

  • luminance = level0;

  • } else {

  • luminance = 0.0;

  • }

  • @endcode

*/

make_default()

C++ Interface: make_default()

/**
  • Constructs a new LightRampAttrib object. This is the standard OpenGL

  • lighting ramp, which clamps the final light total to the 0-1 range.

*/

make_double_threshold()

C++ Interface: make_double_threshold(float thresh0, float lev0, float thresh1, float lev1)

/**
  • Constructs a new LightRampAttrib object. This causes the luminance of the

  • diffuse lighting contribution to be quantized using two thresholds:

  • @code

  • if (original_luminance > threshold1) {

  • luminance = level1;

  • } else if (original_luminance > threshold0) {

  • luminance = level0;

  • } else {

  • luminance = 0.0;

  • }

  • @endcode

*/

make_hdr0()

C++ Interface: make_hdr0()

/**
  • Constructs a new LightRampAttrib object. 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.

  • @code

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

  • @endcode

*/

make_hdr1()

C++ Interface: make_hdr1()

/**
  • Constructs a new LightRampAttrib object. 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.

  • @code

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

  • @endcode

*/

make_hdr2()

C++ Interface: make_hdr2()

/**
  • Constructs a new LightRampAttrib object. 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.

  • @code

  • FINAL_RGB = (RGB) / (RGB + 1)

  • @endcode

*/

make_identity()

C++ Interface: make_identity()

/**
  • Constructs a new LightRampAttrib object. This differs from the usual

  • OpenGL lighting model in that it does not clamp the final lighting total to

  • (0,1).

*/

make_single_threshold()

C++ Interface: make_single_threshold(float thresh0, float lev0)

/**
  • Constructs a new LightRampAttrib object. This causes the luminance of the

  • diffuse lighting contribution to be quantized using a single threshold:

  • @code

  • if (original_luminance > threshold0) {

  • luminance = level0;

  • } else {

  • luminance = 0.0;

  • }

  • @endcode

*/

mode