コード例 #1
0
ファイル: Scene.cs プロジェクト: jesterKing/CCSycles
        /// <summary>
        /// Create a new scene with the given SceneParameters and Device
        /// </summary>
        /// <param name="client">The client from C[CS]ycles API</param>
        /// <param name="sceneParams">The SceneParameters to create scene with</param>
        /// <param name="device">The Device to create scene for</param>
        public Scene(Client client, SceneParameters sceneParams, Device device)
        {
            Client = client;
            Id = CSycles.scene_create(Client.Id, sceneParams.Id, device.Id);
            Background = new Background(this);
            Camera = new Camera(this);
            Integrator = new Integrator(this);
            Film = new Film(this);
            Device = device;

            /* add simple wrappers for shadermanager created default shaders */
            var surface = Shader.WrapDefaultSurfaceShader(client);
            var light = Shader.WrapDefaultLightShader(client);
            var background = Shader.WrapDefaultBackgroundShader(client);
            var empty = Shader.WrapDefaultEmptyShader(client);

            /* register the wrapped shaders with scene */
            m_shader_in_scene_ids.Add(surface, surface.Id);
            m_shader_in_scene_ids.Add(background, background.Id);
            m_shader_in_scene_ids.Add(light, light.Id);
            m_shader_in_scene_ids.Add(empty, empty.Id);

            DefaultSurface = surface;

            // set ourself to client as reference
            client.Scene = this;
        }
コード例 #2
0
        /// <summary>
        /// Create a new scene with the given SceneParameters and Device
        /// </summary>
        /// <param name="client">The client from C[CS]ycles API</param>
        /// <param name="sceneParams">The SceneParameters to create scene with</param>
        /// <param name="device">The Device to create scene for</param>
        public Scene(Client client, SceneParameters sceneParams, Device device)
        {
            Client     = client;
            Id         = CSycles.scene_create(Client.Id, sceneParams.Id, device.Id);
            Background = new Background(this);
            Camera     = new Camera(this);
            Integrator = new Integrator(this);
            Film       = new Film(this);
            Device     = device;

            /* add simple wrappers for shadermanager created default shaders */
            var surface    = Shader.WrapDefaultSurfaceShader(client);
            var light      = Shader.WrapDefaultLightShader(client);
            var background = Shader.WrapDefaultBackgroundShader(client);
            var empty      = Shader.WrapDefaultEmptyShader(client);

            /* register the wrapped shaders with scene */
            m_shader_in_scene_ids.Add(surface, surface.Id);
            m_shader_in_scene_ids.Add(background, background.Id);
            m_shader_in_scene_ids.Add(light, light.Id);
            m_shader_in_scene_ids.Add(empty, empty.Id);

            DefaultSurface = surface;

            // set ourself to client as reference
            client.Scene = this;
        }