Project

General

Profile

« Previous | Next » 

Revision 270c27bc

Added by Leszek Koltunski almost 7 years ago

Progress with Stencils in postprocessing.

View differences:

src/main/java/org/distorted/library/DistortedOutputSurface.java
80 80
  private float mClearDepth;
81 81
  private int mClearStencil;
82 82
  private int mClear;
83

  
84
//private String sNew="", sOld="";
85

  
86 83
  float mMipmap;
87 84

  
88 85
///////////////////////////////////////////////////////////////////////////////////////////////////
......
171 168
    DistortedEffectsPostprocess lastP=null, currP;
172 169
    long lastB=0, currB;
173 170

  
174
//sNew = "";
175

  
176 171
    for(int i=0; i<num; i++)
177 172
      {
178 173
      child = children.get(i);
179 174
      currP = child.getEffectsPostprocess();
180 175
      currB = currP==null ? 0 : currP.getBucket();
181 176

  
182
//sNew += currB;
183

  
184 177
      if( lastB!=currB && lastB!=0 )
185 178
        {
186 179
        numRenders += lastP.postprocess(time,this);
......
204 197
            mBuffer1[j].glClear(GLES30.GL_COLOR_BUFFER_BIT|GLES30.GL_DEPTH_BUFFER_BIT|GLES30.GL_STENCIL_BUFFER_BIT);
205 198
            mipmap *= EffectQuality.MULTIPLIER;
206 199
            }
207
          DistortedObject.toDo();  // create immediately
200
          DistortedObject.toDo(); // create the FBOs immediately. This is safe as we must be holding the OpenGL context now.
208 201
          }
209 202

  
210
        numRenders += child.draw(time,mBuffer1[currP.getQuality()]);
203
        numRenders += child.markStencilAndDraw(time,mBuffer1[currP.getQuality()],20);
211 204

  
212 205
        if( i==num-1 )
213 206
          {
......
218 211
      lastP = currP;
219 212
      lastB = currB;
220 213
      }
221
/*
222
if( !sNew.equals(sOld) )
223
  {
224
  sOld = sNew;
225
  android.util.Log.e("surface", "Surface"+getID()+": "+sOld);
226
  }
227
*/
214

  
228 215
    return numRenders;
229 216
    }
230 217

  

Also available in: Unified diff