Class ShaderUtils

java.lang.Object
com.jme3.shader.ShaderUtils

public class ShaderUtils extends Object
  • Method Details

    • convertToGLSL130

      public static String convertToGLSL130(String input, boolean isFrag)
    • typesMatch

      public static boolean typesMatch(VariableMapping mapping)
      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

      public static boolean multiplicityMatch(VariableMapping mapping)
      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

      public 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. sampler2D cardinality is 0
      Parameters:
      type - the glsl type
      swizzling - the swizzling of a variable
      Returns:
      the cardinality
    • isSwizzlable

      public static boolean isSwizzlable(String type)
      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