File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
src/Interface/Modules/Render/ES/systems Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -171,12 +171,22 @@ class RenderBasicSys :
171171
172172 geom.front ().attribs .bind ();
173173
174+ bool depthMask = glIsEnabled (GL_DEPTH_WRITEMASK);
175+ bool cullFace = glIsEnabled (GL_CULL_FACE);
176+ bool blend = glIsEnabled (GL_BLEND);
177+
174178 // Disable zwrite if we are rendering a transparent object.
175179 if (srstate.front ().state .get (RenderState::USE_TRANSPARENCY))
176180 {
177181 GL (glDepthMask (GL_FALSE));
178- GL (glDisable (GL_CULL_FACE));
182+ // GL(glDisable(GL_CULL_FACE));
179183 }
184+ else
185+ {
186+ GL (glDepthMask (GL_TRUE));
187+ GL (glDisable (GL_CULL_FACE));
188+ GL (glDisable (GL_BLEND));
189+ }
180190
181191 if (rlist.size () > 0 )
182192 {
@@ -296,6 +306,18 @@ class RenderBasicSys :
296306 GL (glDepthMask (GL_TRUE));
297307 GL (glEnable (GL_CULL_FACE));
298308 }
309+ else
310+ {
311+ GL (glDepthMask (depthMask));
312+ if (cullFace)
313+ {
314+ GL (glEnable (GL_CULL_FACE));
315+ }
316+ if (blend)
317+ {
318+ GL (glEnable (GL_BLEND));
319+ }
320+ }
299321
300322 geom.front ().attribs .unbind ();
301323
You can’t perform that action at this time.
0 commit comments