Ejemplo n.º 1
0
        void DrawTieMRT(TieFighter tie)
        {
            Matrix world;

            MRTmodelNormal.SetValue(TieNormalTex);
            foreach (var mesh in TieModel.Meshes)
            {
                world = mesh.ParentBone.Transform * tie.SRT;

                var wvp = world * Game.SelectedCamera.View * Game.SelectedCamera.Projection;
                MRTworld.SetValue(world);
                MRTtexture.SetValue(TieTexture);
                MRTworldViewProjection.SetValue(wvp);
                MRTinverseTransposeWorld.SetValue(Matrix.Transpose(Matrix.Invert(world)));
                mesh.Draw();
            }
        }
Ejemplo n.º 2
0
        void DrawTieMRT(Ship tie)
        {
            Matrix world;

            //MasterMRT.Parameters["ApplyShieldEffect"]?.SetValue(1f);
            //MasterMRT.Parameters["ShieldColor"]?.SetValue(new Vector3(0.8f, 0f, 0f));

            MRTmodelNormal.SetValue(TieNormalTex);
            foreach (var mesh in TieModel.Meshes)
            {
                world = mesh.ParentBone.Transform * tie.SRT;

                var wvp = world * Game.SelectedCamera.View * Game.SelectedCamera.Projection;
                MRTworld.SetValue(world);
                MRTtexture.SetValue(TieTexture);
                MRTworldViewProjection.SetValue(wvp);
                MRTinverseTransposeWorld.SetValue(Matrix.Transpose(Matrix.Invert(world)));
                mesh.Draw();
            }
            //MasterMRT.Parameters["ApplyShieldEffect"]?.SetValue(0f);
        }
Ejemplo n.º 3
0
        void DrawXWingMRT(Xwing xwing, DrawType dt)
        {
            int meshCount = 0;

            if (dt == DrawType.Regular)
            {
                MasterMRT.CurrentTechnique = MRTbasicColor;
            }

            //MRTapplyLightEffect.SetValue(0f);

            MRTaddToBloomFilter.SetValue(1f);
            DrawModelMRT(XwingEnginesModel, xwing.EnginesSRT, xwing.EnginesColor);
            MRTaddToBloomFilter.SetValue(0f);

            //MRTapplyLightEffect.SetValue(1f);

            if (dt == DrawType.Regular)
            {
                MasterMRT.CurrentTechnique = MRTtextured;
            }

            foreach (var mesh in XwingModel.Meshes)
            {
                xwing.World = mesh.ParentBone.Transform * xwing.SRT;

                var wvp = xwing.World * Game.SelectedCamera.View * Game.SelectedCamera.Projection;

                MRTtexture.SetValue(XwingTextures[meshCount]);
                MRTmodelNormal.SetValue(XwingNormalTex[meshCount]);
                MRTworld.SetValue(xwing.World);
                MRTworldViewProjection.SetValue(wvp);
                MRTinverseTransposeWorld.SetValue(Matrix.Transpose(Matrix.Invert(xwing.World)));
                meshCount++;

                mesh.Draw();
            }
        }
Ejemplo n.º 4
0
        void DrawXwingMRT(Ship xwing)
        {
            Matrix world;
            int    meshCount = 0;

            foreach (var mesh in XwingModel.Meshes)
            {
                world = mesh.ParentBone.Transform * xwing.SRT;

                var wvp = world * Game.SelectedCamera.View * Game.SelectedCamera.Projection;
                //var itw = Matrix.Transpose(Matrix.Invert(xwing.World));

                MRTtexture.SetValue(XwingTextures[meshCount]);
                MRTmodelNormal.SetValue(XwingNormalTex[meshCount]);
                MRTworld.SetValue(world);
                MRTworldViewProjection.SetValue(wvp);
                //EPMRTlightViewProjection.SetValue(world * Game.LightCamera.View * Game.LightCamera.Projection);
                MRTinverseTransposeWorld.SetValue(Matrix.Transpose(Matrix.Invert(world)));
                meshCount++;

                mesh.Draw();
            }
        }