googlevr / cardboard

Open source Cardboard SDK and samples
Other
1.49k stars 256 forks source link

Eye index is incorrect in shadergraph #357

Closed vakuor closed 2 years ago

vakuor commented 2 years ago

SPECIFIC ISSUE ENCOUNTERED

I try to use eyeIndex setting in ShaderGraph to render different colors of object for different eyes but it doesn't work. As far as I remember it worked in Unity 2019 on Android but due to IOS forced everybody use metal API I was unable to make a build on IOS. Now it looks like metal should work but this time I can't reproduce this functionality on Anroid in Unity3D 2021. Also i tried to change renderpath (instancing, multipass, singlepass) in playersettings via script (due to missing this option in editor settings) and it doesn't help.

SMARTPHONE:

STEPS TO REPRODUCE THE ISSUE

  1. Install Cardboard VR for Unity3D
  2. Install URP
  3. Use an eye index in shadergraph to render different object color for each eye (left should be blue, right should be red)
  4. Build and run
  5. See error

EXPECTED BEHAVIOR

Different colors of an object in different eyes

VERSIONS USED

Cardboard XR Plugin v1.16.0

If you are using Cardboard XR Plugin:

LINK TO A REPOSITORY WITH CODE TO REPRODUCE THE BUG

https://github.com/vakuor/cardboardstereoeye21

SCREENSHOTS

eyeindexscreen

vakuor commented 2 years ago

I figured out this issue. The eye index does not work only in URP. If you write in a regular shader, everything works correctly.