Revision 580f7d10
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/DistortedNode.java | ||
---|---|---|
236 | 236 |
|
237 | 237 |
mData.mFBO.setAsOutput(); |
238 | 238 |
|
239 |
DistortedRenderState.colorDepthOn(); |
|
240 |
|
|
239 | 241 |
GLES30.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); |
240 | 242 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT); |
241 | 243 |
|
244 |
android.util.Log.e("NODE", "clearing DEPTH buffer of FBO "); |
|
245 |
|
|
242 | 246 |
if( mSurface.setAsInput() ) |
243 | 247 |
{ |
244 | 248 |
numRenders++; |
src/main/java/org/distorted/library/DistortedRenderState.java | ||
---|---|---|
105 | 105 |
sStencilOpDppass = -1; |
106 | 106 |
} |
107 | 107 |
|
108 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
109 |
|
|
110 |
static void colorDepthOn() |
|
111 |
{ |
|
112 |
if( sColorMaskR!=1 || sColorMaskG!=1 || sColorMaskB!=1 || sColorMaskA!=1 ) |
|
113 |
{ |
|
114 |
sColorMaskR = 1; |
|
115 |
sColorMaskG = 1; |
|
116 |
sColorMaskB = 1; |
|
117 |
sColorMaskA = 1; |
|
118 |
GLES30.glColorMask(true,true,true,true); |
|
119 |
} |
|
120 |
if( sDepthMask!=1 ) |
|
121 |
{ |
|
122 |
sDepthMask = 1; |
|
123 |
GLES30.glDepthMask(true); |
|
124 |
} |
|
125 |
} |
|
126 |
|
|
108 | 127 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
109 | 128 |
|
110 | 129 |
void apply() |
... | ... | |
145 | 164 |
{ |
146 | 165 |
sDepthMask = mDepthMask; |
147 | 166 |
GLES30.glDepthMask(sDepthMask==1); |
167 |
|
|
168 |
android.util.Log.e("STATE","switching depth mask to "+(sDepthMask==1)); |
|
148 | 169 |
} |
149 | 170 |
|
150 | 171 |
// 4. Enable Blending? |
Also available in: Unified diff
Bugfix: we need to have DepthMask and ColorMask both fully on when clearing the FBO in Nodes!