Add a dithering shader to quest-enabled shaders, to simulate transparency on mobile.
Hokage
Dithering (or screendoor transparency) has been long-used as a cheaper mobile-friendly way to render see-through objects, because it's just rendering less of the pixels overall, in a specific pattern to fake the effect. Unlike normal transparency, it does not re-draw (or overdraw) any overlapping geometry because it's using a screenspace mapping, so if it overlaps it'll just render any pixel once, and I can't imagine it's any more expensive than the toon shader is. Here is an example video showing off what dither transparency looks like in unity: https://youtu.be/VG-Ux8RHMoA
Log In
Silent
The Qualcomm Snapdragon 835 and Qualcomm Snapdragon XR2 chipsets (used by Oculus Quest and Quest 2, respectively) use tiled rendering. Tiled renderers break the screen up into tiles and render them sequentially. For each tile, they use a fast, small cache for the reads and writes until the final value for each pixel is computed. That value will then be stored into RAM for future consumption.
Why does this matter for dithering? Well, it comes down to the depth buffer. The depth buffer is how modern GPUs sort the pixels of opaque objects, and handle intersections of transparent objects with opaque objects. For each pixel of an opaque object that's rendered, a depth is also stored. When another object renders if the depth stored for each is closer to the camera than the object about to be rendered, it skips rendering those pixels. This cuts down on overdraw (rendering of the same pixel multiple times).
Many mobile GPUs (including the Quest GPUs) use a form of in-hardware tiled deferred rendering, which uses a depth only pre-pass to accelerate rendering. Doing a depth pre-pass entirely removes any chance of overdraw for opaque objects, which is especially useful for complex objects or intersections. Being able to skip the fragment shader during this pre-pass speeds things up significantly.
However, the depth buffer itself is usually in a compressed/optimized format that makes assumptions about all depth data being a constant plane across an entire triangle. When using a cutout shader, those optimizations are disabled. This makes the object more expensive to render, and all objects rendered after more expensive to render too. (This happens on the PC as well, but PC GPUs are so fast that it's not such a big deal.) To my understanding, on Quest, the data for each tile being rendered is invalidated when drawing a cutout surface. This is why cutout is more expensive than alpha transparency, and it also means that dithering is awful on Quest performance.
For a counter comparison, consider the PS1. It has no depth buffer, so each triangle was sorted by the CPU and rendered one-at-a-time like sprites. Because of this, it didn't matter whether a triangle was solid or not, so they happily used clipping and dithering and whatever else. Alpha blending/true transparency was possible, but expensive, and thus was generally avoided. But this is the opposite of how the Quest's GPU works, and in fact transparency will run better than cutout.
S
ShinyScalesVR
In addition to this, there is more to the choice between dithering and blending than simple performance considerations.
Handing alpha-transparency in an engine is
complex
, not necessarily slow
. Dithering enables would-be transparent objects to be treated as opaque and use common modern techniques such as screen-space lighting and decals—techniques VRChat doesn't use.mjcox24
Your video says it needs a scriptable renderer, vrchat uses the built in render system that is not scriptable.
X3417
It feels like its such a good and obvious idea. I hope it is just that the Developers happened to not think about this for their VRC Mobile shaders, and not that there was a key problem with it for Quest Avatars.
Kazy
Honestly just a Cutout method would appease me.
Hokage
Kazy: According to the other post asking for transparency shaders, cutout is, at least on quest, somehow "more expensive" than transparency. I'm hoping dithering is not as expensive, because it's been used in even console release games to keep up performance.
mjcox24
Hokage: Dithering requires cutout transparency
only reason 2D consoles use it is becase sprites had transparency built in, 3D Dithering is just a waste as it needs cutout when real transparency is cheaper.
Hokage
mjcox24: I have seen many many 3D consoles use it, for instance super mario odyssey, sekiro, and other games that want to save performance due to their hardware limits.
mjcox24
Hokage: I can promise you that Super Mario odyssey has real transparency all over it uses it on the edge of grass, the mecha broodle and that effect is only used as a stylistic choise.