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

Issue with post-processing #2

Open
rage2050a opened this issue Sep 22, 2024 · 3 comments
Open

Issue with post-processing #2

rage2050a opened this issue Sep 22, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@rage2050a
Copy link

Hi, I'm learning ScriptableRenderPass and this repository is a great material.
I'd really like to integrate this rendering technique to my game.

But I have a problem when I turned on Volume of Post-process Volume in the Demo scene.
(I also made Vignette --> Intensity to a large value so we can see the difference clearly)

image

When the distortion is used with post-process, we see the border of the distortion object, even at the position where it is not distorting its background. It looks as though the distortion object is making its background brighter.

I opened the Frame Debugger to investigate.

The 47th event, the _CameraColorTexture is as shown below:
image

The 73th event, _AfterPostProcessTexture is as follows:
image

The 75th event, _AfterPostProcessTexture is as follows:
image

It looks like the border color of the distortion objects come from _CameraColorTexture which is before applying post-process. It is no wonder as the injection point of the feature is set to BeforeRenderingPostProcessing and the DistortionPass.cs takes cameraData.renderer.cameraColorTarget as its source.

I tried various combination of Injection Point of the Distortion Feature and Event of Distortion Render Objects, but didn't get the expected result -- I'd like (1)the transparent red cube is rendered and nicely distorted (2)color of the pixels are post-processed after distortion.

Could you please suggest something so that the distortion works well with post-processing?

@lukakldiashvili
Copy link
Owner

Hi, thank you for expressing your interest and opening the issue. After a little bit of tinkering, the way I got it working is by enabling "Native RenderPass" and adding new injection point for Distortion Texture (AfterRenderingTransparents).

Here is the settings:
image

I wish I could elaborate more about the solution, but I do not have time to look into it right now. Hope this helps you to continue your research and I will be happy to see and read your findings, if any.

@lukakldiashvili lukakldiashvili self-assigned this Sep 24, 2024
@lukakldiashvili lukakldiashvili added the bug Something isn't working label Sep 24, 2024
@rage2050a
Copy link
Author

Thank you for the reply. I think I've done what you suggest, but it doesn't work. The distortion objects are all painted black with the setting. (Using Unity 2023)

image

Hmm... I don't know why it doesn't work. Your setting look correct to me -- blitting the full screen texture just after rendering transparent objects, and render the distortion objects using the texture before post-processing.

Well, probably my game (https://x.com/NekoBeko2024) doesn't necessarily need post-processing that changes color. I'll keep the previous version of the distortion effect.

Anyway, thank for your time.

@lukakldiashvili
Copy link
Owner

No problem. Could be the issue with the version of URP, I'll try it with newer versions of Unity sometime later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants