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

[WIP] Implement distance fade and transparency #50654

Closed

Conversation

reduz
Copy link
Member

@reduz reduz commented Jul 20, 2021

  • ALPHA in shader comes pre-set with a distance fade. Multiply by it if you want fade to work.
  • Added transparency and distance fade for clustered renderer.
    (will add support in mobile renderer after it works).

Currently this does nothing, this PR is intended to be continued by @JFonS.

* ALPHA in shader comes pre-set with a distance fade. Multiply by it if you want fade to work.
* Added transparency and distance fade for clustered renderer.
(will add support in mobile renderer after it works).

Currently this does nothing, this PR is intended to be continued by @JFonS.
@reduz reduz requested a review from a team as a code owner July 20, 2021 18:19
@reduz reduz changed the title Implement distance fade and transparency [WIP] Implement distance fade and transparency Jul 20, 2021
@Calinou
Copy link
Member

Calinou commented Jul 20, 2021

For the dithering part, remember that interleaved gradient noise could be used to have a cheaper and better-looking effect.

Copy link
Contributor

@JFonS JFonS left a comment

Choose a reason for hiding this comment

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

Looks good.

@reduz
Copy link
Member Author

reduz commented Jul 20, 2021

@Calinou I will add a render mode to make alpha use dithered noise and remain opaque so, if you want objects to fade this way, you can also. Afterwards will remove all the distance fade code from StandardMaterial.

@reduz reduz marked this pull request as draft July 20, 2021 20:26
@Calinou
Copy link
Member

Calinou commented Jul 20, 2021

Afterwards will remove all the distance fade code from StandardMaterial.

StandardMaterial3D distance fade can still be used to fade objects that are close to the camera (e.g. third-person character or light flares), so I'd keep it for that reason at least.

Adding a render mode to make all kinds of alpha use dithering is a good idea, especially for things like vegetation or grates when you don't want them to use a slower transparent pipeline.

@Calinou
Copy link
Member

Calinou commented Oct 25, 2021

Superseded by #54222.

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

Successfully merging this pull request may close these issues.

4 participants