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

Improved performance of Unreal Bloom example. #26356

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

keaukraine
Copy link
Contributor

@keaukraine keaukraine commented Jul 1, 2023

Implemented pre-calculated Gaussian coefficients in shader for Unreal Bloom example.

Related issue: None.

Description

I've noticed that fragment shader for blur calculates Gaussian coefficients which uses quite expensive math.
I moved these coefficients to a pre-computed uniform array which eliminated most of math in shader.
Additionally, simplified math for texture fetch - passing reciprocal of texture size instead of calculating it per fragment.

Visually there is no difference between the old and new shaders - math is kept intact, only offloaded from GPU to CPU.

Implemented pre-calculated Gaussian coefficients in shader.
@keaukraine keaukraine force-pushed the faster-unreal-bloom branch from 0c0ad32 to 11a01ca Compare July 1, 2023 09:41
@keaukraine keaukraine requested a review from LeviPesin July 4, 2023 20:02
@mrdoob mrdoob added this to the r155 milestone Jul 6, 2023
@mrdoob mrdoob merged commit f258d0d into mrdoob:dev Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants