Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Assets/MirrorEffect/MirrorBlack.mat
Binary file not shown.
8 changes: 4 additions & 4 deletions Assets/MirrorEffect/MirrorCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public void RenderIntoMaterial(Material material) {

if (RenderAsMirror)
{
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Left, VrEye.nearClipPlane, VrEye.farClipPlane, Valve.VR.EGraphicsAPIConvention.API_DirectX)) * Matrix4x4.Scale (mirrorMatrixScale);
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Left, VrEye.nearClipPlane, VrEye.farClipPlane)) * Matrix4x4.Scale (mirrorMatrixScale);
} else {
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Left, VrEye.nearClipPlane, VrEye.farClipPlane, Valve.VR.EGraphicsAPIConvention.API_DirectX));
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Left, VrEye.nearClipPlane, VrEye.farClipPlane));
}

cameraForPortal.targetTexture = leftEyeRenderTexture;
Expand All @@ -108,9 +108,9 @@ public void RenderIntoMaterial(Material material) {

if (RenderAsMirror)
{
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Right, VrEye.nearClipPlane, VrEye.farClipPlane, Valve.VR.EGraphicsAPIConvention.API_DirectX)) * Matrix4x4.Scale (mirrorMatrixScale);
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Right, VrEye.nearClipPlane, VrEye.farClipPlane)) * Matrix4x4.Scale (mirrorMatrixScale);
} else {
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Right, VrEye.nearClipPlane, VrEye.farClipPlane, Valve.VR.EGraphicsAPIConvention.API_DirectX));
cameraForPortal.projectionMatrix = HMDMatrix4x4ToMatrix4x4 (SteamVR.instance.hmd.GetProjectionMatrix (Valve.VR.EVREye.Eye_Right, VrEye.nearClipPlane, VrEye.farClipPlane));
}

cameraForPortal.targetTexture = rightEyeRenderTexture;
Expand Down
Binary file modified Assets/MirrorEffect/MirrorReflection.mat
Binary file not shown.
6 changes: 4 additions & 2 deletions Assets/MirrorEffect/MirrorShader.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Shader "MirrorShader" {
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "MirrorShader" {
Properties{
_LeftEyeTexture("Left Eye Texture", 2D) = "white" {}
_RightEyeTexture("Left Eye Texture", 2D) = "white" {}
Expand Down Expand Up @@ -36,7 +38,7 @@
v2f vert(appdata v, out float4 outpos : SV_POSITION)
{
v2f o;
outpos = mul(UNITY_MATRIX_MVP, v.vertex);
outpos = UnityObjectToClipPos(v.vertex);

o.uv = v.uv;
return o;
Expand Down
Binary file modified Assets/MirrorRoot.prefab
Binary file not shown.
Binary file modified Assets/Models/Materials/char_robotGuard_helmet_mat.mat
Binary file not shown.
Binary file modified Assets/Models/Materials/char_robotGuard_suit_mat.mat
Binary file not shown.
Binary file modified Assets/Models/Materials/char_robotGuard_visor_mat.mat
Binary file not shown.
Binary file modified Assets/Models/Materials/prop_sciFi_Gun_mat.mat
Binary file not shown.
1,751 changes: 1,606 additions & 145 deletions Assets/Plugins/openvr_api.cs

Large diffs are not rendered by default.

Binary file modified Assets/Scenes/Mirror.unity
Binary file not shown.
3 changes: 2 additions & 1 deletion Assets/SteamVR.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions Assets/SteamVR/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/SteamVR/Editor/SteamVR_Editor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright 2014, Valve Corporation, All rights reserved. ===========
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Camera
//
Expand Down
48 changes: 48 additions & 0 deletions Assets/SteamVR/Editor/SteamVR_Preferences.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Preferences pane for how SteamVR plugin behaves.
//
//=============================================================================

using UnityEngine;
using UnityEditor;

public class SteamVR_Preferences
{
/// <summary>
/// Should SteamVR automatically enable VR when opening Unity or pressing play.
/// </summary>
public static bool AutoEnableVR
{
get
{
return EditorPrefs.GetBool("SteamVR_AutoEnableVR", true);
}
set
{
EditorPrefs.SetBool("SteamVR_AutoEnableVR", value);
}
}

[PreferenceItem("SteamVR")]
static void PreferencesGUI()
{
EditorGUILayout.BeginVertical();
EditorGUILayout.Space();

// Automatically Enable VR
{
string title = "Automatically Enable VR";
string tooltip = "Should SteamVR automatically enable VR on launch and play?";
AutoEnableVR = EditorGUILayout.Toggle(new GUIContent(title, tooltip), AutoEnableVR);
string helpMessage = "To enable VR manually:\n";
helpMessage += "- go to Edit -> Project Settings -> Player,\n";
helpMessage += "- tick 'Virtual Reality Supported',\n";
helpMessage += "- make sure OpenVR is in the 'Virtual Reality SDKs' list.";
EditorGUILayout.HelpBox(helpMessage, MessageType.Info);
}

EditorGUILayout.EndVertical();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Assets/SteamVR/Editor/SteamVR_RenderModelEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright 2014, Valve Corporation, All rights reserved. ===========
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_RenderModel
//
Expand All @@ -8,7 +8,6 @@
using UnityEditor;
using System.Text;
using System.Collections.Generic;
using Valve.VR;

[CustomEditor(typeof(SteamVR_RenderModel)), CanEditMultipleObjects]
public class SteamVR_RenderModelEditor : Editor
Expand Down Expand Up @@ -85,7 +84,7 @@ public override void OnInspectorGUI()
//EditorGUILayout.PropertyField(modelOverride);

GUILayout.BeginHorizontal();
GUILayout.Label("Model Override");
GUILayout.Label(new GUIContent("Model Override", SteamVR_RenderModel.modelOverrideWarning));
var selected = EditorGUILayout.Popup(renderModelIndex, renderModelNames);
if (selected != renderModelIndex)
{
Expand Down
Loading