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

Examples: webgl_postprocessing_hbao #27114

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Conversation

Rabbid76
Copy link
Contributor

@Rabbid76 Rabbid76 commented Nov 4, 2023

WebGL post processing example: HABO (Horizon Based Ambient Occlusion)

This contribution is funded by Rabbid76

examples/jsm/shaders/HBAOShader.js Fixed Show resolved Hide resolved
@Rabbid76 Rabbid76 force-pushed the examples/hbao branch 2 times, most recently from c3f403d to 3975a22 Compare November 4, 2023 20:55
@mrdoob mrdoob added this to the r159 milestone Nov 6, 2023
@mrdoob
Copy link
Owner

mrdoob commented Nov 6, 2023

Very nice!

@mrdoob mrdoob merged commit d962a78 into mrdoob:dev Nov 6, 2023
19 checks passed
@mrdoob
Copy link
Owner

mrdoob commented Nov 9, 2023

Hmm... Is this based on N8AO?

@Rabbid76
Copy link
Contributor Author

Hmm... Is this based on N8AO?

Sorry I didn't answer right away, but I didn't read your comment until now.
The basic idea is form realism-effects, since the algorithm there has some flaws, I did some more research and went the way of N8AO. I also took a closer look at the shaders https://github.com/nvpro-samples/gl_ssao/blob/master/hbao.frag.glsl and https://github.com/scanberg/hbao/blob/master/resources/shaders/hbao_frag.glsl. At the heart of these algorithms is something like dot(N, F) * fallOff.
Would you prefer a different algorithm for the example?

@N8python
Copy link
Contributor

You mean cosine weighting the hemisphere? If you are already cosine-weighting your samples, you don't need to cosine-weight the hemisphere.

@Rabbid76
Copy link
Contributor Author

Rabbid76 commented Nov 14, 2023

You mean cosine weighting the hemisphere? If you are already cosine-weighting your samples, you don't need to cosine-weight the hemisphere.

I see. So I should remove cosineSampleHemisphere and calculate the samples differently. I can do that.

See #27185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants