X Tutup
Skip to content

Made Importer create Material with Auto Queue Control. The user can override it if he wants.#866

Merged
hybridherbst merged 1 commit intoKhronosGroup:devfrom
XtroTheArctic:feature/865-AutoQueueControl
Jun 12, 2025
Merged

Made Importer create Material with Auto Queue Control. The user can override it if he wants.#866
hybridherbst merged 1 commit intoKhronosGroup:devfrom
XtroTheArctic:feature/865-AutoQueueControl

Conversation

@XtroTheArctic
Copy link
Contributor

This PR fixes the problem mentioned in #865

If you agree, the user should be able to receive a material from the importer with Queue Control set to "Auto". If he wants, he can extract the material and override the queue however he likes.

@hybridherbst
Copy link
Collaborator

Thanks! You’ll have to carefully test this PR against at least Unity 2021.3 and 6 in all three of URP, HDRP and BiRP. A lot of changes have happened in this codepath and at some point „-1“ was the correct value for „auto queue“.

You’ll also have to test runtime behavior – importing an opaque or transparent object at runtime needs to end up looking correctly.

@XtroTheArctic
Copy link
Contributor Author

It looks like UnityGLTF 2.16.1 is not compatible with Unity 2021.3.45 (Latest available version except Enterprise releases).

I'll continue testing on other Unity versions.

image

@XtroTheArctic
Copy link
Contributor Author

On 2022.3.62 BiRP:

Imported material's Queue Control isn't Auto without the fix and the material variant's Render Queue is Geometry even when it's changed to Transparent.
image

After the fix, both materials are good.
image

@XtroTheArctic
Copy link
Contributor Author

Runtime import of 2 models (transparent and opaque) on 2022.3.62 BiRP. Before the fix, rendering of transparent model is already wrong in built game. The fix doesn't make it any worse.

image

@XtroTheArctic
Copy link
Contributor Author

On 2022.3.62 URP (Same result as BiRP):

Imported material's Queue Control isn't Auto without the fix and the material variant's Render Queue is Geometry even when it's changed to Transparent.
image

After the fix, both materials are good.
image

@XtroTheArctic
Copy link
Contributor Author

Runtime import of 2 models (transparent and opaque) on 2022.3.62 URP (Same result as BiRP). Before the fix, rendering of transparent model is already wrong in built game. The fix doesn't make it any worse.
image

@XtroTheArctic
Copy link
Contributor Author

On 6000.0.32 URP (Same result as 2022 BiRP and 2022 URP):

Imported material's Queue Control isn't Auto without the fix and the material variant's Render Queue is Geometry even when it's changed to Transparent. (LOL. Material Variant creation is missing in Unity 6. I duplicated the imported material. What are these guys doing in Unity???)
image

After the fix, both materials are good.
image

@XtroTheArctic
Copy link
Contributor Author

Runtime import of 2 models (transparent and opaque) on 6000.0.32 URP (Same result as 2022 BiRP and 2022 URP). Before the fix, rendering of transparent model is already wrong in built game. The fix doesn't make it any worse.
image

@XtroTheArctic
Copy link
Contributor Author

Looks like UnityGLTF shader doesn't support HDRP on Unity 6 so I can't test on it.
image

@XtroTheArctic
Copy link
Contributor Author

@hybridherbst My tests are done.

Conclusion: my fix really fixes the imported material's Queue Control to be Auto.
It doesn't break anything that isn't broken before it.

Can you please check and merge when you have free time? Thank you.

P.S. All test projects are attached.
Test Projects.zip

@hybridherbst hybridherbst merged commit 582af27 into KhronosGroup:dev Jun 12, 2025
1 check passed
@XtroTheArctic XtroTheArctic deleted the feature/865-AutoQueueControl branch June 13, 2025 02:37
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.

2 participants

X Tutup