public void Render(RenderParamsListArray paramsListArray)
        {
            foreach(Emitter it in m_Emitters)
            {
                var device = Engine.Global.Device3d.GetDevice();
                // try to get the matched input-layout
                var layout = Engine.Global.Device3d.GetInputLayout("ParticleFX", Particle.ParticleVSIn.GetVertexDesc());
                device.ImmediateContext.InputAssembler.InputLayout = layout;
                device.ImmediateContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.PointList;
                device.ImmediateContext.InputAssembler.SetVertexBuffers(0, it.m_VBBinding);

                // setup effect
                float scale = 5.0f;
                Matrix objToWorld = Matrix.Transformation(new Vector3(scale),
                    Quaternion.Identity, new Vector3(1.0f, 1.0f, 1.0f), Vector3.Zero,
                    Quaternion.Identity, new Vector3(0.0f, 0.0f, 5.0f));

                var paramslist = new RenderParamsList();
                paramslist.Set("WorldXf", objToWorld);

                paramsListArray.Push(paramslist);

                var fx = Engine.Global.Device3d.GetEffect("ParticleFX");
                fx.Apply(paramsListArray);

                // draw
                device.ImmediateContext.Draw(it.GetNumAliveParticles(), 0);
                Engine.Global.Device3d.SetDefaultstate();

                paramsListArray.Pop();
            }
        }
Exemplo n.º 2
0
        public override void Render(RenderParamsListArray paramsListArray )
        {
            {
                var device = Engine.Global.Device3d.GetDevice();
                // try to get the matched input-layout
                var layout = Engine.Global.Device3d.GetInputLayout("Tess_Generic", m_VertDesc.Decl);
                device.ImmediateContext.InputAssembler.InputLayout = layout;
                device.ImmediateContext.InputAssembler.PrimitiveTopology = m_MeshDesc.Topology;
                device.ImmediateContext.InputAssembler.SetIndexBuffer(Engine.Global.Device3d.GetBuffer("QuadIB"), Format.R32_UInt, 0);
                device.ImmediateContext.InputAssembler.SetVertexBuffers(0, m_MeshDesc.VBBinding);

                // setup effect
                float scale = 5.0f;
                Matrix objToWorld = Matrix.Transformation(new Vector3(scale),
                    Quaternion.Identity, new Vector3(1.0f, 1.0f, 1.0f), Vector3.Zero,
                    Quaternion.Identity, new Vector3(0.0f, 0.0f, 20.0f));

                var paramslist = new RenderParamsList();
                paramslist.Set("WorldXf", objToWorld);
                paramslist.Set("g_TessFactor", m_TessParam);

                paramsListArray.Push(paramslist);

                var fx = Engine.Global.Device3d.GetEffect("Tess_Generic");
                fx.Apply(paramsListArray);

                // draw
                device.ImmediateContext.DrawIndexed(m_MeshDesc.IndexCount, 0, 0);
                Engine.Global.Device3d.SetDefaultstate();

                paramsListArray.Pop();
            }
        }
Exemplo n.º 3
0
 public virtual void Render(RenderParamsListArray paramsListArray)
 {
 }
Exemplo n.º 4
0
 public abstract void Apply(RenderParamsListArray paramsListArry);
Exemplo n.º 5
0
 public abstract void Apply(RenderParamsListArray paramsListArry);
Exemplo n.º 6
0
        public override void Render(RenderParamsListArray paramsListArray)
        {
            var device = Engine.Global.Device3d.GetDevice();
            // try to get the matched input-layout
            var layout = Engine.Global.Device3d.GetInputLayout("FxRendercraft_Terrain", m_VertDesc.Decl);
            device.ImmediateContext.InputAssembler.InputLayout = layout;
            device.ImmediateContext.InputAssembler.PrimitiveTopology = m_MeshDesc.Topology;
            //device.ImmediateContext.InputAssembler.SetIndexBuffer(Engine.Global.Device3d.GetBuffer("QuadIB"), Format.R32_UInt, 0);
            device.ImmediateContext.InputAssembler.SetVertexBuffers(0, m_MeshDesc.VBBinding);

            var paramslist = new RenderParamsList();
            paramslist.Set("WorldXf", Matrix.Identity);

            paramsListArray.Push(paramslist);

            var fx = Engine.Global.Device3d.GetEffect("FxRendercraft_Terrain");
            fx.Apply(paramsListArray);

            // draw
            device.ImmediateContext.Draw(m_MeshDesc.VertexCount, 0);
            Engine.Global.Device3d.SetDefaultstate();

            paramsListArray.Pop();
        }