Project

General

Profile

« Previous | Next » 

Revision de77a6c5

Added by Leszek Koltunski over 3 years ago

Introduce another Uniform Block Object. Now we can have much more vertex and fragment effects - up their default number to 100.

View differences:

src/main/java/org/distorted/library/effectqueue/EffectQueueMatrix.java
35 35

  
36 36
  private static final int INDEX = EffectType.MATRIX.ordinal();
37 37

  
38
  private static float[] mMVPMatrix       = new float[16];
39
  private static float[] mModelViewMatrixP= new float[16];
40
  private static float[] mModelViewMatrixV= new float[16];
38
  private static final float[] mMVPMatrix       = new float[16];
39
  private static final float[] mModelViewMatrixP= new float[16];
40
  private static final float[] mModelViewMatrixV= new float[16];
41 41

  
42
  private static int[] mMVPMatrixH = new int[MAIN_VARIANTS];
43
  private static int[] mMVMatrixPH = new int[MAIN_VARIANTS];
44
  private static int[] mMVMatrixVH = new int[MAIN_VARIANTS];
42
  private static final int[] mMVPMatrixH = new int[MAIN_VARIANTS];
43
  private static final int[] mMVMatrixPH = new int[MAIN_VARIANTS];
44
  private static final int[] mMVMatrixVH = new int[MAIN_VARIANTS];
45 45

  
46 46
///////////////////////////////////////////////////////////////////////////////////////////////////
47 47
   
......
73 73
    if( currTime==mTime ) return;
74 74
    if( mTime==0 ) mTime = currTime;
75 75
    long step = (currTime-mTime);
76
    float[] array = mUBF.getBackingArray();
76 77

  
77 78
    for(int i=0; i<mNumEffects; i++)
78 79
      {
79
      if( mEffects[i].compute(mFloatUniforms, NUM_FLOAT_UNIFORMS*i, currTime, step) )
80
      if( mEffects[i].compute(array, NUM_FLOAT_UNIFORMS*i, currTime, step) )
80 81
        {
81 82
        EffectMessageSender.newMessage(mEffects[i]);
82 83
        }
......
114 115
    mModelViewMatrixV[14] = mModelViewMatrixP[14];
115 116
    mModelViewMatrixV[15] = mModelViewMatrixP[15];
116 117

  
118
    float[] array = mUBF.getBackingArray();
119

  
117 120
    // the 'Model' part of the MV matrix
118 121
    for(int i=mNumEffects-1; i>=0; i--)
119 122
      {
120
      ((MatrixEffect)mEffects[i]).apply(mModelViewMatrixP,mModelViewMatrixV,mFloatUniforms,i);
123
      ((MatrixEffect)mEffects[i]).apply(mModelViewMatrixP,mModelViewMatrixV,array,i);
121 124
      }
122 125

  
123 126
    // combined Model-View-Projection matrix

Also available in: Unified diff