Project

General

Profile

« Previous | Next » 

Revision baa3989b

Added by Leszek Koltunski almost 6 years ago

Revert last changes to the postprocessing FBO.

This reverts commit 2dbed690bdbee80d9bfb22c800073855eb5d0946.

View differences:

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

  
158 158
    DistortedRenderState.useStencilMark();
159 159

  
160
    DistortedFramebuffer buffer0 = (DistortedFramebuffer)buffers[mQualityLevel][0];
161
    DistortedFramebuffer buffer1 = (DistortedFramebuffer)buffers[mQualityLevel][1];
160
    DistortedFramebuffer buffer = (DistortedFramebuffer)buffers[mQualityLevel];
162 161

  
163
    float w= buffer0.getWidth();
164
    float h= buffer0.getHeight();
165
    float n= 1.0f - buffer0.getNear();
162
    buffer.setAsOutput();
166 163

  
167
    float corrW = buffer0.getWidthCorrection();
168
    float corrH = buffer0.getHeightCorrection();
164
    float w= buffer.getWidth();
165
    float h= buffer.getHeight();
166
    float n= 1.0f - buffer.getNear();
167

  
168
    float corrW = buffer.getWidthCorrection();
169
    float corrH = buffer.getHeightCorrection();
169 170
    float offsetCorrW = corrW/w;
170 171
    float offsetCorrH = corrH/h;
171 172

  
......
181 182
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]*offsetCorrW;
182 183

  
183 184
    mProgram1.useProgram();
184
    buffer1.setAsOutput();
185
    buffer0.setAsInput();
185
    buffer.bindForOutput(1);
186
    buffer.setAsInput(0);
186 187

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

  
204 205
    mProgram2.useProgram();
205
    buffer0.setAsOutput();
206
    buffer1.setAsInput();
206
    buffer.bindForOutput(0);
207
    buffer.setAsInput(1);
207 208

  
208 209
    GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT);
209 210

  

Also available in: Unified diff