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

chore: URP update - replace obsolete RenderTargetHandle with new RTHandle #5562

Draft
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

pravusjif
Copy link
Member

@pravusjif pravusjif commented Aug 8, 2023

Note: this branch uses the project with Unity version 2022.3.6f1

  • Since URP 13 Unity marks RenderTargetHandle class as obsolete and commands to use RTHandle instead, but several things work differently with that new class. With Unity 2022.3.6, URP 14.0.8 is used.
  • I made a 15hs~ effort to try to convert the project RenderTargetHandle usages to the new RTHandle way and managed to avoid any runtime error but the outline screen effect (used for hovered avatars) is still not rendering anything...
  • Some basic and straightforward translations from the old system to the new one can be found in this forum post.
  • This PR was created from the test/perf-profiling-unity2022.3.4f1 branch so that it only contains the RTHandle file change replacements and is easily checked to continue this work in the future

Main problems found

  • If we use cmd.GetTemporaryRT() for some reason the target RTHandle doesn't get any render texture assigned (its .rt property is null), and later when trying to use Blit() with that RTHandle in runtime, we get a Value vannot be null fatal error due to the .rt property being null.
  • If we use RenderingUtils.ReAllocateIfNeeded() instead of cmd.GetTemporaryRT() (as Unity does in many replacements on their own PR) we get a render texture assigned to the .rt property (getting rid of the null error) but the Outline Screen Effect Feature still doesn't render the outline when hovering an avatar...

Useful links as guidelines to continue this migration in the future

@pravusjif pravusjif self-assigned this Aug 8, 2023
Base automatically changed from test/perf-profiling-unity2022.3.4f1 to dev August 29, 2023 10:22
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