Ejemplo n.º 1
0
        public void UpdateAmbient(int index)
        {
            CubeMapFace face        = (CubeMapFace)index;
            Surface     cubeSurface = m_ambientRT.GetCubeMapSurface(face, 0);

            MyMinerGame.Static.GraphicsDevice.SetRenderTarget(0, cubeSurface);
            BlendState.Opaque.Apply();

            MyEffectAmbientPrecalculation precalc = MyRender.GetEffect(MyEffects.AmbientMapPrecalculation) as MyEffectAmbientPrecalculation;

            precalc.SetEnvironmentMap(this.m_environmentRT);
            precalc.SetFaceMatrix(CreateViewMatrix(face, Vector3.Zero));
            precalc.SetRandomTexture(MyRender.GetRandomTexture());
            precalc.SetIterationCount(14);
            precalc.SetMainVectorWeight(1.0f);
            precalc.SetBacklightColorAndIntensity(new Vector3(MyRender.Sun.BackColor.X, MyRender.Sun.BackColor.Y, MyRender.Sun.BackColor.Z), MyRender.Sun.BackIntensity);
            MyGuiManager.GetFullscreenQuad().Draw(precalc);

            MyMinerGame.SetRenderTarget(null, null);
            cubeSurface.Dispose();
        }