Package com.jme3.shader
Class ShaderUtils
java.lang.Object
com.jme3.shader.ShaderUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertToGLSL130
(String input, boolean isFrag) static int
getCardinality
(String type, String swizzling) return the cardinality of a type and a swizzle example : vec4 cardinality is 4 float cardinality is 1 vec4.xyz cardinality is 3.static boolean
isSwizzlable
(String type) returns true if a variable of the given type can have a swizzlestatic boolean
multiplicityMatch
(VariableMapping mapping) Check if a mapping is valid by checking the multiplicity of both of the variables if they are arraysstatic boolean
typesMatch
(VariableMapping mapping) Check if a mapping is valid by checking the types and swizzle of both of the variables
-
Method Details
-
convertToGLSL130
-
typesMatch
Check if a mapping is valid by checking the types and swizzle of both of the variables- Parameters:
mapping
- the mapping- Returns:
- true if this mapping is valid
-
multiplicityMatch
Check if a mapping is valid by checking the multiplicity of both of the variables if they are arrays- Parameters:
mapping
- the mapping- Returns:
- true if this mapping is valid
-
getCardinality
return the cardinality of a type and a swizzle example : vec4 cardinality is 4 float cardinality is 1 vec4.xyz cardinality is 3. sampler2D cardinality is 0- Parameters:
type
- the glsl typeswizzling
- the swizzling of a variable- Returns:
- the cardinality
-
isSwizzlable
returns true if a variable of the given type can have a swizzle- Parameters:
type
- the glsl type- Returns:
- true if a variable of the given type can have a swizzle
-