org.jmol.g3d
final class Shade3D extends Object
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.
Field Summary | |
---|---|
static int | AMBIENT_FRACTION |
static int | AMBIENT_PERCENT |
static int | DIFFUSE_PERCENT |
static byte | intensitySpecularSurfaceLimit |
static int | INTENSE_FRACTION |
static int | INTENSITY_DIFFUSE |
static int | INTENSITY_SPECULAR |
static float[] | lighting |
static float | magnitudeLight |
static int | seed |
static int | shadeLast |
static int | shadeMax |
static byte | shadeNormal |
static byte[] | sphereIntensities |
static boolean | sphereShadingCalculated |
static int | SPECULAR_EXPONENT |
static int | SPECULAR_ON |
static int | SPECULAR_PERCENT |
static int | SPECULAR_POWER |
static float | xLight |
static float | xLightsource |
static float | yLight |
static float | yLightsource |
static float | zLight |
static float | zLightsource |
Method Summary | |
---|---|
static byte | calcDitheredNoisyIntensity(float x, float y, float z, float r) |
static float | calcFloatIntensityNormalized(float x, float y, float z) |
static int | calcFp8Intensity(float x, float y, float z) |
static byte | calcIntensity(float x, float y, float z) |
static byte | calcIntensityNormalized(float x, float y, float z) |
static void | calcSphereShading() |
static int[] | getShades(int rgb, boolean greyScale) |
static int | nextRandom8Bit() Implements RANDU algorithm for random noise in lighting/shading. |
static int | rgb(int red, int grn, int blu) |
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