Should XR off keywords be stripped?

I’m building a VR project using, URP, OpenXR for Quest. Using, “Single Pass Instance \ Multiview”,
this uses the keyword “STEREO_MULTIVIEW_ON” (the alternative is “STEREO_INSTANCING_ON”), but there seems to be no built in system to strip the variant with it off. Because of this, every single shader has all their variants doubled by this one keyword, the multiview_on and off variants. Stripping the variant with this off greatly reduces my shader variant count.

Is there any reason why I would not want to strip the variants without this keyword in a VR project? Wouldn’t it always want to be on for every shader since this is a VR project? Is this an oversight for Unity built-in stripping?

IIRC there are cases where rendering is happening without eye separation - this needs a different variant, so it’s intentional.

ah thanks. Let me further clarify. Specifically the off variant for lit shaders? Notoriously they have many variants.
Unless a user is doing custom rendering non-stereo in a VR project, what examples are there for a lit shader needing the stereo rendering off?

Exactly, I meant non-stereo rendering.
If the project is not using it, a custom stripping script to get rid of the variants is the right approach.

1 Like