Пример #1
0
        /// <summary>
        /// Function to create the shader.
        /// </summary>
        /// <param name="byteCode">Byte code for the shader.</param>
        protected override void CreateShader(Compiler.ShaderBytecode byteCode)
        {
            if (D3DShader != null)
            {
                D3DShader.Dispose();
            }

            D3DShader = new D3D.GeometryShader(Graphics.D3DDevice, byteCode, _elements, _elementSizes, RasterizedStream)
            {
#if DEBUG
                DebugName = string.Format("Gorgon Geometry Shader '{0}'", Name)
#endif
            };
        }
Пример #2
0
        public D3DGraphic(SystemConfiguration windowConfig)
        {
            this.windowConfig = windowConfig;

            ShaderName shaderName = ShaderName.Texture;
            IShape shape = new Box2();
            ModelShader.Get(shaderName, shape);

            d3d = new D3D11(windowConfig);
            camera = new Camera();

            model = new Bitmap(d3d.Device, ModelShader.GetShaderEffect, shaderName, this.windowConfig, new Vector2(256, 256));

            //model = new D3DModel(d3d.Device, ModelShader.GetModelForRender, ModelShader.GetIndexes);
            shader = new D3DShader(d3d.Device, ModelShader.GetShaderEffect, shaderName);

            graph.Add(d3d);
            graph.Add(model);
            graph.Add(shader);

            //camera.Position = new Vector3(-2, 1, -3);
             camera.Position = new Vector3(0.0f, 0.0f, -10.0f);
        }
Пример #3
0
        public D3DGraphic(SystemConfiguration windowConfig)
        {
            this.windowConfig = windowConfig;

            ShaderName shaderName = ShaderName.Texture;
            IShape     shape      = new Box2();

            ModelShader.Get(shaderName, shape);

            d3d    = new D3D11(windowConfig);
            camera = new Camera();

            model = new Bitmap(d3d.Device, ModelShader.GetShaderEffect, shaderName, this.windowConfig, new Vector2(256, 256));

            //model = new D3DModel(d3d.Device, ModelShader.GetModelForRender, ModelShader.GetIndexes);
            shader = new D3DShader(d3d.Device, ModelShader.GetShaderEffect, shaderName);

            graph.Add(d3d);
            graph.Add(model);
            graph.Add(shader);

            //camera.Position = new Vector3(-2, 1, -3);
            camera.Position = new Vector3(0.0f, 0.0f, -10.0f);
        }