示例#1
0
        void PrepFrameRenderTexture(RecordingSession session)
        {
            if (OutputRenderTexture != null)
            {
                if (OutputRenderTexture.IsCreated() && OutputRenderTexture.width == OutputWidth && OutputRenderTexture.height == OutputHeight)
                {
                    return;
                }

                ReleaseBuffer();
            }

            ImageRecorderSettings s = session.settings as ImageRecorderSettings;
            var fmtRW = RenderTextureReadWrite.Default;
            var fmt   = RenderTextureFormat.ARGB32;

            if (s != null && s.CanCaptureHDRFrames() && s.CaptureHDR)
            {
                fmtRW = RenderTextureReadWrite.Linear;
                fmt   = RenderTextureFormat.DefaultHDR;
            }

            OutputRenderTexture = new RenderTexture(OutputWidth, OutputHeight, 0, fmt, fmtRW)
            {
                wrapMode = TextureWrapMode.Repeat
            };
            OutputRenderTexture.Create();
            if (m_UICamera != null)
            {
                m_UICamera.targetTexture = OutputRenderTexture;
            }

            return;
        }
示例#2
0
        public static void StartCapturing()
        {
            var options  = RecorderOptions.CurrentOptions;
            var settings = CreateInstance <RecorderControllerSettings>();

            settings.SetRecordModeToSingleFrame(0);

            image = CreateInstance <ImageRecorderSettings>();
            image.imageInputSettings = new Camera360InputSettings
            {
                Source           = ImageSource.MainCamera,
                MapSize          = options.MapSize,
                OutputHeight     = options.Height,
                OutputWidth      = options.Width,
                RenderStereo     = options.renderStereo,
                StereoSeparation = options.StereoSeparation,
            };
            image.OutputFormat           = options.IntermediateFormat;
            image.FileNameGenerator.Root = OutputPath.Root.Absolute;
            image.FileNameGenerator.Leaf = PathProvider.WorkDir;
            settings.AddRecorderSettings(image);

            controller = new RecorderController(settings);

            captureId = 0;
            TimelinePlayer.Current.PlayFrameByFrame();
        }
示例#3
0
        void PrepFrameRenderTexture(RecordingSession session)
        {
            if (OutputRenderTexture != null)
            {
                if (OutputRenderTexture.IsCreated() && OutputRenderTexture.width == OutputWidth && OutputRenderTexture.height == OutputHeight)
                {
                    return;
                }

                ReleaseBuffer();
            }

            ImageRecorderSettings s = session.settings as ImageRecorderSettings;
            var fmtRW = RenderTextureReadWrite.Default;
            var fmt   = RenderTextureFormat.ARGB32;

            if (s != null && s.CanCaptureHDRFrames() && s.CaptureHDR)
            {
                fmtRW = RenderTextureReadWrite.Linear;
                fmt   = RenderTextureFormat.DefaultHDR;
            }


            OutputRenderTexture = new RenderTexture(OutputWidth, OutputHeight, 24, fmt, fmtRW)
            {
                dimension    = TextureDimension.Tex2D,
                antiAliasing = 1
            };

            m_Cubemap1 = new RenderTexture(settings360.MapSize, settings360.MapSize, 24, fmt, fmtRW)
            {
                dimension = TextureDimension.Cube
            };

            m_Cubemap2 = new RenderTexture(settings360.MapSize, settings360.MapSize, 24, fmt, fmtRW)
            {
                dimension = TextureDimension.Cube
            };
        }