Revision 75f95f8d
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/main/DistortedFramebuffer.java | ||
---|---|---|
101 | 101 |
// OpenGL ES 3.0.5 spec, chapter 4.4.2.4 : |
102 | 102 |
// "Note that the texture image is specifically not detached from any other framebuffer objects. |
103 | 103 |
// Detaching the texture image from any other framebuffer objects is the responsibility of the application." |
104 |
GLES30.glBindFramebuffer(GLES30.GL_FRAMEBUFFER, mFBOH[0]); |
|
105 |
GLES30.glFramebufferTexture2D(GLES30.GL_FRAMEBUFFER, GLES30.GL_DEPTH_ATTACHMENT , GLES30.GL_TEXTURE_2D, 0, 0); |
|
104 | 106 |
GLES30.glFramebufferTexture2D(GLES30.GL_FRAMEBUFFER, GLES30.GL_DEPTH_STENCIL_ATTACHMENT, GLES30.GL_TEXTURE_2D, 0, 0); |
107 |
GLES30.glBindFramebuffer(GLES30.GL_FRAMEBUFFER, 0); |
|
108 |
|
|
105 | 109 |
GLES30.glDeleteTextures(1, mDepthStencilH, 0); |
106 | 110 |
mDepthStencilH[0]=0; |
107 | 111 |
} |
src/main/java/org/distorted/library/main/DistortedRenderState.java | ||
---|---|---|
94 | 94 |
|
95 | 95 |
static void reset() |
96 | 96 |
{ |
97 |
cState.colorMaskR = -1; |
|
98 |
cState.colorMaskG = -1; |
|
99 |
cState.colorMaskB = -1; |
|
100 |
cState.colorMaskA = -1; |
|
101 |
|
|
102 |
cState.depthTest = -1; |
|
103 |
cState.depthMask = -1; |
|
104 |
cState.depthFunc = -1; |
|
105 |
|
|
106 |
cState.blend = -1; |
|
107 |
cState.blendSrc = -1; |
|
108 |
cState.blendDst = -1; |
|
109 |
|
|
110 |
cState.stencilTest = -1; |
|
111 |
cState.stencilMask = -1; |
|
112 |
cState.stencilFuncFunc = -1; |
|
113 |
cState.stencilFuncRef = -1; |
|
114 |
cState.stencilFuncMask = -1; |
|
115 |
cState.stencilOpSfail = -1; |
|
116 |
cState.stencilOpDpfail = -1; |
|
117 |
cState.stencilOpDppass = -1; |
|
118 |
/* |
|
119 | 97 |
cState.colorMaskR = 1; |
120 | 98 |
cState.colorMaskG = 1; |
121 | 99 |
cState.colorMaskB = 1; |
... | ... | |
145 | 123 |
cState.blendDst = GLES30.GL_ONE_MINUS_SRC_ALPHA; |
146 | 124 |
GLES30.glEnable(GLES30.GL_BLEND); |
147 | 125 |
GLES30.glBlendFunc(cState.blendSrc,cState.blendDst); |
148 |
*/ |
|
149 | 126 |
} |
150 | 127 |
|
151 | 128 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
187 | 164 |
|
188 | 165 |
static void colorDepthStencilRestore() |
189 | 166 |
{ |
190 |
/* |
|
191 | 167 |
if( sState.colorMaskR!=cState.colorMaskR || sState.colorMaskG!=cState.colorMaskG || sState.colorMaskB!=cState.colorMaskB || sState.colorMaskA!=cState.colorMaskA) |
192 | 168 |
{ |
193 | 169 |
cState.colorMaskR = sState.colorMaskR; |
... | ... | |
206 | 182 |
cState.stencilMask = sState.stencilMask; |
207 | 183 |
GLES30.glStencilMask(cState.stencilMask); |
208 | 184 |
} |
209 |
*/ |
|
210 | 185 |
} |
211 | 186 |
|
212 | 187 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
1) Fix for the last fix in Framebuffer
2) in RenderState, reset everything to a known state (rather than mark as unknown)