예제 #1
0
 // mat4
 protected T setParams(Parameter param, Matrix4 value) {
   if (!programBegan) {
     programBegan = true;
     program.begin();
   }
   program.setUniformMatrix(param.mnemonic(), value);
   return (T) this;
 }
예제 #2
0
  // float[], vec2[], vec3[], vec4[]
  protected T setParamv(Parameter param, float[] values, int offset, int length) {
    program.begin();

    switch (param.arrayElementSize()) {
      case 4:
        program.setUniform4fv(param.mnemonic(), values, offset, length);
        break;
      case 3:
        program.setUniform3fv(param.mnemonic(), values, offset, length);
        break;
      case 2:
        program.setUniform2fv(param.mnemonic(), values, offset, length);
        break;
      default:
      case 1:
        program.setUniform1fv(param.mnemonic(), values, offset, length);
        break;
    }

    program.end();
    return (T) this;
  }
예제 #3
0
 // mat3
 protected T setParam(Parameter param, Matrix3 value) {
   program.begin();
   program.setUniformMatrix(param.mnemonic(), value);
   program.end();
   return (T) this;
 }
예제 #4
0
 // vec3
 protected void setParam(Parameter param, Vector3 value) {
   program.begin();
   program.setUniformf(param.mnemonic(), value);
   program.end();
 }