Fix postprocessing not working#312
Conversation
🦋 Changeset detectedLatest commit: c0cd84a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR 💥 An error occurred when fetching the changed packages and changesets in this PR |
| const originalRender = gl.render; | ||
| let isMounted = true; | ||
| gl.render = function (scene, camera, ...args) { | ||
| if (isMounted && activeState === "editor" && activeCamera) { |
There was a problem hiding this comment.
Ah interesting. This seems like hacks 😄 — what was happening without the fix? What was the thought process for fixing it this way?
There was a problem hiding this comment.
the original function that was here was manually calling gl render, which inherits the render pipeline that effect composer modifies, likely doing disabling autoclear for some effects, which is why when theres an effectcomposer the editor view just freezes
useFrame(({ gl, scene }) => {
if (activeCamera) {
gl.render(scene, activeCamera);
}
}, 1);
so instead of that my fix doesn't try to bypass the r3f render loop we just patch the camera in to be the editor camera
There was a problem hiding this comment.
Yeah interesting, smart idea! Lets send it. Will import the changes.
… force enable autoClear in editor mode to fix outline blending artifact, does not break postprocessing effects
|
@mommysgoodpuppy I've rebased and pushed to your remote so I can import this, merge commits don't work with the tooling. I'm going to add this behind a feature gate and add some comments, then merge. Edit: I've opened standard components and it doesn't seem to be working with them. Can you confirm? My guess is it's picking up the wrong |
|
Was given a suggestion maybe setting the current use frame to
I've updated an example to have postprocessing. Give it a whirl and let's figure this thing out 🙏 |
|
Great thanks will import this and send it, if there's edge cases that come up I'll turn the feature gate off and we can fix it. |
adeira-source-id: f61dd89 Co-authored-by: mommysgoodpuppy <theelectronicfreezer@gmail.com>
|
This has been merged and will go out in the next cut! Cheers @mommysgoodpuppy. Commit: f147379 |
Co-authored-by: mommysgoodpuppy <theelectronicfreezer@gmail.com>
fixes #299
Does create a rendering bug on selection outlines. There's a simpler fix without that but it would disable effects in editor view so I'd prefer this if the outlines can be fixed.Edit: fixed 👏