Ejemplo n.º 1
0
        void CreateCubeMap()
        {
            // create the camera used to render to our cubemap
            _cubeCamera             = _sceneManager.CreateCamera("CubeMapCamera", true, true);
            _cubeCamera.FOVy        = new Degree(90);
            _cubeCamera.AspectRatio = 1.0f;
            _cubeCamera.SetFixedYawAxis(false);
            _cubeCamera.NearClipDistance = 5.0f;
            _cubeCamera.FarClipDistance  = /*100*/ 10000;

            var tex = TextureManager.Singleton.CreateManual("dyncubemap", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, TextureType.TEX_TYPE_CUBE_MAP, 512, 512, 0, PixelFormat.PF_R8G8B8, (int)TextureUsage.TU_RENDERTARGET);
            CompositorManager2 compositorManager = _root.CompositorManager2;
            const string       workspaceName     = "CompositorSampleCubemap_cubemap";

            if (!compositorManager.HasWorkspaceDefinition(workspaceName))
            {
                CompositorWorkspaceDef workspaceDef = compositorManager.AddWorkspaceDefinition(workspaceName);
                //"CubemapRendererNode" has been defined in scripts.
                //Very handy (as it 99% the same for everything)
                workspaceDef.ConnectOutput("CubemapRendererNode", 0);
            }

            CompositorChannel channel = new CompositorChannel
            {
                target = tex.GetBuffer(0).GetRenderTarget()
            };

            channel.textures.Add(tex);
            _cubemapWorkspace = compositorManager.AddWorkspace(_sceneManager, channel, _cubeCamera, workspaceName, false);
        }
Ejemplo n.º 2
0
        protected virtual CompositorWorkspace SetupCompositor()
        {
            CompositorManager2 compositorManager = _root.CompositorManager2;
            string             workspaceName     = GetType().Name + "Workspace";

            if (!compositorManager.HasWorkspaceDefinition(workspaceName))
            {
                compositorManager.CreateBasicWorkspaceDef(workspaceName, _backgroundColor);
            }

            return(compositorManager.AddWorkspace(_sceneManager, _window, _camera, workspaceName));
        }
Ejemplo n.º 3
0
        protected override CompositorWorkspace SetupCompositor()
        {
            // The compositor scripts are also part of this sample. Go to Fresnel.compositor
            // to see the sample scripts on how to setup the rendering pipeline.
            CompositorManager2 compositorManager = _root.CompositorManager2;

            const string        workspaceName = "RttSampleWorkspace";
            CompositorWorkspace workspace     = compositorManager.AddWorkspace(
                _sceneManager, _window,
                _camera, workspaceName, true);

            workspace.SetListener(new RttWorkspaceListener(this));

            return(workspace);
        }