API / geotoolkit3d / util / Shaders / Shaders
Utility class providing glsl code snippets that can be included in shaders.
Constructors
Methods
▸ getClassName(): string
string
▸ Static getClassName(): string
string
▸ Static packFloatToRGBA(float): Vector4
Pack the given floats from the range [0, 1) into a vec4 where each member is a [0, 255] int value
See
Shaders.packFloatToVec4
| Name | Type | Description |
|---|---|---|
float | number | in the range [0, 1) |
Vector4
RGBA vector4 (Caller should make a defensive copy)
▸ Static packFloatToVec4(float): Vector4
CPU version of geotoolkit3d.util.Shaders.SHADER_FLOAT_TO_VEC4;
| Name | Type | Description |
|---|---|---|
float | number | The value contained in the range [0, 1) to be converted to a THREE.Vector4 |
Vector4
Normalized vector4 (Caller should make a defensive copy of the returned vector)
▸ Static unpackRGBAToFloat(v4): number
Unpack a RGBA as a float value
See
Shaders.unpackVec4ToFloat
| Name | Type | Description |
|---|---|---|
v4 | number[] | Vector4 | RGBA vector4 components should be contained in the range [0, 255] |
number
The converted float value
▸ Static unpackVec4ToFloat(vec4): number
Unpack a Vector4 as a float value
See
Shaders.packFloatToVec4
| Name | Type | Description |
|---|---|---|
vec4 | Vector4 | RGBA vector4 components values should be contained in the range [0, 1) |
number
The converted float value