Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Unity 2017.2.0b10で、Immersiveヘッドセット向け描画でNearClipとFarClipを変更するためのUnityコンポーネント
using UnityEngine;
public class ProjectionMatrixSetter : MonoBehaviour {
Camera main;
float nearClip = 0.01f;
float farClip = 500.0f;
float fieldOfView = 102.0456f;
private void Start() {
main = Camera.main;
var projection = Matrix4x4.Perspective(fieldOfView, 1440.0f / 1440.0f, nearClip, farClip);
main.SetStereoProjectionMatrix(Camera.StereoscopicEye.Left, projection);
main.SetStereoProjectionMatrix(Camera.StereoscopicEye.Right, projection);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.