-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
examples: volume cloud: add jittering to reduce sampling artefacts #20222
examples: volume cloud: add jittering to reduce sampling artefacts #20222
Conversation
@DavidPeicho Can you recommend GUI settings for which the sampling artifacts are particularly apparent -- and presumably, for which the jittering is particularly helpful? |
@WestLangley It's for reducing banding. He shared this on twitter: |
Yes, forgot to mention that. You can set the opacity to 1 for instance. This will give a fair amount of artefacts. Alternatively, you can also decrease the threshold to a lower value. |
Side note: jittering introduces randomness, and so is cache absolutely-not friendly. Using jittering is thus slightly slower. However, to obtain the equivalent quality to the jittering, you will need to increase the number of steps, degrading performance even more |
}, | ||
vertexShader, | ||
fragmentShader, | ||
side: THREE.BackSide, | ||
transparent: true | ||
} ); | ||
material.glslVersion = '300 es'; |
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.
Please use THREE.GLSL3
in this line.
@mrdoob Using this constant instead of adding the version qualifier in the shader code should also be done in webgl2_volume_perlin
.
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.
I'll clean it up 👌
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.
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.
Sorry, I was in holidays. Thanks for the cleanup!
Thanks! |
This PR modify the example
examples/webgl2_volume_cloud.html
:glsl
version to the material to be able to send defines to the shaderhttp://raw.githack.com/DavidPeicho/three.js/feature/volume-rendering-jittering/examples/webgl2_volume_cloud.html