Skip to main content
Up and Coming
December 9, 2014

Things moving in distance???

So I was playing around making a level in unity last night for the first time with the Rift - I noticed trees in the distance "Moving" along with my head movements?? Has anyone else noticed this? Is there a way to stop it from happening - I would lean forward....then would lean forward....I turn.....they turn, but only the ones off in the distance.

Thanks for the help - I am just starting to play with this.
    This topic has been closed for replies.

    6 replies

    Inspiring
    December 9, 2014
    This is a result of Unity's tree billboarding system. All distant trees use the same billboard, which gets re-rendered to match the camera angle. It doesn't look the best with the wide viewing angle of the Rift. You can increase the distance at which billboards are used to make the effect less noticeable, but that's a performance trade-off.
    Up and Coming
    December 9, 2014
    Thanks, Just wanted to make sure it wasn't some setting I was missing.
    Inspiring
    December 9, 2014
    Yeah, I've seen this before. Not sure if there is a simple fix or not.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Meta Employee
    December 10, 2014
    Instead of rotating every billboarded object to face the camera view direction, each individual billboard should calculate a facing vector that starts from the center of the camera and goes to the center of the object being billboarded. If this calculation were to be done on the CPU, it could get expensive, but in a shader, it'd be a trivial fix.

    That said, I'm fairly ignorant about how and where this is implemented in Unity 3D, so I couldn't really comment on where the fix would go in the code (especially tricky if this is in Unity's C++ code and not exposed to C# or the shader code).
    Up and Coming
    September 24, 2015
    It looks like the code that does this is in the file "Program Files (x86)\Unity x.x.x.x\Editor\Data\CGIncludes\SpeedTreeBillboardCommon.cginc"

    Specifically, this block:

    #ifdef BILLBOARD_FACE_CAMERA_POS
    float3 eyeVec = normalize(_WorldSpaceCameraPos - worldPos);
    float3 billboardTangent = normalize(float3(-eyeVec.z, 0, eyeVec.x)); // cross(eyeVec, {0,1,0})
    float3 billboardNormal = float3(billboardTangent.z, 0, -billboardTangent.x); // cross({0,1,0},billboardTangent)
    float3 angle = atan2(billboardNormal.z, billboardNormal.x); // signed angle between billboardNormal to {0,0,1}
    angle += angle < 0 ? 2 * UNITY_PI : 0;
    #else
    float3 billboardTangent = _BillboardTangent;
    float3 billboardNormal = _BillboardNormal;
    float angle = _CameraXZAngle;
    #endif


    I'm not sure how you get Unity to pick-up changes to it, nor what precisely the change should be, but would love to see this fixed.
    Inspiring
    September 26, 2015
    We're working with Unity on better billboard behaviors for VR. It looks like changes are needed in the speedtree shaders as well as terrain detail objects. For now, I would disable billboarding on all grass and trees in the terrain settings and use mesh detail objects wherever you can.