Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
121 stars 2 forks source link

blur material bluring objects in front of it. #1900

Open Redd56 opened 2 months ago

Redd56 commented 2 months ago

Describe the bug?

the blur material as is, is a pretty nice material but it has a shortcoming ive noticed. That being how being a side effect of how it renders. The way it currently seems to work (haven't looked directly into it but deducing based on the way it looks in game) is that once the entire scene is rendered the blur material then comes in and blurs things indiscriminately of if they are between the camera and blur material or behind the blurmaterial, then replacing the things in front of it afterwords. This causes a weird effect where edges of object in front of a blur material object (say you put your hand arms distance away to see it, or an inspector right in front of the blur materialed object) get blurred. Al thought not very noticeable with close to you objects like hands or close inspectors, it is still noticeable. and only gets more noticeable the farther from the blur material you are and the closer the object in front of it is.

Now i know it wouldn't be easy but it should be possible to rework blur to not have this issue. The solution is simple yet complex, draw things behind the blur material mesh first, then blur them, then lastly draw everything in front of the blur material. That way we preserve all of the blur data behind the object while at the same time preventing objects (like inspectors or a hand for instance) from bluring when not being viewed through a blur material.

To Reproduce

View blur material with something in front of it.

Expected behavior

Not to blur the edges of objects between the camera and the mesh with blur material applied.

Screenshots

image

Additional Context

there isnt really any solutions ive tried to this as there isnt anything i can think that would solve this short a custom mess of camera bologna and blur materials behind the player and stuff like that, that could possibly solve the issue

Reporters

Redd56

others have noticed but no one has been bothered by it really

Redd56 commented 2 months ago

assigning @Geenz since i was told he is the shader guy

ohzee00 commented 2 months ago

I'm having a bit of a time understanding this issue but is it related or similar to the effect found here? https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1614

Geenz commented 2 months ago

Inherent side effect of how the blur material works for now. It's unlikely this will be fixed until Sauce is implemented (see #1401)

Redd56 commented 2 months ago

yeah hence why its both simple but complex, since it would need to be rewritten to take into account objects in front of it.

Redd56 commented 2 months ago

I'm having a bit of a time understanding this issue but is it related or similar to the effect found here? #1614

no. completely diffrerent