Project

General

Profile

« Previous | Next » 

Revision 0bd9f644

Added by Leszek Koltunski over 3 years ago

Introduce an UBO to the vertex shader holding info about mesh effect associations.

View differences:

src/main/java/org/distorted/library/effectqueue/EffectQueuePostprocess.java
56 56
  private static DistortedProgram mPreProgram;
57 57
  private static int mPreColorH;
58 58
  private static int mPreTextureH;
59
  private static int mPreProgramH;
59 60

  
60 61
///////////////////////////////////////////////////////////////////////////////////////////////////
61 62

  
......
139 140
      throw new RuntimeException(e.getMessage());
140 141
      }
141 142

  
142
    int preProgramH = mPreProgram.getProgramHandle();
143
    EffectQueueVertex.getUniforms( preProgramH,2 );
144
    EffectQueueMatrix.getUniforms( preProgramH,2 );
145
    MeshBase.getUniforms(preProgramH,2);
146
    mPreColorH  = GLES30.glGetUniformLocation( preProgramH, "u_Color"  );
147
    mPreTextureH= GLES30.glGetUniformLocation( preProgramH, "u_Texture");
143
    mPreProgramH = mPreProgram.getProgramHandle();
144
    EffectQueueVertex.getUniforms( mPreProgramH,2 );
145
    EffectQueueMatrix.getUniforms( mPreProgramH,2 );
146
    mPreColorH  = GLES30.glGetUniformLocation( mPreProgramH, "u_Color"  );
147
    mPreTextureH= GLES30.glGetUniformLocation( mPreProgramH, "u_Texture");
148 148
    }
149 149

  
150 150
///////////////////////////////////////////////////////////////////////////////////////////////////
......
181 181
    mPreProgram.useProgram();
182 182

  
183 183
    mesh.bindVertexAttribs(mPreProgram);
184
    mesh.send(2);
184
    mesh.send(mPreProgramH);
185 185

  
186 186
    EffectQueue[] queues = effects.getQueues();
187 187
    EffectQueueMatrix matrix = (EffectQueueMatrix)queues[0];

Also available in: Unified diff