-
Notifications
You must be signed in to change notification settings - Fork 842
Fix for issue with Default material not available when Models are imported at project startup. #345
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
Fix for issue with Default material not available when Models are imported at project startup. #345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work AFAIK.
com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.high-definition/Editor/DefaultScene/HDWizard.Configuration.cs
Outdated
Show resolved
Hide resolved
Thanks for this @Thomasch-unity3d . I have merged master and relaunched as all was red but not due to this PR. Question what are we donig with this PR: https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/5862 (Guess it is almost the same?) could you close it. THanks! |
Yes, Unity-Technologies/ScriptableRenderPipeline#5862 is the previous iteration, closed now. QA is in progress but I'd be great to have more from your team and there might be other issues that this fixes ( ie : I know there's a similar bug for speedTree in URP ). Thanks guys! |
And just to make sure, are you ok with " changes to the HDRenderPipelineEditorResources asset are not picked up until Unity is restarted." ? It's supposed to be read-only for users so I assume it's not a problem but should we document that ? |
I am adding our QA so they can check. @Thomasch-unity3d could you put a description about what you have tested and what workflow was failing before this PR. THanks (for @Unity-Technologies/gfx-qa-hdrp Thomas ios in Montreal timezone) |
One of the thing to pay attention is upgrade (between two version where we have added stuff in RPResources, this could be from 8.1.0 to latest 9.x-preview package (so this PR)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default material now applies correctly upon re-import
Tests done:
Upgrade path
- Create HDRP project from trunk (Vanilla), complete import and close
- Edit Package path to this PR
- Re-open
Result : Materials were seemed correct, no missing materials.
Preview thumbnails update require re-import
Note: I'm not a regular user of HDRP so this needs to be validated by owner team
Re-import assets with correct HRDP materials applied
- Set a model material import to None.
- Close project and delete Library
- Open project and validate material used by model
Result : Material used is HDRP
Add field in HDRenderPipelineEditorResources/MaterialResources
- Open \Runtime\RenderPipelineHDRenderPipelineEditorResources.cs
- Add Material field to MaterialResources and give it a .mat
- Reload
Result: Field is added and no error thrown - Close and delete Library
Result: Field is added, material is assigned and no error is thrown
Main purpose of PR is fulfilled and no side effect seems apparent.
Version: 2020.2.0a12.git.4668243
Revision: trunk 473b5360955a
Built: Wed, 06 May 2020 11:41:47 GMT
I also upgraded 2 project from HDRP 8.0.0 Unity 2020.1.a23 to this PR Unity 2020.2.a11 Visually there were no issues and no pink materials, however noticed a new minor issue. The yellow highlight stopped working that showcases which HDRP editor resources asset is used. See the video HDRP/staging (working) hdrp-editorResourcesAsset-loadAndForget (issue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
Thanks for the test pass, I'm not sure how to deal with that issue, that field is editable but any change in there is reverted when the editor is closed and restarted because HDRenderPipelineAsset always finds the HDRenderPipelineEditorResources.asset at a specific hardcoded path. |
@RSlysz any thought? thanks |
True... I haven't see this comming. In therm of memory management, the current Resource Asset is saved on the only occasion where it can be modified so it is good. In therm of loading issue, it seams to fix somewhat issue that was happening previously. So I can only see one way. As using this loading method was a workarround in the first place, I think that we should aim to reload with persistency some frame later. This way, the ping will be working again. |
…he asset on click.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please read
PR workflow guidelines
Checklist for PR maker
need-backport-*
label. After you backport the PR, the label changes tobackported-*
.CHANGELOG.md
file.Purpose of this PR
Fixes case 1141488 where Materials generated by the model importer fallback to the legacy default material rather than HDRP's default material.
The issue here is that HDRenderPipelineEditorResources fails to load using LoadAssetAtPath.
Using LoadSerializedFileAndForget succeeds but imples that changes to the HDRenderPipelineEditorResources asset are not picked up until Unity is restarted.
Testing status
Manual Tests: What did you do?
Automated Tests: What did you setup? (Add a screenshot or the reference image of the test please)
Yamato: (Select your branch):
https://yamato.prd.cds.internal.unity3d.com/jobs/902-Graphics
Any test projects to go with this to help reviewers?
Comments to reviewers
Notes for the reviewers you have assigned.