5 namespace droid.Runtime.Utilities.GameObjects.NeodroidCamera.Experimental.Camera360 {
11 public bool renderStereo =
true;
12 public float stereoSeparation = 0.064f;
17 this._cam = this.GetComponent<Camera>();
19 if (this._cam == null) {
20 this._cam = this.GetComponentInParent<Camera>();
24 var target_texture = this._cam.targetTexture;
25 if (!target_texture) {
26 Debug.LogWarning($
"No targetTexture defaulting to a texture of size ({NeodroidConstants._Default_Width}, {NeodroidConstants._Default_Height})");
28 this._texture =
new Texture2D(NeodroidConstants._Default_Width, NeodroidConstants._Default_Height);
30 var texture_format_str = target_texture.format.ToString();
31 if (Enum.TryParse(texture_format_str, out TextureFormat texture_format)) {
32 this._texture =
new Texture2D(target_texture.width,
33 target_texture.height,
35 target_texture.useMipMap,
36 !target_texture.sRGB);
43 if (this._cam == null) {
44 Debug.Log(
"stereo 360 capture node has no camera or parent camera");
47 if (this.renderStereo) {
48 this._cam.stereoSeparation = this.stereoSeparation;
49 this._cam.RenderToCubemap(this.cubemapLeftEye, 63, Camera.MonoOrStereoscopicEye.Left);
50 this._cam.RenderToCubemap(this.cubemapRightEye, 63, Camera.MonoOrStereoscopicEye.Right);
52 this._cam.RenderToCubemap(this.cubemapLeftEye, 63, Camera.MonoOrStereoscopicEye.Mono);
56 if (this.cubemapEquirect != null) {
57 if (this.renderStereo) {
58 this.cubemapLeftEye.ConvertToEquirect(this.cubemapEquirect, Camera.MonoOrStereoscopicEye.Left);
59 this.cubemapRightEye.ConvertToEquirect(this.cubemapEquirect, Camera.MonoOrStereoscopicEye.Right);
61 this.cubemapLeftEye.ConvertToEquirect(this.cubemapEquirect);
RenderTexture cubemapEquirect
RenderTexture cubemapRightEye
RenderTexture cubemapLeftEye