Search Unity

VR Single-Pass Stereo Rendering doesn't work with GlassRefraction Effect of Effects Package

Discussion in '5.4 Beta' started by betalulu, Jul 26, 2016.

  1. betalulu

    betalulu

    Joined:
    Apr 9, 2014
    Posts:
    10
    We are switching our rendering from 2 pass to single-pass stereo for better performance in VR.
    Everything works fine except the heathaze effect we apply on a particle which uses the GlassStainedBumpDistort.shader from Effects package.
    heathaze_bug.jpg

    I tried the UnityStereoScreenSpaceUVAdjust trick when accessing _GrabTexture in the shader code but it didn't work.

    Is there any workaround to solve the issue?

    Unity 5.4 f2
     
  2. scottb

    scottb

    Unity Technologies

    Joined:
    Jan 26, 2016
    Posts:
    13
    Just duplicate the shader and add this to the beginning of frag():

    #if UNITY_SINGLE_PASS_STEREO
    i.uvgrab.xy = TransformStereoScreenSpaceTex(i.uvgrab.xy, i.uvgrab.w);
    #endif
     
  3. Alex-Lian

    Alex-Lian

    Guest

    Note: Per scottb, that's the fix he has in flight into the Standard Assets. So, it'll likely arrive during a patch but this will get you through for now.
     
  4. betalulu

    betalulu

    Joined:
    Apr 9, 2014
    Posts:
    10
    Thank you for the quick responding!
    Works like a charm now.
     
unityunity