/** * Varying variables provide the interface between the vertex shaders, the fragment shaders, and the fixed * functionality between them. Vertex shaders will compute values per vertex (such as color, texture * coordinates, etc.) and write them to variables declared with the varying qualifier. A vertex shader may * also read varying variables, getting back the same values it has written. Reading a varying variable in a * vertex shader returns undefined values if it is read before being written. * * @param var A global shader variable * @param index The index for the shader variable. This number will appear suffixed in the final shader string. * @return */ protected ShaderVar addVarying(IGlobalShaderVar var, int index) { return addVarying(var.getVarString() + Integer.toString(index), var.getDataType()); }
/** * The attribute qualifier is used to declare variables that are passed to a vertex shader from OpenGL on a * per-vertex basis. It is an error to declare an attribute variable in any type of shader other than a vertex * shader. Attribute variables are read-only as far as the vertex shader is concerned. Values for attribute * variables are passed to a vertex shader through the OpenGL vertex API or as part of a vertex array. They * convey vertex attributes to the vertex shader and are expected to change on every vertex shader run. The * attribute qualifier can be used only with float, floating-point vectors, and matrices. Attribute variables * cannot be declared as arrays or structures. * * @param var A global shader variable * @return */ protected ShaderVar addAttribute(IGlobalShaderVar var) { return addAttribute(var.getVarString(), var.getDataType()); }
protected int getAttribLocation(int programHandle, IGlobalShaderVar var, int index) { return getAttribLocation(programHandle, var.getVarString() + Integer.toString(index)); }
/** * Add a uniform. The uniform qualifier is used to declare global variables whose values are the same across the entire * primitive being processed. All uniform variables are read-only and are initialized externally either at link * time or through the API. The link time initial value is either the value of the variable's initializer, if * present, or 0 if no initializer is present. Sampler types cannot have initializers. * * @param var A global shader variable * @param suffix A string that will appear suffixed in the final shader string. * @return */ protected ShaderVar addUniform(IGlobalShaderVar var, String suffix) { return addUniform(var.getVarString() + suffix, var.getDataType()); }
/** * Add a uniform. The uniform qualifier is used to declare global variables whose values are the same across the entire * primitive being processed. All uniform variables are read-only and are initialized externally either at link * time or through the API. The link time initial value is either the value of the variable's initializer, if * present, or 0 if no initializer is present. Sampler types cannot have initializers. * * @param var A global shader variable * @param index The index for the shader variable. This number will appear suffixed in the final shader string. * @return */ protected ShaderVar addUniform(IGlobalShaderVar var, int index) { return addUniform(var.getVarString() + Integer.toString(index), var.getDataType()); }
/** * Varying variables provide the interface between the vertex shaders, the fragment shaders, and the fixed * functionality between them. Vertex shaders will compute values per vertex (such as color, texture * coordinates, etc.) and write them to variables declared with the varying qualifier. A vertex shader may * also read varying variables, getting back the same values it has written. Reading a varying variable in a * vertex shader returns undefined values if it is read before being written. * * @param var A global shader variable * @param index The index for the shader variable. This number will appear suffixed in the final shader string. * @return */ protected ShaderVar addVarying(IGlobalShaderVar var, int index) { return addVarying(var.getVarString() + Integer.toString(index), var.getDataType()); }
public RFloat(IGlobalShaderVar var, int index) { super(DataType.FLOAT, var.getVarString() + Integer.toString(index)); }
protected int getUniformLocation(int programHandle, IGlobalShaderVar var, String suffix) { return getUniformLocation(programHandle, var.getVarString() + suffix); }
protected int getUniformLocation(int programHandle, IGlobalShaderVar var, int index) { return getUniformLocation(programHandle, var.getVarString() + Integer.toString(index)); }
/** * Add a uniform. The uniform qualifier is used to declare global variables whose values are the same across the entire * primitive being processed. All uniform variables are read-only and are initialized externally either at link * time or through the API. The link time initial value is either the value of the variable's initializer, if * present, or 0 if no initializer is present. Sampler types cannot have initializers. * * @param var A global shader variable. * @return */ protected ShaderVar addUniform(IGlobalShaderVar var) { return addUniform(var.getVarString(), var.getDataType()); }
protected int getAttribLocation(int programHandle, IGlobalShaderVar var) { return getAttribLocation(programHandle, var.getVarString()); }
protected int getUniformLocation(int programHandle, IGlobalShaderVar var) { return getUniformLocation(programHandle, var.getVarString()); }
/** * Returns a global. This can be a regular global but also a uniform, attribute, const or varying. * * @param var * @param index * @return */ public ShaderVar getGlobal(IGlobalShaderVar var, int index) { ShaderVar v = getInstanceForDataType(var.getVarString() + Integer.toString(index), var.getDataType()); v.mInitialized = true; return v; }
/** * Returns a global. This can be a regular global but also a uniform, attribute, const or varying. * * @param var * @return */ public ShaderVar getGlobal(IGlobalShaderVar var) { ShaderVar v = getInstanceForDataType(var.getVarString(), var.getDataType()); v.mInitialized = true; return v; }
/** * Adds a global variable * * @param var A global shader variable * @param index The index for the shader variable. This number will appear suffixed in the final shader string. * @return */ protected ShaderVar addGlobal(IGlobalShaderVar var, int index) { return addGlobal(var.getVarString() + Integer.toString(index), var.getDataType()); }
/** * Varying variables provide the interface between the vertex shaders, the fragment shaders, and the fixed * functionality between them. Vertex shaders will compute values per vertex (such as color, texture * coordinates, etc.) and write them to variables declared with the varying qualifier. A vertex shader may * also read varying variables, getting back the same values it has written. Reading a varying variable in a * vertex shader returns undefined values if it is read before being written. * * @param var * @return */ protected ShaderVar addVarying(IGlobalShaderVar var) { return addVarying(var.getVarString(), var.getDataType()); }
/** * Adds a global variable * * @param var A global shader variable * @return */ protected ShaderVar addGlobal(IGlobalShaderVar var) { return addGlobal(var.getVarString(), var.getDataType()); }
/** * The attribute qualifier is used to declare variables that are passed to a vertex shader from OpenGL on a * per-vertex basis. It is an error to declare an attribute variable in any type of shader other than a vertex * shader. Attribute variables are read-only as far as the vertex shader is concerned. Values for attribute * variables are passed to a vertex shader through the OpenGL vertex API or as part of a vertex array. They * convey vertex attributes to the vertex shader and are expected to change on every vertex shader run. The * attribute qualifier can be used only with float, floating-point vectors, and matrices. Attribute variables * cannot be declared as arrays or structures. * * @param var A global shader variable * @return */ protected ShaderVar addAttribute(IGlobalShaderVar var) { return addAttribute(var.getVarString(), var.getDataType()); }
protected int getUniformLocation(int programHandle, IGlobalShaderVar var) { return getUniformLocation(programHandle, var.getVarString()); }
/** * Add a uniform. The uniform qualifier is used to declare global variables whose values are the same across the entire * primitive being processed. All uniform variables are read-only and are initialized externally either at link * time or through the API. The link time initial value is either the value of the variable's initializer, if * present, or 0 if no initializer is present. Sampler types cannot have initializers. * * @param var A global shader variable * @param suffix A string that will appear suffixed in the final shader string. * @return */ protected ShaderVar addUniform(IGlobalShaderVar var, String suffix) { return addUniform(var.getVarString() + suffix, var.getDataType()); }