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

Addons: Add LensflareNode. #29715

Merged
merged 6 commits into from
Oct 21, 2024
Merged

Addons: Add LensflareNode. #29715

merged 6 commits into from
Oct 21, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Oct 21, 2024

Related issue: -

Description

This PR adds an alternative way to add lens flares to a scene.

The existing Lensflare and LensflareMesh modules use chained sprites to implement a basic flare effect. This is great but a more advanced approach can be achieved by using post processing. This particular implementation uses the output of bloom to generate flares in the scene. The coupling of bloom and lens flare produces a more natural and plausible look.

There are various implementations on the web for implementing FX lens flares. This one uses a vary basic approach based on Chapman's work (linked in the code). The result is already nice but hopefully LensflareNode can be improved/enhanced over time.

@Mugen87 Mugen87 added this to the r170 milestone Oct 21, 2024
@Mugen87 Mugen87 merged commit 167c022 into mrdoob:dev Oct 21, 2024
11 checks passed
downSampleRatio = 4
} = params;

this.ghostTint = ghostTint;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use ghostTint externally?

const flare = flarePass.mul( color( 0xffffff ) )

Copy link
Collaborator Author

@Mugen87 Mugen87 Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to keep it internally for potential upcoming features. The tint is then processed in a way that produces different results than modulating the entire pass.

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.

2 participants