How to use polygonOffset solving Z-fighting poblems
See original GitHub issueI see that THREE.scene.overrideMaterial defines the polygonOffset parameters and THREE.WebGLRenderer calls glPolygonOffset(). but there are some errors when running
console.error( _gl.getShaderInfoLog( shader ) );
I use FireFox 16.0 and My code likes this:
var material1 = new THREE.Material();
material1.polygonOffset = true;
material1.depthTest = true;
material1.polygonOffsetFactor = 1;
material1.polygonOffsetUnits = 0.1;
_scene.overrideMaterial= material1;
How to use polygonOffset correctly.
Thanks,
Issue Analytics
- State:
- Created 11 years ago
- Reactions:3
- Comments:24 (18 by maintainers)
Top Results From Across the Web
Z fighting & polygon offset - threejs - Google Sites
OpenGL (and WebGL) has a simple solution for Z-fighting problems: polygon offset. It provides a facility to adjust the depth values of polygon...
Read more >How to solve Z-fighting - Graphics and GPU Programming
You need to offset exactly one of the two polygons, or they'll end up still having the same Z value. Cancel Save ...
Read more >three.js: What is more efficient to layer and resolve z-fighting
I have found two solutions that work for me. First: polygonOffset: true, polygonOffsetUnits: 1, polygonOffsetFactor: -rectCount. where rectCount ...
Read more >Avoiding z-fighting with coincident surfaces
One possible solution is to not use the Z-buffer at all. Rather you can use the Painter's Algorithm. Granted, this comes with all...
Read more >Sylvain Lesage on Twitter: "I just discovered "polygon offset ...
I just discovered "polygon offset" which solves Z-fighting. It's ~ like the z-index in CSS. Until now, I was manually moving the meshes, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@spite like this?
@kylebakerio See https://stackoverflow.com/questions/31539130/display-wireframe-and-solid-color/31541369#31541369.