keijiro / KlakSpout

Spout plugin for Unity
The Unlicense
651 stars 97 forks source link

Shader Hidden/Spout/Blit does not compile when using stereo instancing #68

Closed JohnENoonan closed 3 years ago

JohnENoonan commented 3 years ago

Hello! I'm using Unity 2021.2.0a15.2125 and the built in renderer. I have stereo rendering enabled for my project which can be viewed in VR or on a normal PC display. When creating a build I receive the following errors

Shader error in 'Hidden/Spout/Blit': Output variable vert_yflip contains a system-interpreted value (SV_RenderTargetArrayIndex) which must be written in every execution path of the shader.  Unconditional initialization may help. at line 19 (on d3d11)

Compiling Vertex program with STEREO_INSTANCING_ON
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
Disabled keywords: UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30

Using spout receiver still works in the Editor. This issue may be related to a similar issue found here but note I am using the built in renderer, not HDRP.

Please let me know if this is a limitation and I should not use instanced stereo. Thanks for everything!

keijiro commented 3 years ago

I guess that appdata_img is causing this issue. It's probably solved by rewriting the vertex/fragment shaders not to use appdata_img.

keijiro commented 3 years ago

Fixed in 2.0.0