Apply Standard renderQueue fix to Particle/Standard* shaders
closed
Lyuma
Unity 2018 now uses the Standard particle shaders by default (e.g.
Particles/Standard Unlit
), with transparency enabled by default using keyword _ALPHABLEND_ON/queue override. [edit: Particles/Standard Surface
is also affected]The shader does not specify a renderQueue, so it defaults to Geometry (2000). However, most blend settings require Transparent (3000) render queue.
As is widely known but not well documented, be it through a Unity bug or VRChat issue, either the upload or asset bundle load process resets all material renderQueue settings to From Shader. If done to Standard Particle shader, it would cause it to use alpha blending with queue 2000 which looks broken. See attached picture.
Just like Standard, it assigns keywords which can be used to detect the intended renderQueue after upload:
_ALPHABLEND_ON, _ALPHAPREMULTIPLY_ON and _ALPHAMODULATE_ON use Transparent (3000); _ALPHATEST_ON uses AlphaTest (2450)
Log In
Tupper - VRChat Head of Community
closed
Closing due to age. If this is still an issue, please create a new item in the relevant Feedback board!
Lyuma
I see people continuing to vote on this. This was already implemented in the Unity 2018 update. If you're having trouble with transparency, file a new issue
Tupper - VRChat Head of Community
Can you please provide an example world where this can be observed?
100の人
Tupper - VRChat Head of Community:
I uploaded the demo about the generic problem of custom render queue on VRChat.
The unitypackage of this world is here.
Juinamza
Tupper - VRChat Head of Community: The first picture is how it looks like in game.
The second picture is how it looks like in Unity Editor and how it should(I think) look like in game.
This is the link to the example world.
Juinamza
This is the same pictue as first one but with black-colored cubes, which make easier to find out what is the problem.
Lyuma
Tupper - VRChat Head of Community: Two people got here first, but I'll throw in my test world as well because why not.... it was uploaded in 2018 and shows that the problem also exists with the default material: https://www.vrchat.com/home/world/wrld_98dee37e-e0a2-4b4a-a545-7a8c96f9feb8
There are 5 cube buttons. (Separate from the two capsule buttons for Mirror and turning off shadows). Each cube button toggles a particle system.
Button 1 [on by default, sorry]: This is literally Right click -> Effect -> Particle System. No changes made aside from enabling cast and receive shadows. This is using the built-in Default-ParticleSystem material asset.
Button 2: Same but I copied properties from the default material onto a new material with Particle/Standard Unlit. This is to see if the builtin material and a user material are different.
Button 3: Same as button 2 but shader changed to Particle/Standard Surface.
Button 4: Same as button 2 but set to cutout. Not sure why this is useful but \o/
Button 5: Particle System with a Legacy/Particle/Alpha Blended shader, as a control.
One wall is transparent...the other two walls are opaque, and in the last direction you can see skybox.
Correct behavior: All particle systems should render either in front of or behind the transparent wall (due to sort order), and they should definitely render in front of the skybox, but you can see that doesn't work with Standard Unlit.
What happens instead: Particle systems 1, 2 and 3 don't show in front of the skybox or the transparent wall. They do show in front of opaque objects or opaque walls. Particle system 4 shows everywhere (technically on the wrong queue but "works") Particle system 5 (legacy) shows everywhere (it is visible behind the transparent wall but hard to see).
Lyuma
picture from above: first 4 buttons turned on. Only the cutout particles are visible over the skybox.
Tupper - VRChat Head of Community
tracked