Beispiel #1
0
 public override void BasicDraw(GameTime gt, PloobsEngine.SceneControl.IObject obj, ref Matrix view, ref Matrix projection, IList <PloobsEngine.Light.ILight> lights, PloobsEngine.SceneControl.RenderHelper render, Plane?clippingPlane, bool useAlphaBlending = false)
 {
     if (CastShadowAndReflection)
     {
         base.BasicDraw(gt, obj, ref view, ref projection, lights, render, clippingPlane, useAlphaBlending);
     }
 }
Beispiel #2
0
 public override void DepthExtractor(GameTime gt, PloobsEngine.SceneControl.IObject obj, ref Matrix View, ref Matrix projection, PloobsEngine.SceneControl.RenderHelper render)
 {
     if (CastShadowAndReflection)
     {
         base.DepthExtractor(gt, obj, ref View, ref projection, render);
     }
 }
Beispiel #3
0
 protected override void Draw(Microsoft.Xna.Framework.GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList <PloobsEngine.Light.ILight> lights)
 {
     render.PushBlendState(laser_blends);
     effect.CurrentTechnique = effect_technique;
     world.SetValue(obj.WorldMatrix);
     wvp.SetValue(shader_matrices_combined[1] = obj.WorldMatrix * cam.View * cam.Projection);
     effect_color.SetValue(color.ToVector4());
     effect_center_to_viewer.SetValue(cam.Position);
     render.RenderBatch(obj.Modelo.GetBatchInformation(0)[0], effect);
     render.PopBlendState();
 }
Beispiel #4
0
        public override void PosDrawPhase(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList <PloobsEngine.Light.ILight> lights)
        {
            Matrix wld = obj.WorldMatrix;

            for (int i = 0; i < obj.Modelo.MeshNumber; i++)
            {
                BatchInformation[] bi = obj.Modelo.GetBatchInformation(i);
                for (int j = 0; j < bi.Count(); j++)
                {
                    this._shader2.Parameters["DiffuseMap"].SetValue(obj.Modelo.GetTextureInformation(i)[j].getTexture(TextureType.DIFFUSE));
                    Matrix w1 = Matrix.Multiply(bi[j].ModelLocalTransformation, wld);
                    this._shader2.Parameters["worldViewProjection"].SetValue(w1 * cam.ViewProjection);
                    this._shader2.Parameters["lightSamplerBuffer"].SetValue(render[PrincipalConstants.lightRt]);
                    this._shader2.Parameters["LightBufferPixelSize"].SetValue(new Vector2(0.5f / render[PrincipalConstants.lightRt].Width, 0.5f / render[PrincipalConstants.lightRt].Height));
                    render.RenderBatch(bi[j], _shader2);
                }
            }
        }
Beispiel #5
0
        /// <summary>
        /// Normal Drawn Function.
        /// </summary>
        /// <param name="gt">The gt.</param>
        /// <param name="obj">The obj.</param>
        /// <param name="cam">The cam.</param>
        /// <param name="lights">The lights.</param>
        /// <param name="render">The render.</param>
        public void Drawn(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.Cameras.ICamera cam, System.Collections.Generic.IList <PloobsEngine.Light.ILight> lights, PloobsEngine.SceneControl.RenderHelper render)
        {
            if (first)
            {
                _terrainModel.Initialize(cam, render.device);
                first = false;
            }

            if (_terrainModel.Effect is IEffectMatrices)
            {
                IEffectMatrices effectMatrices = (IEffectMatrices)_terrainModel.Effect;
                effectMatrices.World      = obj.WorldMatrix;
                effectMatrices.View       = cam.View;
                effectMatrices.Projection = cam.Projection;
            }

            render.SetSamplerStates(SamplerState.LinearWrap, 6);
            _terrainModel.Draw();
            render.SetSamplerStates(ginfo.SamplerState, 6);
        }
Beispiel #6
0
        protected override void Draw(Microsoft.Xna.Framework.GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList <PloobsEngine.Light.ILight> lights)
        {
            this._shader.Parameters["FarClip"].SetValue(cam.FarPlane);
            this._shader.Parameters["View"].SetValue(cam.View);
            this._shader.Parameters["Projection"].SetValue(cam.Projection);

            Matrix wld = obj.WorldMatrix;

            for (int i = 0; i < obj.Modelo.MeshNumber; i++)
            {
                BatchInformation[] bi = obj.Modelo.GetBatchInformation(i);
                for (int j = 0; j < bi.Count(); j++)
                {
                    Matrix w1 = Matrix.Multiply(bi[j].ModelLocalTransformation, wld);
                    this._shader.Parameters["World"].SetValue(w1);
                    this._shader.Parameters["VPIT"].SetValue(Matrix.Transpose(Matrix.Invert(w1 * cam.View)));
                    render.RenderBatch(bi[j], _shader);
                }
            }
        }
Beispiel #7
0
        public override void PosDrawPhase(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList <PloobsEngine.Light.ILight> lights)
        {
            render.PushRasterizerState(cullMode);
            render.PushBlendState(BlendState.NonPremultiplied);
            alphagradative.Parameters["camCenter"].SetValue(cam.Position);

            for (int i = 0; i < obj.Modelo.MeshNumber; i++)
            {
                BatchInformation[] bi = obj.Modelo.GetBatchInformation(i);

                for (int j = 0; j < bi.Count(); j++)
                {
                    alphagradative.Parameters["colorMap"].SetValue(obj.Modelo.getTexture(TextureType.DIFFUSE, i, j));
                    Matrix w1 = Matrix.Multiply(obj.WorldMatrix, bi[j].ModelLocalTransformation);
                    alphagradative.Parameters["wvp"].SetValue(w1 * cam.ViewProjection);
                    alphagradative.Parameters["w"].SetValue(w1);

                    render.RenderBatch(bi[j], alphagradative);
                }
            }
            render.PopBlendState();
            render.PopRasterizerState();
        }
Beispiel #8
0
 /// <summary>
 /// Initializations the specified Material.
 /// </summary>
 /// <param name="ginfo">The ginfo.</param>
 /// <param name="factory">The factory.</param>
 /// <param name="obj">The obj.</param>
 public void Initialization(GraphicInfo ginfo, GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
 {
     this.ginfo = ginfo;
 }
Beispiel #9
0
 /// <summary>
 /// Update.
 /// </summary>
 /// <param name="gametime">The gametime.</param>
 /// <param name="obj">The obj.</param>
 /// <param name="world">The world.</param>
 /// ///
 public void Update(GameTime gametime, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.IWorld world)
 {
     _terrainModel.Update(world.CameraManager.ActiveCamera);
 }
 public override void Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
 {
     this.ginfo = ginfo;
     base.Initialize(ginfo, factory, obj);
 }
Beispiel #11
0
 public override void Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
 {
     alphagradative = factory.GetEffect("effects/alphagradative");
     base.Initialize(ginfo, factory, obj);
 }
Beispiel #12
0
 public void AfterAdded(PloobsEngine.SceneControl.IObject obj)
 {
 }
Beispiel #13
0
 public void Drawn(Microsoft.Xna.Framework.GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.Cameras.ICamera cam, IList <PloobsEngine.Light.ILight> lights, PloobsEngine.SceneControl.RenderHelper render)
 {
     ForwardEnvironmentShader.iDraw(gt, obj, render, cam, lights);
 }
Beispiel #14
0
 /// <summary>
 /// Pos drawn Function.
 /// Called after all objects are Draw
 /// </summary>
 /// <param name="gt">The gt.</param>
 /// <param name="obj">The obj.</param>
 /// <param name="cam">The cam.</param>
 /// <param name="lights">The lights.</param>
 /// <param name="render">The render.</param>
 public void PosDrawnPhase(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.Cameras.ICamera cam, System.Collections.Generic.IList <PloobsEngine.Light.ILight> lights, PloobsEngine.SceneControl.RenderHelper render)
 {
 }
Beispiel #15
0
 public void Initialization(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
 {
     RenderTargetCube         = factory.CreateRenderTargetCube(512, SurfaceFormat.Color, false, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.PreserveContents);
     ForwardEnvironmentShader = new ForwardEnvironmentShader(RenderTargetCube, 1, true);
     ForwardEnvironmentShader.Initialize(ginfo, factory, obj);
 }
Beispiel #16
0
 public void PosDrawnPhase(Microsoft.Xna.Framework.GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.Cameras.ICamera cam, IList <PloobsEngine.Light.ILight> lights, PloobsEngine.SceneControl.RenderHelper render)
 {
 }
Beispiel #17
0
 public void Update(Microsoft.Xna.Framework.GameTime gametime, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.IWorld world)
 {
     ForwardEnvironmentShader.Update(gametime, obj, world.Lights);
 }
Beispiel #18
0
        public void PreDrawnPhase(Microsoft.Xna.Framework.GameTime gt, PloobsEngine.SceneControl.IWorld mundo, PloobsEngine.SceneControl.IObject obj, PloobsEngine.Cameras.ICamera cam, IList <PloobsEngine.Light.ILight> lights, PloobsEngine.SceneControl.RenderHelper render)
        {
            Vector3 pos = obj.PhysicObject.Position;

            render.PushRasterizerState(d);
            render.RenderSceneToTextureCube(RenderTargetCube,
                                            Color.AliceBlue, mundo, ref pos, gt, true, false, new List <PloobsEngine.SceneControl.IObject>()
            {
                obj
            });
            render.PopRasterizerState();
        }
Beispiel #19
0
 public override void Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
 {
     _shader2 = factory.GetEffect("PrePass2/ShaderPass");
     _shader  = factory.GetEffect("PrePass2/renderobj");
     base.Initialize(ginfo, factory, obj);
 }
Beispiel #20
0
 public void Initialization(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
 {
     RenderTargetCube         = factory.CreateRenderTargetCube(128, SurfaceFormat.Color, false, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents);
     ForwardEnvironmentShader = new ForwardEnvironmentShader(RenderTargetCube, 0.5f, false);
     ForwardEnvironmentShader.Initialize(ginfo, factory, obj);
     //ForwardEnvironmentShader.EnvironmentMapEffect.EnableDefaultLighting();
 }