diff --git a/Runtime/Prefabs/Render Streaming Services.prefab b/Runtime/Prefabs/Render Streaming Services.prefab index 47b7113..4cebacc 100644 --- a/Runtime/Prefabs/Render Streaming Services.prefab +++ b/Runtime/Prefabs/Render Streaming Services.prefab @@ -11,7 +11,6 @@ GameObject: - component: {fileID: 1793859182182230346} - component: {fileID: 1793859182182230347} - component: {fileID: 1270632014} - - component: {fileID: 1084652618} m_Layer: 0 m_Name: WebVR Camera m_TagString: Untagged @@ -50,7 +49,7 @@ MonoBehaviour: m_EditorClassIdentifier: local: 0 label: - VRCameras: {fileID: 1084652618} + VRCameras: {fileID: 0} VRPoseEvent: m_PersistentCalls: m_Calls: @@ -105,24 +104,6 @@ MonoBehaviour: VRAxisEvent: m_PersistentCalls: m_Calls: [] ---- !u!114 &1084652618 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1793859182182230341} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 88dc1ef0a0e7d1b4a897f095b852ab38, type: 3} - m_Name: - m_EditorClassIdentifier: - streamingSize: {x: 2700, y: 1500} - leftEye: {fileID: 1793859182864016192} - rightEye: {fileID: 1793859183251251332} - depth: 0 - antiAliasing: 1 - BIT_RATE: 9000000 --- !u!1 &1793859182664022047 GameObject: m_ObjectHideFlags: 0 @@ -273,6 +254,7 @@ GameObject: m_Component: - component: {fileID: 1793859182864016220} - component: {fileID: 1793859182864016192} + - component: {fileID: 5657891410645623095} m_Layer: 0 m_Name: Left Eye Render Streaming Camera m_TagString: Untagged @@ -337,6 +319,24 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!114 &5657891410645623095 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1793859182864016223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88dc1ef0a0e7d1b4a897f095b852ab38, type: 3} + m_Name: + m_EditorClassIdentifier: + streamingSize: {x: 1350, y: 1500} + cameras: + - {fileID: 1793859182864016192} + depth: 0 + antiAliasing: 1 + BIT_RATE: 9000000 --- !u!1 &1793859182968099965 GameObject: m_ObjectHideFlags: 0 @@ -530,6 +530,7 @@ GameObject: m_Component: - component: {fileID: 1793859183251251333} - component: {fileID: 1793859183251251332} + - component: {fileID: 2367005362525901591} m_Layer: 0 m_Name: Right Eye Render Streaming Camera m_TagString: Untagged @@ -594,6 +595,24 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!114 &2367005362525901591 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1793859183251251330} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88dc1ef0a0e7d1b4a897f095b852ab38, type: 3} + m_Name: + m_EditorClassIdentifier: + streamingSize: {x: 1350, y: 1500} + cameras: + - {fileID: 1793859183251251332} + depth: 0 + antiAliasing: 1 + BIT_RATE: 9000000 --- !u!1 &1793859183478774782 GameObject: m_ObjectHideFlags: 0 @@ -717,7 +736,8 @@ MonoBehaviour: m_EditorClassIdentifier: gameID: streams: - - {fileID: 1084652618} + - {fileID: 5657891410645623095} + - {fileID: 2367005362525901591} - {fileID: 1793859183478774780} - {fileID: 1793859182182230347} --- !u!1 &9010668948091610382 diff --git a/Runtime/Scripts/VRCamStream.cs b/Runtime/Scripts/VRCamStream.cs index 420546e..b123d6a 100644 --- a/Runtime/Scripts/VRCamStream.cs +++ b/Runtime/Scripts/VRCamStream.cs @@ -7,12 +7,8 @@ public class VRCamStream : VideoStreamBase { #region Variables [SerializeField] - [Tooltip("The Left Eye of the VR Camera")] - private Camera leftEye; - - [SerializeField] - [Tooltip("The Right Eye of the VR Camera")] - private Camera rightEye; + [Tooltip("The Cameras to combine together for the render texture")] + private Camera[] cameras; [SerializeField] [Tooltip("Defines the depth buffer used for render streaming (0, 16, 24, 32)")] @@ -31,10 +27,7 @@ public class VRCamStream : VideoStreamBase { /// private string mainConnection = ""; - public const uint MAX_FRAMERATE = 90; //default max framerate target - - public override Texture SendTexture => leftEye.targetTexture; //should be the same as right eye #endregion #region Events @@ -60,11 +53,11 @@ protected override MediaStreamTrack CreateTrack() { }; rt.Create(); - leftEye.targetTexture = rt; - leftEye.rect = new Rect(Vector2.zero, new Vector2(0.5f, 1f)); - - rightEye.targetTexture = rt; - rightEye.rect = new Rect(new Vector2(0.5f, 0f), new Vector2(0.5f, 1f)); + // divide cameras into n sections over the canvas + for ( int i = 0; i < cameras.Length; i++) { + cameras[i].targetTexture = rt; + cameras[i].rect = new Rect(new Vector2(i / cameras.Length, 0f), new Vector2(1 / cameras.Length, 1f)); + } return new VideoStreamTrack("VR Camera", rt); } diff --git a/Samples~/VRTK-Sample/Prefabs/CameraRig VR Streaming.prefab b/Samples~/VRTK-Sample/Prefabs/CameraRig VR Streaming.prefab index 4ed7666..3b15e1b 100644 --- a/Samples~/VRTK-Sample/Prefabs/CameraRig VR Streaming.prefab +++ b/Samples~/VRTK-Sample/Prefabs/CameraRig VR Streaming.prefab @@ -130,6 +130,7 @@ GameObject: m_Component: - component: {fileID: 5409741706814409633} - component: {fileID: 5409741706814409661} + - component: {fileID: 1311884957850820708} m_Layer: 0 m_Name: Left Eye Render Streaming Camera m_TagString: Untagged @@ -194,6 +195,24 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!114 &1311884957850820708 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5409741706814409634} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88dc1ef0a0e7d1b4a897f095b852ab38, type: 3} + m_Name: + m_EditorClassIdentifier: + streamingSize: {x: 1350, y: 1500} + cameras: + - {fileID: 5409741706814409661} + depth: 0 + antiAliasing: 1 + BIT_RATE: 9000000 --- !u!1 &5409741707147579618 GameObject: m_ObjectHideFlags: 0 @@ -252,7 +271,6 @@ GameObject: - component: {fileID: 5409741707227693495} - component: {fileID: 5409741707227693494} - component: {fileID: 6050113343620589235} - - component: {fileID: 3910269784793143522} m_Layer: 0 m_Name: WebVR Camera m_TagString: Untagged @@ -291,7 +309,7 @@ MonoBehaviour: m_EditorClassIdentifier: local: 0 label: - VRCameras: {fileID: 3910269784793143522} + VRCameras: {fileID: 0} VRPoseEvent: m_PersistentCalls: m_Calls: @@ -346,24 +364,6 @@ MonoBehaviour: VRAxisEvent: m_PersistentCalls: m_Calls: [] ---- !u!114 &3910269784793143522 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5409741707227693496} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 88dc1ef0a0e7d1b4a897f095b852ab38, type: 3} - m_Name: - m_EditorClassIdentifier: - streamingSize: {x: 2700, y: 1500} - leftEye: {fileID: 5409741706814409661} - rightEye: {fileID: 5409741708271552633} - depth: 0 - antiAliasing: 1 - BIT_RATE: 9000000 --- !u!1 &5409741707778225114 GameObject: m_ObjectHideFlags: 0 @@ -435,7 +435,8 @@ MonoBehaviour: m_EditorClassIdentifier: gameID: streams: - - {fileID: 3910269784793143522} + - {fileID: 1311884957850820708} + - {fileID: 8785673958752523758} - {fileID: 5409741708046136065} - {fileID: 5409741707227693494} --- !u!1 &5409741708046136067 @@ -500,6 +501,7 @@ GameObject: m_Component: - component: {fileID: 5409741708271552632} - component: {fileID: 5409741708271552633} + - component: {fileID: 8785673958752523758} m_Layer: 0 m_Name: Right Eye Render Streaming Camera m_TagString: Untagged @@ -564,6 +566,24 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 +--- !u!114 &8785673958752523758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5409741708271552639} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88dc1ef0a0e7d1b4a897f095b852ab38, type: 3} + m_Name: + m_EditorClassIdentifier: + streamingSize: {x: 1350, y: 1500} + cameras: + - {fileID: 5409741708271552633} + depth: 0 + antiAliasing: 1 + BIT_RATE: 9000000 --- !u!1 &6050113341623843308 GameObject: m_ObjectHideFlags: 0 diff --git a/package.json b/package.json index 29644aa..44b2edd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.fusedvr.vrstreaming", - "version": "0.4.0", + "version": "0.4.1", "displayName": "FusedVR Streaming", "description": "This VR Streaming Package contains a minimal SDK & prefabs to implement VR Streaming (CloudXR) using WebRTC and Unity Remote Rendering", "dependencies": {