Skip to content

Scripts Documentation

Kristie Chow edited this page Nov 20, 2019 · 4 revisions

Scene switch panel

  • REQUIRES EVENTSYSTEM (an object) TO WORK
  • RightControllerScriptAlias needs UI pointer to interact with canvas

LeftControllerScriptAlias

  • Attached scripts

    • Controller_Menu_Popup
      • Vision: CenterEyeAnchor object of Oculus
      • Tracks the center of the headset
      • Where the vision changes are: Depth of field, Colorblind
    • Scene Panel: SceneSwitchPanel object
      • Popup panel for switching to different scenes Children
  • InstructionsL

    • A series of canvases, each is a label of the button
  • OculusTouchForQuestAndRiftS_Left

    • Controller model for the left hand
  • RightControllerScriptAlias

    • Attached scripts
  • VRTK_Pointer

    • Allows teleport with trigger on right hand
  • VRTK_UI Pointer

    • Allows interaction with UI panels (scene switch panel)
  • VRTK_Straight Pointer Renderer

    • Shows the laser when pointing at things
  • Right Controls

    • Panel: Teach Control object
    • Instruction panel in front of face in each scene (welcome to…)
    • Controls L: InstructionsL object
  • Words attached to the left controller

    • Controls R: InstructionsR object
  • Words attached to right controller

    • Children
    • InstructionsR
  • A series of canvases, each is a label of the button

  • OculusTouchForQuest And RiftS_Right

  • Controller model for the right hand

  • Blurring / focusing changes

  • We completely replaced the old script with two new scripts. Both scripts should be placed on the CenterEyeAnchor in the OVRCameraRig in the VRTK_SDKManager, and the DOFObject should be placed anywhere in the scene

  • The first is “DepthOfField” script. This is a default unity script that creates a depth of field effect (blurring everything outside of the camera’s focal range). The focal range is determined by a gameobject’s transform component, This gameobject should be passed to the “Focus on Transform” parameter in the “DepthOfField” script

  • The second script is “DOFManager”. This is script from Gamad on youtube: https://www.youtube.com/watch?v=xlpHmxNtiT8, and modified by us. The script sends out a Spherecast (essentially a raycast with a width) from the headset that returns the position of the first gameobject it collides with. The script changes the position of the gameobject the first script focuses on, called the DOFObject.

  • Instead of instantly changing the position of the DOFObject, it non-linearly interpolates between its current position, and the Spherecast’s position DOFObject is a prefab that can be found in the prefab folder. It’s a dummy object that essentially only a transform, but signals the DepthOfField script where to focus. This object must be added to any scene that has the DepthOfField script, and added as a parameter to that script.

  • Scene transitioning / blackout: https://github.com/dali-lab/tarsier/wiki/Black-Screens-During-Scene-Switching

  • Controller highlighting: https://github.com/dali-lab/tarsier/wiki/Controller-Touch-Highlighting

  • Optimizing lighting for the Oculus Quest

  • Don’t use realtime lighting, ever Bake lights instead. On every light object you add, make sure the “mode” parameter is set to “Baked”

  • To bake the lighting, go to Window > Rendering > Lighting Settings.

  • Uncheck “Auto Generate” at the bottom. Otherwise, it will attempt to bake lighting every time you even slightly change a light, which isn’t something you want

  • Uncheck Realtime Global Illumination, as that slows things down and isn’t even used

  • To make the baked lightmaps look good, up the lightmap resolution, indirect resolution (if using ambient occlusion), and lightmap size. Also uncheck “compress lightmaps”

  • Teleporting and limiting teleporting:

  • GameObject Teleporter - contains the “HeightAdjustTeleport” script, which gets called every time we teleport. * This object’s position is unimportant, but its existence is mandatory. It must exist in every scene “VRTK_Pointer” must be put on whatever controller controls teleporting. THis creates the raycast “VRTK_StraightPointerRenderer” must be put on whatever controller has the “VRTK_Pointer” script, to actually render the teleport raycast

  • Any object that can be teleported to should be put on “Default” layer.

  • Any object that cannot be teleported to should be put on the “Ignore Raycast” layer

Clone this wiki locally