com.threed.jpct
Class Lights

java.lang.Object
  extended bycom.threed.jpct.Lights
All Implemented Interfaces:
java.io.Serializable

public final class Lights
extends java.lang.Object
implements java.io.Serializable

Manages the dynamic lights in a scene. This is done internally by jPCT and because lights are not treated as single Objects but as a whole for each world, not much is public within here. Everything that is possible with individual lights should be done via the corresponding World instance.

See Also:
Serialized Form

Field Summary
static boolean LIGHT_INVISIBLE
          The light is not visible
static boolean LIGHT_VISIBLE
          The light is visible
static int OVERBRIGHT_LIGHTING_DISABLED
          Overbright lighting won't be used
static int OVERBRIGHT_LIGHTING_ENABLED
          Overbright lighting will be used (default)
static int RGB_SCALE_2X
          2X RGB scale value
static int RGB_SCALE_4X
          4X RGB scale value
static int RGB_SCALE_DEFAULT
          Default RGB scale value
 
Method Summary
 void setOverbrightLighting(int mode)
          Disable/Enable (default) overbright lighting.
 void setRGBScale(int scale)
          With this, it's possible to "simulate" overbright lighting to a degree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIGHT_VISIBLE

public static final boolean LIGHT_VISIBLE
The light is visible

See Also:
Constant Field Values

LIGHT_INVISIBLE

public static final boolean LIGHT_INVISIBLE
The light is not visible

See Also:
Constant Field Values

OVERBRIGHT_LIGHTING_DISABLED

public static final int OVERBRIGHT_LIGHTING_DISABLED
Overbright lighting won't be used

See Also:
Constant Field Values

OVERBRIGHT_LIGHTING_ENABLED

public static final int OVERBRIGHT_LIGHTING_ENABLED
Overbright lighting will be used (default)

See Also:
Constant Field Values

RGB_SCALE_DEFAULT

public static final int RGB_SCALE_DEFAULT
Default RGB scale value

See Also:
Constant Field Values

RGB_SCALE_2X

public static final int RGB_SCALE_2X
2X RGB scale value

See Also:
Constant Field Values

RGB_SCALE_4X

public static final int RGB_SCALE_4X
4X RGB scale value

See Also:
Constant Field Values
Method Detail

setOverbrightLighting

public void setOverbrightLighting(int mode)
Disable/Enable (default) overbright lighting. The OpenGL-renderer can't do overbright lighting anyway, so it makes some sense to disable it in case OpenGL is used.
If one wants to make the software and OpenGL renderer look as similar as possible, it's recommended to turn overbright lighting off.

Parameters:
mode - the overbright-lighting-mode
See Also:
OVERBRIGHT_LIGHTING_ENABLED, OVERBRIGHT_LIGHTING_DISABLED

setRGBScale

public void setRGBScale(int scale)
With this, it's possible to "simulate" overbright lighting to a degree. It causes all pixels to be multiplied with the given scale value and clamped to [0..1], which will make the lights (and therefor the whole scene) look brighter. This effect is supported by the SoftGLRenderer and the GLRenderer (not by the LegacyRenderer).
The GLRenderer only supports this, if the hardware/driver supports the "GL_ARB_texture_env_combine" extension. If this extension isn't supported and you are settimg the scale anyway, the GLRenderer will cause an error-entry into the log the next time it's accessed by jPCT.
Because it's required to query the OpenGL driver directly about support for this feature (in case OpenGL should be used), it's impossible to check the availability of this feature here. The FrameBuffer-class offers a method to do so, because it's the only one in jPCT that can access the GLRenderer directly.
To make the software and OpenGL renderer look as similar as possible when using this option, it's recommended to turn overbright lighting off if anything else than RGB_SCALE_DEFAULT should be used.

Parameters:
scale - the scaling
See Also:
RGB_SCALE_DEFAULT, RGB_SCALE_2X, RGB_SCALE_4X, setOverbrightLighting(int), FrameBuffer.supports(java.lang.String)