Skip to content

Fix for LookDev displaying probes as pink spheres #1521

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

Merged
merged 4 commits into from
Sep 15, 2020

Conversation

FrancescoC-unity
Copy link
Contributor

Fix: https://fogbugz.unity3d.com/f/cases/1263428/

The issue was a bit deeper. The probes in the template scene have a mesh renderer component which however is always disabled and always hidden from editor. However, lookdev always toggle visibility of renderers of objects dragged into that, showing the faulty mesh renderer to render, even though it doesn't have a proper material.

Of course the expected result should be that probes don't render in lookdev (as they are not visible in game of course), but as a more generic fix for the issue, we toggle the visibility of renderers (and lights) only when the component in question is editable and visible in editor.

What have I tested: The repro case and some basic look dev workflow (adding stuff in it)

@github-actions
Copy link

github-actions bot commented Aug 5, 2020

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

Copy link
Contributor

@RSlysz RSlysz left a comment

Choose a reason for hiding this comment

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

Be sure it will not break AreaLight's EmissiveMesh
You can only check the HideInInspector maybe?

@@ -217,16 +217,28 @@ void SetGameObjectVisible(bool visible)
if (go == null || go.Equals(null))
continue;
foreach (UnityEngine.Renderer renderer in go.GetComponentsInChildren<UnityEngine.Renderer>())
renderer.enabled = visible;
{
if((renderer.hideFlags & HideFlags.HideInInspector) == 0 && ((renderer.hideFlags & HideFlags.NotEditable) == 0))
Copy link
Contributor

Choose a reason for hiding this comment

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

I expect issue if someone try to display a gameobject that have an AreaLight in its hierarchy:
the emissive mesh of AreaLight is NotEditable, which means with this conditional it will not be displayed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like it is actually displayed correctly if it is already visible, it just won't if it was set to invisble before (but I think that's correct?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also the mesh is not hidden in inspector, so it wouldn't trigger

@sebastienlagarde
Copy link
Contributor

Please provide update on this PR :)

@FrancescoC-unity
Copy link
Contributor Author

Please provide update on this PR :)

Was in vacation when comment was added, must have lost the email :) Checking today.

@RSlysz RSlysz self-requested a review September 9, 2020 10:44
Copy link
Contributor

@RSlysz RSlysz left a comment

Choose a reason for hiding this comment

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

Seams better now :)

@sebastienlagarde sebastienlagarde merged commit dc7ba99 into HDRP/staging Sep 15, 2020
@sebastienlagarde sebastienlagarde deleted the HDRP/fix-probe-appearing-in-look-dev branch September 15, 2020 10:34
@sebastienlagarde sebastienlagarde mentioned this pull request Sep 17, 2020
6 tasks
sebastienlagarde added a commit that referenced this pull request Nov 16, 2020
* Fix warning in HDAdditionalLightData OnValidate #885

* Fix XR multipass #1133

* Update Override-Micro-Shadows.md (#1236)

* Added disclaimer to volumes (#1247)

* Added missing volumes API toc entry (#1259)

* Fix XR Display providers not getting zNear and zFar updated on them. #1269

* Remove MSAA debug mode when renderpipeline asset has no MSAA #1289

* Added menu items doc

* Moved requirements in toc to make it consistent with URP/VFX #1352

* Fix compilation issue when XR is not available #1391

* Fix an issue with dynamic resolution handler in case no OnResolutionChange callback is defined #1403

* Change a multi compile to multi compile local to reduce number of keyword #1444

* Docs quality fixes #1445

* Added enable Volume snippet

* Update Volume-Override-Enable-Override.md

* Update HDCamera.cs

* Fix layer-related error caused by disabling emissive area light mesh #1506

* Make sure sun icon is not clipped in lookdev window #1515

* Fix for LookDev displaying probes as pink spheres #1521

* Fix issue with disc area light editor not updating #1526

* Fixed an issue where only one of the two lookdev views would update when changing the default lookdev volume profile. #1529

* Hdrp/update decal atlas when texture changes #1532

* Fix Screen position out of view frustum issues when planar reflection probe is at same camera location #1537

* Make sure diffusion profile is correct upon its editor reset #1538

* Added propagating nans doc (#1562)

* Added propagating nans doc

* Added information about HDRP's NanTracker

* GFXGI-237: Force update for static skies when camera type is set to S… #1570

* Hdrp/docs/shader additions #1580

* Added information about HDRP not upgrading particle shaders (#1601)

* Added information about HDRP not upgrading particle shaders

* Update Upgrading-To-HDRP.md

* Update Upgrading-To-HDRP.md

* Changed cog to gear to adhere to style guide rules #1611

* Added build settings setup (#1631)

* Fixing the remapping of Min/Max parametrizations values to Amplitude parametrizations values

* Updating UI to match documentation of LayeredLit

* Hdrp/fix/terrain layer parametrization #1678

Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com>
Co-authored-by: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com>
Co-authored-by: JordanL8 <lewis.jordan@hotmail.co.uk>
Co-authored-by: robinb-u3d <robinb-u3d@users.noreply.github.com>
Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com>
Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com>
Co-authored-by: JulienIgnace-Unity <julien@unity3d.com>
Co-authored-by: Ben Spencer <github@raytracing.co.uk>
Co-authored-by: Jean-Philippe Grenier <jeanphilippe@unity3d.com>
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.

3 participants