Skip to content

Commit

Permalink
Added depth test in Direct node
Browse files Browse the repository at this point in the history
  • Loading branch information
husker-dev committed May 11, 2022
1 parent da3d589 commit 28263b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class JOGLDirect: JOGLFXCanvas() {
if(needTextureRepaint) {
needTextureRepaint = false

val texGr = texture.createGraphics()
texGr.isDepthBuffer = true
texGr.isDepthTest = true
texGr.clear()

JOGLUtils.rawGL(gl) {
if (gl !is GL2)
return@rawGL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class LWJGLDirect: LWJGLCanvas() {
if(needTextureRepaint) {
needTextureRepaint = false

val texGr = texture.createGraphics()
texGr.isDepthBuffer = true
texGr.isDepthTest = true
texGr.clear()

LWJGLUtils.rawGL {
glBindFramebuffer(GL_FRAMEBUFFER, textureFBO)
glViewport(0, 0, scaledWidth.toInt(), scaledHeight.toInt())
Expand Down

0 comments on commit 28263b0

Please sign in to comment.