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

EffectComposer doesn't play nicely with drei/View #165

Open
tarabishy2020 opened this issue Dec 5, 2022 · 8 comments
Open

EffectComposer doesn't play nicely with drei/View #165

tarabishy2020 opened this issue Dec 5, 2022 · 8 comments

Comments

@tarabishy2020
Copy link

Whenever Effects are placed as part of a View, nothing is rendered properly.

https://codesandbox.io/s/view-skissor-forked-g84lwh?file=/src/App.js

@ThimoDEV
Copy link

ThimoDEV commented May 7, 2023

Did someone find a solution to make this work?

@denkravchu
Copy link

Faced the same problem.

@ghost
Copy link

ghost commented Aug 24, 2023

Me too.

@denkravchu
Copy link

denkravchu commented Aug 24, 2023

Me too.

Partable solution.

I have not yet figured out how to use the EffectComposer if you overlay two scenes on top of each other, because the alpha channel is lost. However, if an alpha channel is not required, the best solution i found would be to make your own view component and use the THREEJS effectComposer inside it, like in this example https://codesandbox.io/s/r3f-hud-forked-z625d2?file=/src/index.js (just add there threejs scissors and ull get what u need).

Also i tried using EffectComposer from postprocessing library, sometimes it works sometimes it doesn’t, but it’s also quite possible to set it up for a specific situation by playing in the priority for rendering.

I'll post again if Ill find a better solution.

@ynamite
Copy link

ynamite commented Sep 25, 2024

Any updates on this? The codesandbox from @denkravchu is gone, sadly

@timmevandermeer
Copy link

Have solved this similarly to @denkravchu, by forking View and using a EffectComposer in there (in the Container component) in stead of the regular renderer (on this line https://github.com/pmndrs/drei/blob/71864076c35c3b4f201cd9518da873eff7dc90a1/src/web/View.tsx#L138)

@ynamite
Copy link

ynamite commented Sep 25, 2024

@timmevandermeer thanks a lot!
When you say EffectComposer, do you mean EffectComposer from @react-three/postprocessing or effectComposer from three JS postprocessing? Either way, some example code would help a lot. I'm a bit new to this.

@ynamite
Copy link

ynamite commented Oct 3, 2024

Now EffectComposer is working with the original View.tsx from Drei. It requires a wrapper that basically takes over EffectComposer rendering and renders a contents view to a texture to handle transparency:
https://codesandbox.io/p/sandbox/twilight-browser-7235jd

Some more info here: pmndrs/drei#1413
It requires a slightly modified EffectComposer, due to a bug mentioned here: #285

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

No branches or pull requests

5 participants