Example #1
0
        private void DrawClouds(IRenderArgs renderArgs, Vector3 position)
        {
            // Clouds
            //	CloudsPlaneEffect.
            //	CloudsPlaneEffect.DiffuseColor = WorldSkyColor.ToVector3();
            CloudsPlaneEffect.FogColor = AtmosphereColor.ToVector3();
            CloudsPlaneEffect.World    = Matrix.CreateTranslation(0, 16, 0)
                                         * Matrix.CreateTranslation(position);

            renderArgs.GraphicsDevice.SetVertexBuffer(CloudsPlane);
            foreach (var pass in CloudsPlaneEffect.CurrentTechnique.Passes)
            {
                pass.Apply();
                renderArgs.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, 2);
            }
        }
Example #2
0
        private void DrawSky(IRenderArgs renderArgs, Vector3 position)
        {
            SkyPlaneEffect.FogColor = AtmosphereColor.ToVector3();
            SkyPlaneEffect.World    = Matrix.CreateRotationX(MathHelper.Pi)
                                      * Matrix.CreateTranslation(0, 16, 0)
                                      * Matrix.CreateTranslation(position);

            SkyPlaneEffect.DiffuseColor = SkyPlaneEffect.AmbientLightColor = WorldSkyColor.ToVector3();

            // Sky
            renderArgs.GraphicsDevice.SetVertexBuffer(SkyPlane);
            foreach (var pass in SkyPlaneEffect.CurrentTechnique.Passes)
            {
                pass.Apply();
                renderArgs.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, SkyPlane.VertexCount);
            }
        }