Project

General

Profile

« Previous | Next » 

Revision 977756d7

Added by Leszek Koltunski almost 6 years ago

Fix the bug where the postprocessed GLOW halo of a Cube would be of different colors depending on the order of rendring of the cube sides. (one needed to switch off BLENDing while preprocessing )

View differences:

src/main/java/org/distorted/library/main/DistortedRenderState.java
184 184
      }
185 185
    }
186 186

  
187
///////////////////////////////////////////////////////////////////////////////////////////////////
188

  
189
  static void disableBlending()
190
    {
191
    sState.blend = cState.blend;
192

  
193
    if (cState.blend != 0)
194
      {
195
      cState.blend = 0;
196
      GLES31.glDisable(GLES31.GL_BLEND);
197
      }
198
    }
199

  
200
///////////////////////////////////////////////////////////////////////////////////////////////////
201

  
202
  static void restoreBlending()
203
    {
204
    if (sState.blend != cState.blend)
205
      {
206
      cState.blend = sState.blend;
207

  
208
      if (cState.blend == 0)
209
        {
210
        GLES31.glDisable(GLES31.GL_BLEND);
211
        }
212
      else
213
        {
214
        GLES31.glEnable(GLES31.GL_BLEND);
215
        }
216
      }
217
    }
218

  
187 219
///////////////////////////////////////////////////////////////////////////////////////////////////
188 220

  
189 221
  static void enableDepthTest()
src/main/java/org/distorted/library/main/EffectQueuePostprocess.java
170 170
      float halfZ = halfW*mesh.getZFactor();
171 171

  
172 172
      DistortedRenderState.setUpStencilMark(mA!=0.0f);
173
      DistortedRenderState.disableBlending();
173 174

  
174 175
      GLES31.glViewport(0, 0, buffer.mWidth, buffer.mHeight );
175 176

  
......
187 188

  
188 189
      GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, mesh.getNumVertices() );
189 190

  
191
      DistortedRenderState.restoreBlending();
190 192
      DistortedRenderState.unsetUpStencilMark();
191 193

  
192 194
      return 1;

Also available in: Unified diff