org.jmol.g3d
Class Shade3D
java.lang.Object
org.jmol.g3d.Shade3D
final class Shade3D
- extends Object
All static functions.
Implements the shading of RGB values to support shadow and lighting
highlights.
Each RGB value has 64 shades. shade[0] represents ambient lighting.
shade[63] is white ... a full specular highlight.
- Author:
- Miguel, miguel@jmol.org
Method Summary |
(package private) static void |
calcSphereShading()
|
(package private) static byte |
getDitheredNoisyShadeIndex(float x,
float y,
float z,
float r)
|
private static float |
getFloatShadeIndexNormalized(float x,
float y,
float z)
|
(package private) static int |
getFp8ShadeIndex(float x,
float y,
float z)
|
(package private) static int |
getShadeIndex(float x,
float y,
float z)
|
(package private) static byte |
getShadeIndexNormalized(float x,
float y,
float z)
|
(package private) static int[] |
getShades(int rgb,
boolean greyScale)
|
(package private) static int |
nextRandom8Bit()
Implements RANDU algorithm for random noise in lighting/shading. |
(package private) static int |
rgb(int red,
int grn,
int blu)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
shadeIndexMax
static final int shadeIndexMax
- See Also:
- Constant Field Values
shadeIndexLast
static final int shadeIndexLast
- See Also:
- Constant Field Values
shadeIndexNormal
static final byte shadeIndexNormal
- See Also:
- Constant Field Values
shadeIndexNoisyLimit
static final byte shadeIndexNoisyLimit
- See Also:
- Constant Field Values
zPower
public static int zPower
xLightsource
private static final float xLightsource
- See Also:
- Constant Field Values
yLightsource
private static final float yLightsource
- See Also:
- Constant Field Values
zLightsource
private static final float zLightsource
- See Also:
- Constant Field Values
magnitudeLight
private static final float magnitudeLight
xLight
static final float xLight
yLight
static final float yLight
zLight
static final float zLight
specularOn
static boolean specularOn
usePhongExponent
static boolean usePhongExponent
ambientPercent
static int ambientPercent
diffusePercent
static int diffusePercent
specularExponent
static int specularExponent
specularPercent
static int specularPercent
specularPower
static int specularPower
phongExponent
static int phongExponent
ambientFraction
static float ambientFraction
diffuseFactor
static float diffuseFactor
intenseFraction
static float intenseFraction
specularFactor
static float specularFactor
sphereShadingCalculated
static boolean sphereShadingCalculated
sphereShadeIndexes
static final byte[] sphereShadeIndexes
seed
private static int seed
Shade3D
Shade3D()
getShades
static int[] getShades(int rgb,
boolean greyScale)
rgb
static final int rgb(int red,
int grn,
int blu)
getShadeIndex
static int getShadeIndex(float x,
float y,
float z)
getShadeIndexNormalized
static byte getShadeIndexNormalized(float x,
float y,
float z)
getFp8ShadeIndex
static int getFp8ShadeIndex(float x,
float y,
float z)
getFloatShadeIndexNormalized
private static float getFloatShadeIndexNormalized(float x,
float y,
float z)
getDitheredNoisyShadeIndex
static byte getDitheredNoisyShadeIndex(float x,
float y,
float z,
float r)
calcSphereShading
static void calcSphereShading()
nextRandom8Bit
static int nextRandom8Bit()
Implements RANDU algorithm for random noise in lighting/shading.
RANDU is the classic example of a poor random number generator.
But it is very cheap to calculate and is good enough for our purposes.
- Returns:
- Next random