registerImageBasedMaterial() public static method

public static registerImageBasedMaterial ( LeapImageBasedMaterial imageBasedMaterial ) : void
imageBasedMaterial LeapImageBasedMaterial
return void
Beispiel #1
0
    void OnEnable()
    {
        LeapImageRetriever.registerImageBasedMaterial(this);
        // Make shader consistent with settings

        if (QualitySettings.activeColorSpace == ColorSpace.Linear)
        {
            GetComponent <Renderer> ().material.SetFloat("_ColorSpaceGamma", 1.0f);
        }
        else
        {
            float gamma = -Mathf.Log10(Mathf.GammaToLinearSpace(0.1f));
            GetComponent <Renderer> ().material.SetFloat("_ColorSpaceGamma", gamma);
            //Debug.Log ("Derived gamma = " + gamma);
        }
    }
Beispiel #2
0
 void OnEnable ()
 {
   Material imageBasedMaterial = GetComponent<Renderer> ().material;
       
   //Initialize gamma correction
   float gamma = 1f;
   if (QualitySettings.activeColorSpace != ColorSpace.Linear) {
     gamma = -Mathf.Log10 (Mathf.GammaToLinearSpace (0.1f));
     //Debug.Log ("Derived gamma = " + gamma);
   }
   imageBasedMaterial.SetFloat ("_ColorSpaceGamma", gamma);
   
   //Initialize the Time-Warp to be the identity
   imageBasedMaterial.SetMatrix ("_ViewerImageToNow", Matrix4x4.identity);
   LeapImageRetriever.registerImageBasedMaterial(this);
 }