-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
GridHelper: Removed colorCenterLine #21431
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
Conversation
grid2.material.depthFunc = THREE.AlwaysDepth;That overwrites existing objects in the scene. |
|
This problem did probably not become apparent since the editor's grid is rendered in a special way. |
|
I guess it would work if the |
Yes, the grid needs to be rendered first. Unfortunately As some point I had solved it like this: grid2.material.onBeforeCompile = function ( shader ) {
// Emulate GL_POLYGON_OFFSET_LINE
shader.vertexShader = shader.vertexShader.replace( '<worldpos_vertex>', '<worldpos_vertex>\ngl_Position.z -= 0.0001;' );
};But I opted for But yes, in this PR I was going to try updating the examples and notice the side-effects of the approach. What I know is that the current approach is a minefield. In VR those line intersections blink and it's very distracting... |
I think it's better to close the PR because of the mentioned issues. Seems we need a different approach to mitigate the blinking when grid lines intersect. At least there is a solution for the editor. |
Related issue: #21430
Description
After working on #21430 I now think that adding a
colorCenterLinetoGridHelperwas a mistake. The GPU render all lines at the same time and that produces z fighting glitches in the intersections.We can achieve something similar (and good looking) like this:
This is somewhat a breaking change.