org.jmol.g3d
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.
Modifier and Type | Field and Description |
---|---|
(package private) static float |
ambientFraction |
(package private) static int |
ambientPercent |
(package private) static float |
diffuseFactor |
(package private) static int |
diffusePercent |
(package private) static float |
intenseFraction |
private static float |
magnitudeLight |
(package private) static int |
phongExponent |
private static int |
seed |
(package private) static int |
shadeIndexLast |
(package private) static int |
shadeIndexMax |
(package private) static byte |
shadeIndexNoisyLimit |
(package private) static byte |
shadeIndexNormal |
(package private) static int |
specularExponent |
(package private) static float |
specularFactor |
(package private) static boolean |
specularOn |
(package private) static int |
specularPercent |
(package private) static int |
specularPower |
(package private) static byte[] |
sphereShadeIndexes |
(package private) static boolean |
sphereShadingCalculated |
(package private) static boolean |
usePhongExponent |
(package private) static float |
xLight |
private static float |
xLightsource |
(package private) static float |
yLight |
private static float |
yLightsource |
(package private) static float |
zLight |
private static float |
zLightsource |
static int |
zPower |
Constructor and Description |
---|
Shade3D() |
Modifier and Type | Method and Description |
---|---|
(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) |
static final int shadeIndexMax
static final int shadeIndexLast
static final byte shadeIndexNormal
static final byte shadeIndexNoisyLimit
public static int zPower
private static final float xLightsource
private static final float yLightsource
private static final float zLightsource
private static final float magnitudeLight
static final float xLight
static final float yLight
static final float zLight
static boolean specularOn
static boolean usePhongExponent
static int ambientPercent
static int diffusePercent
static int specularExponent
static int specularPercent
static int specularPower
static int phongExponent
static float ambientFraction
static float diffuseFactor
static float intenseFraction
static float specularFactor
static boolean sphereShadingCalculated
static final byte[] sphereShadeIndexes
private static int seed
static int[] getShades(int rgb, boolean greyScale)
static final int rgb(int red, int grn, int blu)
static int getShadeIndex(float x, float y, float z)
static byte getShadeIndexNormalized(float x, float y, float z)
static int getFp8ShadeIndex(float x, float y, float z)
private static float getFloatShadeIndexNormalized(float x, float y, float z)
static byte getDitheredNoisyShadeIndex(float x, float y, float z, float r)
static void calcSphereShading()
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.