org.rajawali3d.materials.shaders

Package org.rajawali3d.materials.shaders

Types

AShader

abstract class AShader : AShaderBase
abstract class AShader : AShaderBase

This class is a wrapper class for shader creation. GLSL shaders are text files that are compiled at runtime. The GLSL language is based on C. This class is like a mini framework that lets you write shaders in Java. The main reason for this is maintainability and code reuse. The lack of operator overloading makes this slightly verbose however. Instead of writing this in GLSL:


  myVar *= myOtherVar;
  
You'll have to write this:

  myVar.assignAdd(myOtherVar);
  
GLSL data types are wrapped into their own classes. Because most of the data type names are reserved keywords in Java they are prefixed with 'R'. For instance:

AShaderBase

abstract class AShaderBase
abstract class AShaderBase

This abstract class defines all the data types that are used in a shader. The data types reflect the data types that are used in GLSL. Because most of the data type names are reserved keywords in Java they are prefixed with 'R'. For instance:

FragmentShader

open class FragmentShader : AShader
open class FragmentShader : AShader

IShaderFragment

interface IShaderFragment
interface IShaderFragment

VertexShader

open class VertexShader : AShader
open class VertexShader : AShader