Пример #1
0
        protected override void  OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try {
                m_Device.Init(m_viewerForm.Handle, false, true);

                // Create our compute shaders
                                #if DEBUG
                m_CS_BilateralFilter   = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("./Shaders/BilateralFiltering.hlsl")), "CS", null);
                m_CS_GenerateSSBumpMap = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("./Shaders/GenerateSSBumpMap.hlsl")), "CS", null);
                m_PS_Display           = new Shader(m_Device, new ShaderFile(new System.IO.FileInfo("./Shaders/Display.hlsl")), VERTEX_FORMAT.Pt4, "VS", null, "PS", null);
                                #else
                m_CS_BilateralFilter   = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/BilateralFiltering.fxbin"), "CS");
                m_CS_GenerateSSBumpMap = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/GenerateSSBumpMap.fxbin"), "CS");
                m_PS_Display           = Shader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Display.hlsl"), VERTEX_FORMAT.Pt4, "VS", null, "PS");
                                #endif


                // Create our constant buffers
                m_CB_Input  = new RendererManaged.ConstantBuffer <CBInput>(m_Device, 0);
                m_CB_Filter = new RendererManaged.ConstantBuffer <CBFilter>(m_Device, 0);

                m_CB_Display           = new ConstantBuffer <CBDisplay>(m_Device, 0);
                m_CB_Display.m._Width  = (uint)m_viewerForm.Width;
                m_CB_Display.m._Height = (uint)m_viewerForm.Height;

                // Create our structured buffer containing the rays
                m_SB_Rays = new RendererManaged.StructuredBuffer <RendererManaged.float3>(m_Device, 3 * MAX_THREADS, true);
                integerTrackbarControlRaysCount_SliderDragStop(integerTrackbarControlRaysCount, 0);

//				LoadHeightMap( new System.IO.FileInfo( "eye_generic_01_disp.png" ) );
//				LoadHeightMap( new System.IO.FileInfo( "10 - Smooth.jpg" ) );
            } catch (Exception _e) {
                MessageBox("Failed to create DX11 device and default shaders:\r\n", _e);
                Close();
            }
        }
Пример #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try {
                m_Device.Init(panelOutput.Handle, false, true);
            } catch (Exception _e) {
                m_Device = null;
                MessageBox.Show("Failed to initialize DX device!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try {
                m_Shader_RenderScene = new Shader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/RenderScene.hlsl")), VERTEX_FORMAT.P3N3G3B3T2, "VS", null, "PS", null);
            } catch (Exception _e) {
                MessageBox.Show("Shader \"RenderScene\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_RenderScene = null;
            }

            try {
                m_Shader_PostProcess = new Shader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/PostProcess.hlsl")), VERTEX_FORMAT.Pt4, "VS", null, "PS", null);
            } catch (Exception _e) {
                MessageBox.Show("Shader \"PostProcess\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_PostProcess = null;
            }

                        #if DEBUG && !BISOU
            try {
                m_Shader_ClearAccumulator  = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/SplatDepthStencil_Accumulate.hlsl")), "CS_Clear", null);
                m_Shader_SplatDepthStencil = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/SplatDepthStencil_Accumulate.hlsl")), "CS_Accumulate", null);
                m_Shader_Reproject         = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/SplatDepthStencil_Reproject.hlsl")), "CS", null);
                m_Shader_FinalizeSplat     = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/SplatDepthStencil_Finalize.hlsl")), "CS", null);
            } catch (Exception _e) {
                MessageBox.Show("Shader \"SplatDepthStencil\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_ClearAccumulator  = null;
                m_Shader_SplatDepthStencil = null;
                m_Shader_FinalizeSplat     = null;
            }

            try {
                m_Shader_BuildDistanceField[0] = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/BuildDistanceField_X.hlsl")), "CS", null);
                m_Shader_BuildDistanceField[1] = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/BuildDistanceField_Y.hlsl")), "CS", null);
                m_Shader_BuildDistanceField[2] = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/BuildDistanceField_Z.hlsl")), "CS", null);
            } catch (Exception _e) {
                MessageBox.Show("Shader \"BuildDistanceField\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_BuildDistanceField[0] = null;
                m_Shader_BuildDistanceField[1] = null;
                m_Shader_BuildDistanceField[2] = null;
            }
                        #else
            try {
                m_Shader_ClearAccumulator  = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/SplatDepthStencil_Accumulate.hlsl"), "CS_Clear");
                m_Shader_SplatDepthStencil = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/SplatDepthStencil_Accumulate.hlsl"), "CS_Accumulate");
                m_Shader_Reproject         = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/SplatDepthStencil_Reproject.hlsl"), "CS");
                m_Shader_FinalizeSplat     = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/SplatDepthStencil_Finalize.hlsl"), "CS");
            } catch (Exception _e) {
                MessageBox.Show("Shader \"SplatDepthStencil\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_ClearAccumulator  = null;
                m_Shader_SplatDepthStencil = null;
                m_Shader_Reproject         = null;
                m_Shader_FinalizeSplat     = null;
            }

            try {
                m_Shader_BuildDistanceField[0] = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/BuildDistanceField_X.fxbin"), "CS");
                m_Shader_BuildDistanceField[1] = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/BuildDistanceField_Y.fxbin"), "CS");
                m_Shader_BuildDistanceField[2] = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/BuildDistanceField_Z.fxbin"), "CS");
            } catch (Exception _e) {
                MessageBox.Show("Shader \"BuildDistanceField\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_BuildDistanceField[0] = null;
                m_Shader_BuildDistanceField[1] = null;
                m_Shader_BuildDistanceField[2] = null;
            }
                        #endif

            m_CB_Main   = new ConstantBuffer <CB_Main>(m_Device, 0);
            m_CB_Camera = new ConstantBuffer <CB_Camera>(m_Device, 1);
            m_CB_Object = new ConstantBuffer <CB_Object>(m_Device, 2);

            BuildPrimitives();

            // Allocate texture
//			m_Tex_TempTarget = new Texture2D( m_Device, panelOutput.Width, panelOutput.Height, 2, 1, PIXEL_FORMAT.RGBA8_UNORM_sRGB, false, false, null );
            m_Tex_TempTarget = new Texture2D(m_Device, panelOutput.Width, panelOutput.Height, 2, 1, PIXEL_FORMAT.RGBA16_FLOAT, false, false, null);

            // Allocate several 3D textures for depth-stencil reduction
            m_Tex_TempDepthAccumulatorRG = new Texture3D(m_Device, VOXELS_COUNT, VOXELS_COUNT, VOXELS_COUNT, 1, PIXEL_FORMAT.R32_UINT, false, true, null);
            m_Tex_TempDepthAccumulatorBA = new Texture3D(m_Device, VOXELS_COUNT, VOXELS_COUNT, VOXELS_COUNT, 1, PIXEL_FORMAT.R32_UINT, false, true, null);
            m_Tex_SplatDepthStencil[0]   = new Texture3D(m_Device, VOXELS_COUNT, VOXELS_COUNT, VOXELS_COUNT, 1, PIXEL_FORMAT.RGBA8_UNORM, false, true, null);
            m_Tex_SplatDepthStencil[1]   = new Texture3D(m_Device, VOXELS_COUNT, VOXELS_COUNT, VOXELS_COUNT, 1, PIXEL_FORMAT.RGBA8_UNORM, false, true, null);
            m_Tex_DistanceField[0]       = new Texture3D(m_Device, VOXELS_COUNT, VOXELS_COUNT, VOXELS_COUNT, 6, PIXEL_FORMAT.R16_FLOAT, false, true, null);
            m_Tex_DistanceField[1]       = new Texture3D(m_Device, VOXELS_COUNT, VOXELS_COUNT, VOXELS_COUNT, 6, PIXEL_FORMAT.R16_FLOAT, false, true, null);

            m_Device.Clear(m_Tex_SplatDepthStencil[0], float4.Zero);
            m_Device.Clear(m_Tex_SplatDepthStencil[1], float4.Zero);

            // Setup camera
            m_Camera.CreatePerspectiveCamera((float)(60.0 * Math.PI / 180.0), (float)panelOutput.Width / panelOutput.Height, 0.01f, 100.0f);
            m_Manipulator.Attach(panelOutput, m_Camera);
            m_Manipulator.InitializeCamera(new float3(0, 1, 4), new float3(0, 1, 0), float3.UnitY);
        }
Пример #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try {
                m_Device.Init(panelOutput.Handle, false, true);
            } catch (Exception _e) {
                m_Device = null;
                MessageBox("Failed to initialize DX device!\n\n" + _e.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            m_CB_Main         = new ConstantBuffer <CB_Main>(m_Device, 0);
            m_CB_Camera       = new ConstantBuffer <CB_Camera>(m_Device, 1);
            m_CB_AutoExposure = new ConstantBuffer <CB_AutoExposure>(m_Device, 10);
            m_CB_ToneMapping  = new ConstantBuffer <CB_ToneMapping>(m_Device, 10);

            try {
                        #if DEBUG
                m_Shader_RenderHDR            = new Shader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/RenderCubeMap.hlsl")), VERTEX_FORMAT.Pt4, "VS", null, "PS", null);
                m_Shader_ComputeTallHistogram = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/AutoExposure/ComputeTallHistogram.hlsl")), "CS", null);
                m_Shader_FinalizeHistogram    = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/AutoExposure/FinalizeHistogram.hlsl")), "CS", null);
                m_Shader_ComputeAutoExposure  = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/AutoExposure/ComputeAutoExposure.hlsl")), "CS", null);
                m_Shader_ToneMapping          = new Shader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/ToneMapping.hlsl")), VERTEX_FORMAT.Pt4, "VS", null, "PS", null);
                        #else
                m_Shader_RenderHDR            = Shader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/RenderCubeMap.hlsl"), VERTEX_FORMAT.Pt4, "VS", null, "PS");
                m_Shader_ComputeTallHistogram = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/AutoExposure/ComputeTallHistogram.hlsl"), "CS");
                m_Shader_FinalizeHistogram    = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/AutoExposure/FinalizeHistogram.hlsl"), "CS");
                m_Shader_ComputeAutoExposure  = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/AutoExposure/ComputeAutoExposure.hlsl"), "CS");
                m_Shader_ToneMapping          = Shader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("Shaders/ToneMapping.hlsl"), VERTEX_FORMAT.Pt4, "VS", null, "PS");
                        #endif
            } catch (Exception _e) {
                MessageBox("Shader failed to compile!\n\n" + _e.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_RenderHDR            = null;
                m_Shader_ComputeTallHistogram = null;
                m_Shader_FinalizeHistogram    = null;
                m_Shader_ComputeAutoExposure  = null;
                m_Shader_ToneMapping          = null;
            }

            // Create the HDR buffer
            m_Tex_HDR = new Texture2D(m_Device, panelOutput.Width, panelOutput.Height, 1, 1, PIXEL_FORMAT.RGBA32_FLOAT, false, false, null);

            // Create the histogram & auto-exposure buffers
            int tallHistogramHeight = (panelOutput.Height + 3) >> 2;
            m_Tex_TallHistogram         = new Texture2D(m_Device, 128, tallHistogramHeight, 1, 1, PIXEL_FORMAT.R32_UINT, false, true, null);
            m_Tex_Histogram             = new Texture2D(m_Device, 128, 1, 1, 1, PIXEL_FORMAT.R32_UINT, false, true, null);
            m_Buffer_AutoExposureSource = new StructuredBuffer <autoExposure_t>(m_Device, 1, true);
            m_Buffer_AutoExposureSource.m[0].EngineLuminanceFactor  = 1.0f;
            m_Buffer_AutoExposureSource.m[0].TargetLuminance        = 1.0f;
            m_Buffer_AutoExposureSource.m[0].MinLuminanceLDR        = 0.0f;
            m_Buffer_AutoExposureSource.m[0].MaxLuminanceLDR        = 1.0f;
            m_Buffer_AutoExposureSource.m[0].MiddleGreyLuminanceLDR = 1.0f;
            m_Buffer_AutoExposureSource.m[0].EV    = 0.0f;
            m_Buffer_AutoExposureSource.m[0].Fstop = 0.0f;
            m_Buffer_AutoExposureSource.m[0].PeakHistogramValue = 0;
            m_Buffer_AutoExposureSource.Write();
            m_Buffer_AutoExposureTarget = new StructuredBuffer <autoExposure_t>(m_Device, 1, true);

            // Load cube map
            try {
                m_Tex_CubeMap = LoadCubeMap(new System.IO.FileInfo("garage4_hd.dds"));
//				m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\hdrcube6.dds" ) );
//				m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\dust_return\pr_obe_28_cube_BC6H_UF16.bimage" ) );		// Tunnel
//              m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\dust_return\pr_obe_89_cube_BC6H_UF16.bimage" ) );		// Large sky
//              m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\dust_return\pr_obe_115_cube_BC6H_UF16.bimage" ) );	// Indoor
//              m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\dust_return\pr_obe_123_cube_BC6H_UF16.bimage" ) );	// Under the arch
//              m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\dust_return\pr_obe_189_cube_BC6H_UF16.bimage" ) );	// Indoor viewing out (vista)
//              m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\dust_return\pr_obe_246_cube_BC6H_UF16.bimage" ) );	// Nice! Statue's feet
//              m_Tex_CubeMap = LoadCubeMap( new System.IO.FileInfo( @"..\..\..\Arkane\CubeMaps\dust_return\pr_obe_248_cube_BC6H_UF16.bimage" ) );	// Nice! In a corner with lot of sky
            } catch (Exception) {
            }

            // Setup camera
            m_Camera.CreatePerspectiveCamera((float)(90.0 * Math.PI / 180.0), (float)panelOutput.Width / panelOutput.Height, 0.01f, 100.0f);
            m_Manipulator.Attach(panelOutput, m_Camera);
            m_Manipulator.InitializeCamera(new float3(0, 0, 1), new float3(0, 0, 0), float3.UnitY);
        }
Пример #4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try {
                m_Device.Init(panelOutput.Handle, false, true);
            } catch (Exception _e) {
                m_Device = null;
                MessageBox.Show("Failed to initialize DX device!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try {
                m_Shader_RenderScene = new Shader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/RenderScene.hlsl")), VERTEX_FORMAT.P3N3G3B3T2, "VS", null, "PS", null);
            } catch (Exception _e) {
                MessageBox.Show("Shader \"RenderScene\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_RenderScene = null;
            }

            try {
                m_Shader_PostProcess = new Shader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/PostProcess.hlsl")), VERTEX_FORMAT.Pt4, "VS", null, "PS", null);
            } catch (Exception _e) {
                MessageBox.Show("Shader \"PostProcess\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_PostProcess = null;
            }

            try {
//				m_Shader_BuildDistanceField[0] = new ComputeShader( m_Device, new ShaderFile( new System.IO.FileInfo( "Shaders/BuildDistanceField.hlsl" ) ), "CS_X", null );
            } catch (Exception _e) {
                MessageBox.Show("Shader \"BuildDistanceField\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_PostProcess = null;
            }

                        #if DEBUG && !BISOU
            try {
                m_Shader_SplatDepthStencil[0] = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/SplatDepthStencil.hlsl")), "CS0", null);
                m_Shader_SplatDepthStencil[1] = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/SplatDepthStencil.hlsl")), "CS1", null);
                m_Shader_SplatDepthStencil[2] = new ComputeShader(m_Device, new ShaderFile(new System.IO.FileInfo("Shaders/SplatDepthStencil.hlsl")), "CS2", null);
            } catch (Exception _e) {
                MessageBox.Show("Shader \"SplatDepthStencil\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_SplatDepthStencil[0] = null;
                m_Shader_SplatDepthStencil[1] = null;
                m_Shader_SplatDepthStencil[2] = null;
            }
                        #else
            try {
                m_Shader_SplatDepthStencil[0] = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/SplatDepthStencil.fxbin"), "CS0");
                m_Shader_SplatDepthStencil[1] = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/SplatDepthStencil.fxbin"), "CS1");
                m_Shader_SplatDepthStencil[2] = ComputeShader.CreateFromBinaryBlob(m_Device, new System.IO.FileInfo("./Shaders/Binary/SplatDepthStencil.fxbin"), "CS2");
            } catch (Exception _e) {
                MessageBox.Show("Shader \"SplatDepthStencil\" failed to compile!\n\n" + _e.Message, "Distance Field Test", MessageBoxButtons.OK, MessageBoxIcon.Error);
                m_Shader_SplatDepthStencil[0] = null;
                m_Shader_SplatDepthStencil[1] = null;
                m_Shader_SplatDepthStencil[2] = null;
            }
                        #endif

            m_CB_Main          = new ConstantBuffer <CB_Main>(m_Device, 0);
            m_CB_Camera        = new ConstantBuffer <CB_Camera>(m_Device, 1);
            m_CB_Object        = new ConstantBuffer <CB_Object>(m_Device, 2);
            m_CB_DistanceField = new ConstantBuffer <CB_Distance>(m_Device, 2);

            BuildPrimitives();

            // Allocate texture
            m_Tex_TempTarget = new Texture2D(m_Device, panelOutput.Width, panelOutput.Height, 1, 1, PIXEL_FORMAT.RGBA8_UNORM_sRGB, false, false, null);

            // Allocate several 3D textures for depth-stencil reduction
            int W = (panelOutput.Width + 7) & ~7;
            int H = (panelOutput.Height + 7) & ~7;
            int D = 1;
            for (int depthLevel = 0; depthLevel < 3; depthLevel++)
            {
                // On every level, resolution is reduced by 2 and depth gets multiplied by 4
                W >>= 1;
                H >>= 1;
                D <<= 2;

                m_Tex_TempDepth3D[depthLevel] = new Texture3D(m_Device, W, H, D, 1, PIXEL_FORMAT.RGBA32_FLOAT, false, true, null);
            }
            m_Tex_TempDepth3D[3] = new Texture3D(m_Device, W, H, D, 1, PIXEL_FORMAT.RGBA32_FLOAT, false, true, null);

//          int	cellsCountX = (panelOutput.Width + 7) >> 3;
//          int	cellsCountY = (panelOutput.Height + 7) >> 3;
//          int	cellsCountZ = 64;
//          m_Tex_DistanceField = new Texture3D( m_Device, cellsCountX, cellsCountY, cellsCountZ, 1, PIXEL_FORMAT.RGBA32_FLOAT, false, true, null );	// TODO: Use mips to smooth stuff up?
//			m_Tex_DistanceField = new Texture3D( m_Device, W, H, D, 1, PIXEL_FORMAT.RGBA32_FLOAT, false, true, null );	// TODO: Use mips to smooth stuff up?

            // Setup camera
            m_Camera.CreatePerspectiveCamera((float)(60.0 * Math.PI / 180.0), (float)panelOutput.Width / panelOutput.Height, 0.01f, 100.0f);
            m_Manipulator.Attach(panelOutput, m_Camera);
            m_Manipulator.InitializeCamera(new float3(0, 1, 4), new float3(0, 1, 0), float3.UnitY);
        }