/* * Protected methods */ protected void Initialise(string phosShader, string tailShader) { // load shaders phos = new Material(Shader.Find(phosShader)); tail = new Material(Shader.Find(tailShader)); if (phos == null || tail == null) { Debug.LogError($"{name} does not have a material."); return; } // upload electrode/axon textures to the GPU phos.SetTexture(SP.electrodeTexture, epiretinalData.GetPhospheneTexture(headset, pattern, layout)); tail.SetTexture(SP.axonTexture, epiretinalData.GetAxonTexture(headset)); // create texture for the fading data fadeRT = new DoubleBufferedRenderTexture(headset.GetWidth(), headset.GetHeight()); fadeRT.Initialise(new Color(1, 0, 0, 0)); // overrides if (overrideCameraFOV) { Prosthesis.Instance.Camera.fieldOfView = headset.GetFieldOfView(Axis.Vertical); } if (overrideRefreshRate) { Application.targetFrameRate = headset.GetRefreshRate(); } // cache texture-related variables lastHeadset = headset; lastPattern = pattern; lastLayout = layout; // initialise eye gaze tracking EyeGaze.Initialise(eyeGazeSource, headset); // initialise camera target eye UpdateCameraTargetEye(); }