-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Improve webgl2_multisampled_renderbuffers example.
#26005
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
| container = document.getElementById( 'container' ); | ||
|
|
||
| camera = new THREE.PerspectiveCamera( 45, container.offsetWidth / container.offsetHeight, 1, 2000 ); | ||
| camera = new THREE.PerspectiveCamera( 45, container.offsetWidth / container.offsetHeight, 10, 2000 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous version has z-fighting issues, depending on the seed.
| color: 0xee0808, | ||
| polygonOffset: true, | ||
| polygonOffsetFactor: 1, // positive value pushes polygon further away | ||
| polygonOffsetUnits: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This improves the render of the wireframe.
| const material2 = new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe: true } ); | ||
|
|
||
| for ( let i = 0; i < 10; i ++ ) { | ||
| for ( let i = 0; i < 50; i ++ ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More to look at :-)
| // | ||
|
|
||
| const gui = new GUI(); | ||
| gui.add( params, 'animate' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Animation was obfuscating rendering issues. Allow animation to be disabled.
| group.rotation.y += clock.getDelta() * 0.1; | ||
| if ( params.animate ) { | ||
|
|
||
| group.rotation.y += 0.002; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove clock so a restarted animation continues where it left off -- and does not jump.
webgl2_multisampled_renderbuffers example.
Somewhat subjective. Suggestions welcome.