Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public enum ShaderType

  1. Object
  2. Enum<ShaderType>
  3. ShaderType

ImplementsComparable<ShaderType>

The value type of a ShaderNode. Every shading language the backends target has these four, so a graph typed with them prints the same way on all of them.

Enum constants

FLOATOne float.
VEC2Two floats.
VEC3Three floats: a position, a direction or a colour.
VEC4Four floats: a colour with alpha, or a sampled texel.

Methods

public static ShaderType[] values()
public static ShaderType valueOf(String name)
public int getComponents()Returns the number of float components, 1 to 4.
public static ShaderType ofComponents(int n)Returns the type with the given number of components.

Inherited methods

Enum constant details

FLOAT

FLOAT
One float.

VEC2

VEC2
Two floats.

VEC3

VEC3
Three floats: a position, a direction or a colour.

VEC4

VEC4
Four floats: a colour with alpha, or a sampled texel.

Method details

values

public static ShaderType[] values()

valueOf

public static ShaderType valueOf(String name)

getComponents

public int getComponents()
Returns the number of float components, 1 to 4.

Returns

the component count

ofComponents

public static ShaderType ofComponents(int n)
Returns the type with the given number of components.

Parameters

n int
1 to 4

Returns

the matching type