Project

General

Profile

« Previous | Next » 

Revision 5f7e4f2c

Added by Leszek Koltunski almost 6 years ago

Hide the FBO_QUEUE thing inside the library. The queue is running internally now, without public setAsOutputFBO() thing (simplifies writing postprocess effects)

View differences:

src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
141 141
 *
142 142
 * @y.exclude
143 143
 */
144
  public int apply(float[] uniforms, int index, DistortedOutputSurface[] buffers, int fbo)
144
  public int apply(float[] uniforms, int index, DistortedOutputSurface[] buffers)
145 145
    {
146 146
    if( mProgram1 ==null)
147 147
      {
......
160 160

  
161 161
    DistortedFramebuffer buffer = (DistortedFramebuffer)buffers[mQualityLevel];
162 162

  
163
    buffer.setAsOutputFBO(fbo);
163
    buffer.setAsOutput();
164 164

  
165 165
    float w= buffer.getWidth();
166 166
    float h= buffer.getHeight();
......
183 183
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]*offsetCorrW;
184 184

  
185 185
    mProgram1.useProgram();
186
    buffer.bindForOutput(2*fbo+1);
187
    buffer.setAsInput(2*fbo);
186
    buffer.bindForOutput(1);
187
    buffer.setAsInput(0);
188 188

  
189 189
    GLES31.glColorMask(true,true,true,true);
190 190
    GLES31.glClearColor(1.0f,1.0f,1.0f,0.0f);
......
204 204
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]*offsetCorrH;
205 205

  
206 206
    mProgram2.useProgram();
207
    buffer.bindForOutput(2*fbo);
208
    buffer.setAsInput(2*fbo+1);
207
    buffer.bindForOutput(0);
208
    buffer.setAsInput(1);
209 209

  
210 210
    GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT);
211 211

  

Also available in: Unified diff