Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Oculus hands and controllers show PINK using Unity VR Lightweight Pipeline

nexvsnexvs Posts: 9
NerveGear
Hello!
I wonder if some one can help me with this problem.
Im using Unity 2018.2.17 - VR Lightweight pipeline.

The problem is that the VR Lightweight pipeline only accepts the Lightweight Pipeline Standard shader. Anything else is just put on a PINK color.

You cant (to my knowledge) change the hand material to the right one so they will display the typical blue. In other objects, you just change the shader type in the material settings...
This also happens with the controllers, they are in beautiful pink.

Please help :):smile: I am desperate to get the "usual" materials for the hands and touch controllers. I am very surprised they dont work straight - the new VR Lightweight pipeline is going to be huge for VR and the new games in Quest. I have already tested that it can handle better FPS than the normal 3D Template.

Thanks all for your inputs.

Comments

  • citizen12citizen12 Posts: 23 Oculus Start Member
    edited December 2018
    The Scriptable Render Pipeline (which includes LWRP) is a whole different rendering pipeline for Unity.  The "right" way to fix this is for Oculus to update their Unity asset package to account for SRP as well as Standard rendering paths.  That seems unlikely to happen while LWRP is still in preview.

    A super-quick dirty hack to make the pink hands go away is to just replace the Oculus shaders with ones that work for LWRP.  Assuming you're on PC, ou can do this with a one-line change in OvrAvatarSkinnedMeshRenderPBSV2Component.cs (v1.32) at line 36:

    #if UNITY_ANDROID
            var singleComponentShader = "OvrAvatar/Avatar_Mobile_SingleComponent";
    #else
          //  var singleComponentShader = "OvrAvatar/Avatar_PC_SingleComponent";
            var singleComponentShader = "Lightweight Render Pipeline/Simple Lit"; // LWRP HACK
    #endif

  • nexvsnexvs Posts: 9
    NerveGear
    Hello,
    Thanks for your reply.
    I tried to apply your method, but the version of the Oculus Integration available right now from the Asset Store is newer than the one you have made your fix. I did find the script but its radically different that yours. I really hope I am wrong and that you can give me a hand! :smile: I wonder if Oculus will make an update of their integration with unity so that the VR lightweight pipeline can be used with their standard avatars, which are amazing.
  • SaintGabriellSaintGabriell Posts: 6
    NerveGear
    Hey, I'm not sure if this is still an issue you are having or not, and while not a perfect system this worked for my needs. all i did was create a script that grabs the newly spawned hands and changes their material.


    heres the script. hope it helps


    // i assigned this to the OVR player controller.

      public Material mat; // this is the mat you want the hands changed to.


        private GameObject handLeft;
        private GameObject handRight;

        //
        void Update()
        {
            // find and grab the hand objects
                handRight = GameObject.Find("hand_right_renderPart_0");
                handLeft = GameObject.Find("hand_left_renderPart_0");

                        // if i've found the hands change the texture
                if(handRight !=null && handLeft !=null)
                {
                    handLeft.GetComponent<Renderer>().material = mat;
                    handRight.GetComponent<Renderer>().material = mat;
                    Destroy(GetComponent<handMatChange>()); // remove this script so it stops running.
                }
        }



Sign In or Register to comment.