Add UV Discarding to Quest Shaders
tracked
TrixxedHeart
In recent versions of Poiyomi, they've included a feature referred to as "UV Discarding" https://poiyomi.vercel.app/special-fx/uv-tile-discard
This allows users to use a secondary UV map on an avatar to put islands on specific parts of a tile grid and toggle their visibility. This allows one to use tremendously less meshes and materials in their avatars while offering a greater degree of customizability for their avatars.
Due to the nature of how at least Poiyomi's UV Discarding works (by default), it effectively prevents the discarded polys/UVs from being rendered at all, which in theory allows for a tremendous increase in performance statistics. (depending on how well such a feature would work on Android builds and there isn't some obscure Unity nonsense preventing it)
This would largely mitigate the current issue that plagues Quest where avatars are fairly limited in terms of ideal user customizability, resulting in many avatars people want to use being very poor, and thereby resulting in people showing nearly every very poor avatar they come across (when they really shouldn't) and ending up crashing.
Log In
TrixxedHeart
I can confirm that UV discarding works on Android and iOS by the way.
Since worlds can use custom shaders on mobile I set up a basic poiyomi shader with everything disabled except for UV discarding and put it into a world for testing as can be seen below (iOS recording).
UV discarding pls with a cherry on top.
Skyibis
Necro but I'd love to see this implemented! It would massively improve what I could do with my Quest avatars!
Scout - VRChat Head of Quality Assurance
tracked
HΛSH
Scout - VRChat Head of Quality Assurance: would it be possible to feed the discard data to PC fallback shaders as well?
Feilen
Unfortunately it appears UV Discarding makes use of alpha test, which is something we explicitly have to avoid on mobile. If there's a more predictable alternative I'm always down to look into it though!
TrixxedHeart
Feilen: While I'm not entirely sure what "alpha test" is, (I did try to google and look around before commenting) I think you're severely mistaken here and may have misread the original post. UV Discarding does not use any sort of "alpha" in it's rendering as it happens before shader fragmentation, which means no depth, no alpha, none of that sort, and if it does, that's only if it uses
pixel
rendering, which as you can see I said to not include multiple times, and that vertex rendering should only be used in this case for Quest.How it works is that it moves the verts to a null point and discards that from rendering. I believe this may provide some important helpful details for this.
I'm aware that it does make a note that it can effect the depth buffer in some circumstances, but that's obviously not your average case scenario.
Feilen
TrixxedHeart: ahhhh I'll have to see how that's impacted with tile rendering like on mobile, but that's promising!
TrixxedHeart
For better example: Attached I have an avatar I've recently made that only uses 3 materials and 3 skinned meshes, while having 5 different pieces, 4 of which can be mixed and matched to create new outfit combinations.
*(The 3rd skinned mesh is a coat that I could easily atlas to the rest of the mesh but that would have required me to redo many UVs and rebake 3 different textures, and I decided it was better for my sanity to not)
Largely though, this is effectively more optimized than having each outfit part be a new skinned mesh, which results in much less to be rendered as it takes much fewer draw calls, (4 when using any given outfit, +2 for the added coat, 6 draw calls at max)
whereas if I were to separate it into different skinned meshes to keep the outfit combos, it would end up being more(6 when using any given outfit, +2 for the added coat toggle, 8 draw calls at max), this is only accounting for a scene that has no real-time lighting and one camera.
I cannot do this on Quest as none of the mobile shaders contain such a feature and if I wanted my avatar to have this full system with the clothes. I would need to have each clothing piece separated, which would be completely unoptimized and is worse off for the Quest and would immediately land my avatar into very poor when it could've snugly fit into medium (given that I reduce polycount and texture memory)
Overall, it's a great idea for Quest and would help creators such as myself tremendously and make creators strive to create more optimized avatars that have just as many customizability and features with little cost of performance. (As long as it was using vertex to skip shader fragmentation, which ideally vertex would be the only option on Quest shaders)
(If I'm wrong about anything here, feel free to correct me)