Beispiel #1
0
        public void Draw(DrawState state)
        {
            state.PushWorldTranslateMultiply(ref this.position);

            if (geometry.CullTest(state))
            {
                //draw the geometry
                shader.Bind(state);
                geometry.Draw(state);

                //now, if set, draw the wireframe too
                if (wireframeShader != null)
                {
                    wireframeShader.Bind(state);

                    //show the wireframe, disabling depth testing
                    state.PushRenderState();
                    state.RenderState.DepthColourCull.DepthTestEnabled = false;
                    //also set additive blending
                    state.RenderState.AlphaBlend = AlphaBlendState.Additive;
                    //set wireframe
                    state.RenderState.DepthColourCull.FillMode = FillMode.WireFrame;

                    //draw
                    geometry.Draw(state);

                    state.PopRenderState();
                }
            }

            state.PopWorldMatrix();
        }
        public void Draw(DrawState state)
        {
            state.PushWorldTranslateMultiply(ref position);

            DrawSphere(state);

            state.PopWorldMatrix();
        }
Beispiel #3
0
        public void Draw(DrawState state)
        {
            state.PushWorldTranslateMultiply(ref translation);

            //add the instance
            parent.AddInstance(state);

            state.PopWorldMatrix();
        }