diff options
author | Philip Jordan <[email protected]> | 2023-05-22 20:36:48 +1200 |
---|---|---|
committer | Philip Jordan <[email protected]> | 2023-05-22 20:36:48 +1200 |
commit | 75c877b2f5cb8e32916117ac5fc3e030e4999504 (patch) | |
tree | 0524f9ca4a34f6db376ef4f050b3eb67f2cd9e22 /src | |
parent | 4206940e877780de06d11d6cb686a30a22cad6d7 (diff) |
texture mask re-applied in joglpipeline
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java | 6 | ||||
-rw-r--r-- | src/main/java/org/jogamp/java3d/JoglPipeline.java | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java b/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java index 299f7c6..de03f1a 100644 --- a/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java +++ b/src/main/java/org/jogamp/java3d/Jogl2es2Pipeline.java @@ -9050,10 +9050,8 @@ class Jogl2es2Pipeline extends Jogl2es2DEPPipeline { gl.glTexParameterfv(GL.GL_TEXTURE_2D, GL2ES2.GL_TEXTURE_BORDER_COLOR, borderColor, 0); // make it into a shadow map sampler (this require 3d coords in the texture func in the shader - //gl.glTexParameteri(GL.GL_TEXTURE_2D, GL2ES2.GL_TEXTURE_COMPARE_MODE, GL2ES2.GL_COMPARE_REF_TO_TEXTURE); - //gl.glTexParameteri(GL.GL_TEXTURE_2D, GL2.GL_TEXTURE_COMPARE_FUNC, GL2.GL_GREATER); - - + gl.glTexParameteri(GL.GL_TEXTURE_2D, GL2ES2.GL_TEXTURE_COMPARE_MODE, GL2ES2.GL_COMPARE_REF_TO_TEXTURE); + gl.glTexParameteri(GL.GL_TEXTURE_2D, GL2.GL_TEXTURE_COMPARE_FUNC, GL2.GL_GREATER); //Generating the depth map shouldn't look too complicated. Because we only care about depth values we specify the texture's formats as GL_DEPTH_COMPONENT. //We also give the texture a width and height of 1024: this is the resolution of the depth map. //With the generated depth texture we can attach it as the framebuffer's depth buffer: diff --git a/src/main/java/org/jogamp/java3d/JoglPipeline.java b/src/main/java/org/jogamp/java3d/JoglPipeline.java index 7ecbfc6..8f1a903 100644 --- a/src/main/java/org/jogamp/java3d/JoglPipeline.java +++ b/src/main/java/org/jogamp/java3d/JoglPipeline.java @@ -7377,6 +7377,9 @@ void swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) { gl.glMatrixMode(GL2.GL_MODELVIEW); // Restore attributes gl.glPopAttrib(); + + // restore writing to the depth buffer + gl.glDepthMask(true); } |