public static void RenderFullScreenQuad(ShaderResourceView srv)
        {
            Shader e = WorldData.GetObject("FullScreenQuad.fx") as Shader;

            if (e == null)
            {
                return;
            }
            ShaderHelper.UpdateCommonEffectVars(e, Matrix.Identity);
            EffectTechnique t = e.EffectObj.GetTechniqueByName("FullScreen");

            Game.Device.InputAssembler.SetPrimitiveTopology(PrimitiveTopology.TriangleList);

            for (int p = 0; p < t.Description.PassCount; p++)
            {
                EffectPass  pass = t.GetPassByIndex(p);
                InputLayout l    = ShaderHelper.ConstructInputLayout(MeshInputElements10.FullScreenQuad, pass.Description.Signature);
                Game.Device.InputAssembler.SetInputLayout(l);

                EffectResourceVariable diffTex = e.GetVar(ShaderHelper.DiffTex).AsResource();
                if (diffTex != null)
                {
                    diffTex.SetResource(srv);
                }
                pass.Apply();
                Game.Device.Draw(3, 0);
            }
        }
        public static void RenderMesh2(Model m, Vector3 position, string effectName, string technique, Matrix mWorld, int stride)
        {
            if (m == null || m.MeshObj == null)
            {
                return;
            }
            Shader e     = WorldData.GetObject(effectName) as Shader;
            Matrix world = Matrix.Identity + Matrix.Translation(position);

            if (mWorld != null)
            {
                world = mWorld;
            }
            ShaderHelper.UpdateCommonEffectVars(e, world);

            EffectTechnique t = e.EffectObj.GetTechniqueByName(technique);

            D3D10.Buffer indexBuffer   = m.MeshObj.GetDeviceIndexBuffer();
            D3D10.Buffer vertextBuffer = m.MeshObj.GetDeviceVertexBuffer(0);

            Game.Device.InputAssembler.SetPrimitiveTopology(PrimitiveTopology.TriangleList);
            Game.Device.InputAssembler.SetIndexBuffer(indexBuffer, Format.R16_UInt, 0);
            Game.Device.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(vertextBuffer, stride, 0));

            for (int p = 0; p < t.Description.PassCount; p++)
            {
                EffectPass  pass = t.GetPassByIndex(p);
                InputLayout l    = ShaderHelper.ConstructInputLayout(m.Mesh3d.inputElements, pass.Description.Signature);
                Game.Device.InputAssembler.SetInputLayout(l);

                for (int subset = 0; subset < m.Mesh3d.NumAttributes; subset++)
                {
                    EffectResourceVariable diffTex = e.GetVar(ShaderHelper.DiffTex).AsResource();
                    if (diffTex != null)
                    {
                        diffTex.SetResource(m.Mesh3d.textureViews[subset]);
                    }
                    pass.Apply();
                    MeshAttributeRange r = m.Mesh3d.attrTable[subset];
                    // * 2 cause adj data is twice as much data
                    //Game.Device.DrawIndexed((r.FaceCount * 3) * 2, (r.FaceStart * 3) * 2, 0);

                    Game.Device.DrawIndexed((r.FaceCount * 3), (r.FaceStart * 3), 0);
                }
            }

            indexBuffer.Dispose();
            vertextBuffer.Dispose();
        }
        public static void RenderVertices(VertexBufferBinding vbb, int numVertices, Matrix world, InputElement[] inputElements, string effectName, string technique)
        {
            Shader e = WorldData.GetObject(effectName) as Shader;

            ShaderHelper.UpdateCommonEffectVars(e, world);
            EffectTechnique t = e.EffectObj.GetTechniqueByName(technique);

            Game.Device.InputAssembler.SetPrimitiveTopology(PrimitiveTopology.LineList);
            Game.Device.InputAssembler.SetVertexBuffers(0, vbb);

            for (int p = 0; p < t.Description.PassCount; p++)
            {
                EffectPass  pass = t.GetPassByIndex(p);
                InputLayout l    = ShaderHelper.ConstructInputLayout(inputElements, pass.Description.Signature);
                Game.Device.InputAssembler.SetInputLayout(l);

                pass.Apply();
                Game.Device.Draw(numVertices, 0);
            }
        }