Skip to content

Conversation

kennytann
Copy link
Contributor

@kennytann kennytann commented Nov 16, 2021


Purpose of this PR

Why is this PR needed, what hard problem is it solving/fixing?

There are users that are using pixel perfect camera with 3d renderer and are unable to do so since we added a restriction with 2d renderer only. Added a warning for users to know that certain features will not be supported, and remove restriction from using in SRP.

Also expose RenderPipelineConverter to 2d pixel perfect package to create URP Pixel Perfect Converter in this changelist
https://github.cds.internal.unity3d.com/unity/2d/pull/1514


Testing status

Describe what manual/automated tests were performed for this PR

Tested on 2022.1.0a16
Open 3D URP Template scene.
Add a Pixel Perfect Camera component to the Main Camera.
Observe warning message.
Access to use Pixel Perfect Camera component is allowed.

Screenshot 2021-11-22 103532

Go to Project Settings -> Graphics -> Scriptable Render Pipeline Settings and remove Renderer Asset.
Observe error message on Pixel Perfect Camera component.

Screenshot 2021-11-22 103427

Create a 2D Renderer and 2D Renderer Asset
Go to Project Settings -> Graphics -> Scriptable Render Pipeline Settings and add the 2D Renderer Asset.
Observe no error or warning messages on component


Comments to reviewers

Notes for the reviewers you have assigned.

@kennytann kennytann requested a review from unity-cchu November 16, 2021 03:37
@kennytann kennytann self-assigned this Nov 16, 2021
@kennytann kennytann requested review from a team as code owners November 16, 2021 03:37
@github-actions
Copy link

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

URP
/jobDefinition/.yamato%252Fall-urp.yml%2523PR_URP_trunk
With changes to URP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

@github-actions
Copy link

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

@kennytann kennytann requested a review from a team as a code owner November 16, 2021 14:05
@kennytann kennytann changed the title Add override button for users that want to use pixel perfect cam with other renderers [SRP] Add override button for users that want to use pixel perfect cam with other renderers Nov 16, 2021
@kennytann kennytann changed the title [SRP] Add override button for users that want to use pixel perfect cam with other renderers [SRP] Add warning for users that want to use pixel perfect cam with other renderers Nov 22, 2021
@BoonKiangTan
Copy link

Fix verified on branch:

2022.1.0a16.2319
Revision: trunk 603c2cfd9276
Built: Thu, 18 Nov 2021 13:40:26 GMT
Package branch: 2d/pixel-perfect-cam-override (a827e50)

  • Verified using Universal Renderer asset, warning message appears on Pixel Perfect component and component fields can be edited
    Unity_MsaWugAm52

  • Verified when not using Renderer asset, error message appears on Pixel Perfect component and component fields cannot be edited
    Unity_iaDoPz1pgV

  • Verified base functionality of Pixel Perfect component with 2D Renderer still works as intended
    image

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("PPv2URPConverters")]
[assembly: InternalsVisibleTo("Unity.2D.PixelPerfect.Editor")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which internal API do you need access?

Copy link
Contributor Author

@kennytann kennytann Nov 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RenderPipelineConverter class. Made a new converter for 2D to URP Pixel Perfect Camera it so it will be a part of the Upgrade 2D (URP) Assets in the Render Pipeline Converter. See https://github.cds.internal.unity3d.com/unity/2d/pull/1514 (not sure if you have access)

@kennytann kennytann merged commit 4ca204c into master Nov 26, 2021
@kennytann kennytann deleted the 2d/pixel-perfect-cam-override branch November 26, 2021 02:36
sebastienlagarde added a commit that referenced this pull request Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants