Skip to main content
Participant
May 23, 2016

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
    This topic has been closed for replies.

    6 replies

    Inspiring
    May 23, 2016
    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
    Participant
    May 24, 2016
    Thank you!
    Participant
    May 26, 2016
    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
    Inspiring
    June 8, 2016
    Deleting the softparticle from the vertex structure should fix this.  I.e. remove the lines:
    #ifdef SOFTPARTICLES_ON
    float4 projPos : TEXCOORD1;
    #endif
    New Participant
    September 15, 2016
    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!

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