Package com.jme3.terrain.noise
Class ShaderUtils
java.lang.Object
com.jme3.terrain.noise.ShaderUtils
Helper class containing useful functions explained in the book:
Texturing & Modeling - A Procedural Approach
-
Method Summary
Modifier and TypeMethodDescriptionstatic final float
abs
(float x) static final float
bias
(float b, float x) static final float
boxstep
(float a, float b, float x) static final int
c2i
(float[] color) static final float[][]
calcRotationMatrix
(float ax, float ay, float az) static final float
ceil
(float x) static final float
clamp
(float x, float a, float b) static final int
floor
(float x) static float[]
floor
(float[] fs) static float
frac
(float f) static final float
gain
(float g, float x) static final float
gammaCorrection
(float gamma, float x) static final ByteBuffer
getImageDataFromImage
(BufferedImage bufferedImage) static final float[]
i2c
(int color) static final float
length
(float[] v) static final float
length
(float x, float y, float z) static final float
max
(float a, float b) static final float
min
(float a, float b) static final float[]
mix
(float[] c1, float[] c2, float f) static final float
mix
(float a, float b, float f) static final int
mix
(int a, int b, float f) static final Color
static final float
mod
(float a, float b) static final float[]
normalize
(float[] v) static final float
pulse
(float a, float b, float x) static final float[]
rotate
(float[] v, float[][] m) static final float
sinValue
(float s, float minFreq, float maxFreq, float sWidth) static final float
smoothstep
(float a, float b, float x) static final float
spline
(float x, float[] knot) static final float[]
spline
(float x, float[][] knots) static final float
step
(float a, float x)
-
Method Details
-
i2c
public static final float[] i2c(int color) -
c2i
public static final int c2i(float[] color) -
mix
public static final float mix(float a, float b, float f) -
mix
-
mix
public static final int mix(int a, int b, float f) -
mix
public static final float[] mix(float[] c1, float[] c2, float f) -
step
public static final float step(float a, float x) -
boxstep
public static final float boxstep(float a, float b, float x) -
pulse
public static final float pulse(float a, float b, float x) -
clamp
public static final float clamp(float x, float a, float b) -
min
public static final float min(float a, float b) -
max
public static final float max(float a, float b) -
abs
public static final float abs(float x) -
smoothstep
public static final float smoothstep(float a, float b, float x) -
mod
public static final float mod(float a, float b) -
floor
public static final int floor(float x) -
ceil
public static final float ceil(float x) -
spline
public static final float spline(float x, float[] knot) -
spline
public static final float[] spline(float x, float[][] knots) -
gammaCorrection
public static final float gammaCorrection(float gamma, float x) -
bias
public static final float bias(float b, float x) -
gain
public static final float gain(float g, float x) -
sinValue
public static final float sinValue(float s, float minFreq, float maxFreq, float sWidth) -
length
public static final float length(float x, float y, float z) -
rotate
public static final float[] rotate(float[] v, float[][] m) -
calcRotationMatrix
public static final float[][] calcRotationMatrix(float ax, float ay, float az) -
normalize
public static final float[] normalize(float[] v) -
length
public static final float length(float[] v) -
getImageDataFromImage
-
frac
public static float frac(float f) -
floor
public static float[] floor(float[] fs)
-