I am developing my own Unity XR plugin but I’m having trouble getting the Multiview (Singlepass) feature to work.
After inspecting the shaders by compiling and showing the code, I discovered that Unity is not using the STEREO_MULTIVIEW_ON keyword to compile them. However, the Oculus XR Plugin does use this keyword to compile my shaders.
I’m confused as to why STEREO_MULTIVIEW_ON is being stripped in my implementation.
hi, c0d3_m0nk3y, my device support the multi view extension, and if I import package of OculusXR and not check it (still use my own Unity XR Plugin), then the shader would be compiled with the keyword STEREO_MULTIVIEW_ON. I would finally get what I want.
By the way, how to disable shader variant stripping?
hi, c0d3_m0nk3y.
In the graphics options, I have disabled shader variant stripping, by choose option “Strip Unused” or “Keep All” in the Shader Stripping → Instancing Variants. It still doesn’t work.
I guess maybe Unity should be “told” now it is in XR mode then can he choose to use the relative keywords for compiling shaders. However, how to tell Unity this.
That’s very much possible if you are developing your own XR plugin. Maybe you can look at the source code of the XR package in the Library directory and find out how the package is doing it.