Project

General

Profile

« Previous | Next » 

Revision 1d6d261e

Added by Leszek Koltunski almost 7 years ago

Move to a new way to detecting depth of postprocessing halos.
This switches off stenciling (hopefully temporarily!)

View differences:

src/main/java/org/distorted/library/DistortedRenderState.java
143 143
      }
144 144
    }
145 145

  
146
///////////////////////////////////////////////////////////////////////////////////////////////////
147

  
148
  static void switchOffDepthWriting()
149
    {
150
    if( cState.depthMask!=0 )
151
      {
152
      sState.depthMask = cState.depthMask;
153
      cState.depthMask = 0;
154
      GLES30.glDepthMask(false);
155
      }
156
    }
157

  
158
///////////////////////////////////////////////////////////////////////////////////////////////////
159

  
160
  static void restoreDepthWriting()
161
    {
162
    if( sState.depthMask!=cState.depthMask )
163
      {
164
      cState.depthMask = sState.depthMask;
165
      GLES30.glDepthMask(cState.depthMask==1);
166
      }
167
    }
168

  
146 169
///////////////////////////////////////////////////////////////////////////////////////////////////
147 170

  
148 171
  static void switchOffDrawing()
......
204 227
      //android.util.Log.d("State", "switch off color writing");
205 228
      GLES30.glColorMask(false,false,false,false);
206 229
      }
207
    if( cState.depthMask!=0 )
230
    if( cState.depthMask!=1 )
208 231
      {
209 232
      sState.depthMask = cState.depthMask;
210
      cState.depthMask = 0;
211
      //android.util.Log.d("State", "switch off depth writing");
212
      GLES30.glDepthMask(false);
233
      cState.depthMask = 1;
234
      //android.util.Log.d("State", "switch on depth writing");
235
      GLES30.glDepthMask(true);
213 236
      }
214 237
    if( cState.stencilMask!= STENCIL_MASK )
215 238
      {

Also available in: Unified diff