public final class Shader
extends java.lang.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 | Description |
---|---|---|
static float |
ambientFraction |
|
static int |
ambientPercent |
|
static float |
diffuseFactor |
|
static int |
diffusePercent |
|
static byte[][][] |
ellipsoidShades |
|
static float |
intenseFraction |
|
static int |
maxSphereCache |
|
static int |
nIn |
|
static int |
nOut |
|
static int |
phongExponent |
|
static int |
shadeIndexLast |
|
static int |
shadeIndexMax |
|
static byte |
shadeIndexNoisyLimit |
|
static byte |
shadeIndexNormal |
|
static int |
specularExponent |
|
static float |
specularFactor |
|
static boolean |
specularOn |
|
static int |
specularPercent |
|
static int |
specularPower |
|
static byte[] |
sphereShadeIndexes |
|
static boolean |
sphereShadingCalculated |
|
static int[][] |
sphereShapeCache |
|
static boolean |
usePhongExponent |
|
static float |
xLight |
|
static float |
yLight |
|
static float |
zLight |
Constructor | Description |
---|---|
Shader() |
Modifier and Type | Method | Description |
---|---|---|
static void |
calcSphereShading() |
|
static void |
createEllipsoidShades() |
|
static void |
flushSphereCache() |
|
static byte |
getDitheredNoisyShadeIndex(float x,
float y,
float z,
float r) |
|
static int |
getEllipsoidShade(float x,
float y,
float z,
int radius,
Matrix4f mDeriv) |
|
static int |
getFp8ShadeIndex(float x,
float y,
float z) |
|
static int |
getShadeIndex(float x,
float y,
float z) |
|
static byte |
getShadeIndexNormalized(float x,
float y,
float z) |
|
static int[] |
getShades(int rgb,
boolean greyScale) |
|
static int |
nextRandom8Bit() |
Implements RANDU algorithm for random noise in lighting/shading.
|
public static final int shadeIndexMax
public static final int shadeIndexLast
public static final byte shadeIndexNormal
public static final byte shadeIndexNoisyLimit
public static final float xLight
public static final float yLight
public static final float zLight
public static boolean specularOn
public static boolean usePhongExponent
public static int ambientPercent
public static int diffusePercent
public static int specularExponent
public static int specularPercent
public static int specularPower
public static int phongExponent
public static float ambientFraction
public static float diffuseFactor
public static float intenseFraction
public static float specularFactor
public static boolean sphereShadingCalculated
public static final byte[] sphereShadeIndexes
public static final int maxSphereCache
public static final int[][] sphereShapeCache
public static byte[][][] ellipsoidShades
public static int nOut
public static int nIn
public static int[] getShades(int rgb, boolean greyScale)
public static int getShadeIndex(float x, float y, float z)
public static byte getShadeIndexNormalized(float x, float y, float z)
public static int getFp8ShadeIndex(float x, float y, float z)
public static byte getDitheredNoisyShadeIndex(float x, float y, float z, float r)
public static void calcSphereShading()
public 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.
public static int getEllipsoidShade(float x, float y, float z, int radius, Matrix4f mDeriv)
public static void createEllipsoidShades()
public static void flushSphereCache()