Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messing with Z #3784

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/development/PointPrimitives.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
pixelSize : 5,
color : color,
outlineColor : outlineColor,
outlineWidth : 0,
outlineWidth : 1.0,
position : position
});
}
Expand Down
9 changes: 9 additions & 0 deletions Source/Shaders/PointPrimitiveCollectionFS.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#ifdef GL_EXT_frag_depth
#extension GL_EXT_frag_depth : enable
#endif

varying vec4 v_color;
varying vec4 v_outlineColor;
varying float v_innerPercent;
Expand All @@ -23,6 +27,11 @@ void main()
discard;
}

#ifdef GL_EXT_frag_depth
float z = gl_FragCoord.z;
gl_FragDepthEXT = z + ((1.0 - z) * (1.0 - wholeAlpha));
#endif

#ifdef RENDER_FOR_PICK
gl_FragColor = v_pickColor;
#else
Expand Down