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

Unity 2022.1+ Support (Fixing Render Features) #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

imememani
Copy link

Updated the render features to support Unity 2022.1+
Screenshot_1

What changed?

Specificaly, this.

public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
       fogPass.Setup(renderer.cameraColorTarget); // <--- Borked.
       renderer.EnqueuePass(fogPass);
}

Should instead be:

#if UNITY_2022_1_OR_NEWER
        public override void SetupRenderPasses(ScriptableRenderer renderer, in RenderingData renderingData)
        { fogPass.Setup(renderer.cameraColorTargetHandle); }
#endif

        //ScripstableRendererFeature is an abstract class, you need this method
        public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
        {
#if !UNITY_2022_1_OR_NEWER
            fogPass.Setup(renderer.cameraColorTarget);
#endif

            renderer.EnqueuePass(fogPass);
        }

This will ensure previous versions still function the same while versions post 2022.1 use the updated format and variables.

Updated the render features to support Unity 2022.1+
@imememani imememani changed the title Unity 2022.1+ Support Unity 2022.1+ Support (Fixing Render Features) Apr 15, 2024
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

Successfully merging this pull request may close these issues.

1 participant