Skip to content

Conversation

arttu-peltonen
Copy link
Contributor

@arttu-peltonen arttu-peltonen commented Aug 27, 2021

EDIT: See Update for new screenshots

Purpose of this PR

As described by case 1342315, wireframe mode is not supported on some platforms and graphics APIs (at least Android GLES). This is a limitation with no easy fix, and Unity has not supported wireframes on these platforms in the past (see mention in docs).

Therefore, on these platforms, we display a warning that wireframe might not work. The capability is not exposed to C# so this is the best we can do right now, in the absence of a new C# API.

A note of this behavior should also be added to the documentation when that is written (cc @oleks-k).

Editor:
image
image

Runtime:
image
image


Testing status

Checked that the message apppears as expected on Windows Vulkan, but not when I switch to Windows DX11.

@evelinastaniulyte are you able to verify if wireframe works correctly on iOS? The bug only mentions Android but I'd like to verify iOS too (both Metal and GLES, if we still support that).

@arttu-peltonen arttu-peltonen marked this pull request as ready for review August 27, 2021 10:54
@arttu-peltonen arttu-peltonen requested review from a team as code owners August 27, 2021 10:54
@github-actions
Copy link

github-actions bot commented Aug 27, 2021

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://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/.yamato%252Fall-hdrp.yml%2523PR_HDRP_trunk

URP
/.yamato%252Fall-urp.yml%2523PR_URP_trunk

SRP Core
You could run ABV on your branch before merging your PR, but it will start A LOT of jobs. Please be responsible about it and run it only when you feel the PR is ready:
/.yamato%252F_abv.yml%2523all_project_ci_trunk
Be aware that any modifications to the Core package impacts everyone in the Graphics repo so please discuss the PR with your lead.

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.

Copy link
Contributor

@phi-lira phi-lira left a comment

Choose a reason for hiding this comment

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

LGTM. It's missing changelog and I have one question about the way we check for platforms but pre-approving it as I will be OoO next week and don't want to block this one.

nameAndTooltip = Strings.WireframeNotSupportedWarning,
isHiddenCallback = () =>
{
switch (SystemInfo.graphicsDeviceType)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should also get the the graphics APIs in the build settings, that way user might know that when he builds player to some of the platforms the runtime debug might not work? f.ex similar case here: https://sourcegraph.com/github.com/Unity-Technologies/Graphics/-/blob/com.unity.render-pipelines.universal/Editor/RendererFeatures/DecalRendererFeatureEditor.cs?L74-77

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. I believe Editor itself only runs on platforms that support wireframe rendering, so build target platform is more relevant when user sees this warning in the editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up doing something a bit different here. Instead of looking at build targets, I only show this warning in player builds. AFAIK this is never needed in the editor, only Android Vulkan/GLES have this problem. I think it's better that way you only really care about this information when you are using the debug feature on the device where it might not work correctly.

Copy link
Contributor

@oleks-k oleks-k left a comment

Choose a reason for hiding this comment

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

Approving with the edit.

@arttupeltonen
Copy link

Regarding Felipe's comment on changelog, I don't believe one is needed because rendering debugger is a new feature on URP.

@ernestasKupciunas ernestasKupciunas self-requested a review August 30, 2021 09:00
Copy link

@ernestasKupciunas ernestasKupciunas left a comment

Choose a reason for hiding this comment

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

Approving without testing. Good job with the PR description, all the images, and testing status!
Code seems to be relatively straightforward and shouldn't cause any issues on the URP side.
This PR will be tested manually on mobiles by other QA.

Copy link

@evelinastaniulyte evelinastaniulyte left a comment

Choose a reason for hiding this comment

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

The warning message is hardly noticeable since missing contrast in the UI. It looks like plain text.
The warning text could be set to orange color, or at least the "Warning" word could be colored or bolded.

@arttu-peltonen
Copy link
Contributor Author

The warning message is hardly noticeable since missing contrast in the UI. It looks like plain text.
The warning text could be set to orange color, or at least the "Warning" word could be colored or bolded.

@TheoWong-pixel what do you think? Might make sense, though the warning message will still look a bit clunky. Might be worth adding better support for warning labels such as this one...

@TheoWong-pixel
Copy link

TheoWong-pixel commented Aug 31, 2021

Yeah this one should be an Info box. and the tooltip should be the message inside. :)

its fine for the runtime one, maybe if we can underline it, that would be a bonus. but for the in editor one, it should be an info box.

@arttu-peltonen arttu-peltonen requested review from evelinastaniulyte and removed request for evelinastaniulyte September 1, 2021 08:09
@arttu-peltonen
Copy link
Contributor Author

Update

  • Added new DebugUI.MessageBox widget type to allow displaying info/warning/error style messages.

    • Ideally, this kind of UI would be tied into the widgets themselves but with current architecture I thought it easier to just make them separate widgets, and control their visibility as usual using isHiddenCallback.
    • Editor
      image
    • Runtime
      image
  • Using the new MessageBox warning for the "wireframe may not be supported" message. It is only shown in player builds (Android is the only known platform to not support this).
    image

  • Added a new warning "Debug shaders missing" to clarify situations where user opens the debug UI and most modes are seemingly broken.

    • URP
      image
    • HDRP
      image
    • Warning is only visible in player builds because shaders aren't stripped in the editor.
    • Warning is not shown on "Display Stats", "Volume" or "Camera" tabs, because they don't require debug shaders.

@arttu-peltonen arttu-peltonen changed the title Add warning on Vulkan and GLES that wireframe may not be supported. Add new warning UI for missing debug shaders and wireframe support. Sep 7, 2021
@arttu-peltonen arttu-peltonen requested review from evelinastaniulyte and removed request for evelinastaniulyte September 7, 2021 13:28
@arttu-peltonen arttu-peltonen requested a review from a team September 13, 2021 05:51
Copy link
Contributor

@oleks-k oleks-k left a comment

Choose a reason for hiding this comment

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

Looks good.

Copy link

@ernestasKupciunas ernestasKupciunas left a comment

Choose a reason for hiding this comment

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

Looks good. Warnings are clear and informative enough. Manually tested using URP Template scene on mobiles.

Copy link

@evelinastaniulyte evelinastaniulyte left a comment

Choose a reason for hiding this comment

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

Looks good to me. Warnings are informative and the orange info box attracts attention, so I see no issues from UI/UX perspective.

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.

9 participants