Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
fancyfennec's avatar
fancyfennec
Explorer
9 years ago

Oculus gaze pointer issues - disappears behind objects

Hi,

I'm trying to recreate the gaze pointer tutorial you can find here:

https://developer.oculus.com/blog/unitys-ui-system-in-vr/

If I use their project and create my own scene, I can reproduce the gaze pointer and it is behaving normally. But if I start with a blank project, and recreate the exercise, the gaze pointer disappears behind other objects. I must've tried a dozen different ways to do it, still getting the same results.

I compressed my Unity scene and uploaded it. I would be eternally grateful if someone could take a look at it and tell me what I'm doing wrong. I've been trying to figure it out and it's driving me nuts. I already posted this in the Unity forums but so far, no answer yet.

Link to scene here:

https://www.dropbox.com/sh/jhd8tqs2cv74up3/AABCs57QnGkzryMk8hC9ve4Ta?dl=0

Thank you, your help is greatly appreciated.

Using Unity 5.4 beta and Oculus, Windows 10

6 Replies

Replies have been turned off for this discussion
  • Thanks for finding this.  It's a bug in the shader code. You can fix it by finding "Assets\Shaders\Particle Alpha Blend-AfterTrans.shader" and deleting the following lines:

    #ifdef SOFTPARTICLES_ON
    o.projPos = ComputeScreenPos (o.vertex);
    COMPUTE_EYEDEPTH(o.projPos.z);
    #endif

    and:

    #ifdef SOFTPARTICLES_ON
    float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
    float partZ = i.projPos.z;
    float fade = saturate (_InvFade * (sceneZ-partZ));
    i.color.a *= fade;
    #endif
  • Hi, sometimes this error pops up: "output parameter 'o' not completely initialized" from the same shader. Do you have any idea what that could be? Thanks
  • Deleting the softparticle from the vertex structure should fix this.  I.e. remove the lines:
    #ifdef SOFTPARTICLES_ON
    float4 projPos : TEXCOORD1;
    #endif
  • JDavidL's avatar
    JDavidL
    Honored Guest
    Hi! this is the first time I write in the forum. The reason is a similar problem: The Gaze pointer in my scene some times is behind the objects and some time is in front of them, depending on the Z position when intersects the object collider... or it seems to be something like that... My issue is that i am not using the "Particle Alpha Blend-AfterTrans.shader" at all... 
    I'm using Unity 5.3.5 and OVR utilities 1.6.0 and some scripts of the OculusSampleFrameworkProject.
    I really appreciate some help!

  • Hi,
    I tried this solution proposed by @andyborrel and it doesn't work.
    Is there other thing to do?