Last updated

API / geotoolkit3d / util / Shaders / Shaders

Class: Shaders

util.Shaders.Shaders

Utility class providing glsl code snippets that can be included in shaders.

Table of contents

Constructors
Methods

Contents

Constructors

new Shaders()

new Shaders()

Methods

getClassName

getClassName(): string

Returns

string


getClassName

Static getClassName(): string

Returns

string


packFloatToRGBA

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

Parameters

Name Type Description
floatnumberin the range [0, 1)

Returns

Vector4

RGBA vector4 (Caller should make a defensive copy)


packFloatToVec4

Static packFloatToVec4(float): Vector4

CPU version of geotoolkit3d.util.Shaders.SHADER_FLOAT_TO_VEC4;

Parameters

Name Type Description
floatnumberThe value contained in the range [0, 1) to be converted to a THREE.Vector4

Returns

Vector4

Normalized vector4 (Caller should make a defensive copy of the returned vector)


unpackRGBAToFloat

Static unpackRGBAToFloat(v4): number

Unpack a RGBA as a float value

See

Shaders.unpackVec4ToFloat

Parameters

Name Type Description
v4number[] | Vector4RGBA vector4 components should be contained in the range [0, 255]

Returns

number

The converted float value


unpackVec4ToFloat

Static unpackVec4ToFloat(vec4): number

Unpack a Vector4 as a float value

See

Shaders.packFloatToVec4

Parameters

Name Type Description
vec4Vector4RGBA vector4 components values should be contained in the range [0, 1)

Returns

number

The converted float value