I can’t seem to find out what these are for. Just wondering what they do.
Is it related to Stereoscopy? I can’t seem to see any difference if I remove those lines of code… and I don’t really want stuff using up resources if I don’t need it.
They pass the instance id and eye index to the fragment shader. This lets you access instanced properties in the fragment shader, as well as do any unique per eye work that may be needed. For example, if you’re using any of the view or projection matrices or the camera position in the fragment shader these need the eye index to give the correct value, otherwise you’ll always access the left eye.
edit: You have to additionally call UNITY_TRANSFER_INSTANCE_ID to transfer the instance id.