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);
        }
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("effects/TransparentOnBorder");
     effectdistorcion = factory.GetEffect("effects/effect2");
     target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
     SetBlurEffectParameters(1f / (float)ginfo.BackBufferWidth, 1f / (float)ginfo.BackBufferHeight);
 }
        public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
        {
            switch (BlurRadiusSize)
            {
                case BlurRadiusSize.Fifteen:
                    effect = factory.GetEffect("sblur", true,true); 
                    break;
                case BlurRadiusSize.Seven:
                    effect = factory.GetEffect("sblur2", true, true); 
                    break;
                case BlurRadiusSize.Three:
                    effect = factory.GetEffect("sblur3", true, true); 
                    break;
                default:
                    ActiveLogger.LogMessage("Wrong Blur Radius Size Specified", LogLevel.RecoverableError);
                    effect = factory.GetEffect("sblur", true, true); 
                    break;
            }

            if (!destinySize.HasValue)
            {
                destinySize = new Vector2(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
            }

            if (SurfaceFormat.HasValue)
            {
                if (SurfaceFormat.Value == Microsoft.Xna.Framework.Graphics.SurfaceFormat.Single ||
                    SurfaceFormat.Value == Microsoft.Xna.Framework.Graphics.SurfaceFormat.HalfSingle)
                {
                    effect.CurrentTechnique = effect.Techniques["GAUSSSingle"];
                }
                else
                {
                    effect.CurrentTechnique = effect.Techniques["GAUSSTriple"];
                }
                RenderTarget2D = factory.CreateRenderTarget((int)destinySize.Value.X, (int)destinySize.Value.Y, SurfaceFormat.Value);
            }
            else
            {
                RenderTarget2D = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);                
            }

            ComputeKernel(BLUR_RADIUS, BLUR_AMOUNT);
            if (OriginSize.HasValue)
            {
                ComputeOffsets(OriginSize.Value.X, OriginSize.Value.Y);
            }
            else
            {
                ComputeOffsets(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
            }
        }
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     eff = factory.GetEffect("Effects/MotionBlurComplete");
     effectvelocity = factory.GetEffect("Effects/VelocityTextureMotionBlur");
     if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.Vector2, DepthFormat.None, false, 0))
     {
         rt = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Vector2);
     }
     else
     {
         throw new Exception("required Buffer precision not found (Vector 2)");
     }
 }
        protected override void AfterLoadContent(IContentManager manager, PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
        {
            base.AfterLoadContent(manager, ginfo, factory);
            this.ginfo = ginfo;

            pointLightEffect = factory.GetEffect("PrePass/plight");
            _clearGBuffer = factory.GetEffect("PrePass/ClearGBuffer");
            _lighting = factory.GetEffect("PrePass/LightingLpp");            

             sphereModel = new SimpleModel(factory, "Model/Dsphere"); 
            ForwardPass = new ForwardPass(ForwardPassDescription.Default());
            _width = ginfo.BackBufferWidth;
            _height = ginfo.BackBufferHeight;            
            
            _cwDepthState = new DepthStencilState();
            _cwDepthState.DepthBufferWriteEnable = false;
            _cwDepthState.DepthBufferFunction = CompareFunction.LessEqual;

            _ccwDepthState = new DepthStencilState();
            _ccwDepthState.DepthBufferWriteEnable = false;
            _ccwDepthState.DepthBufferFunction = CompareFunction.GreaterEqual;

            _directionalDepthState = new DepthStencilState(); ;
            _directionalDepthState.DepthBufferWriteEnable = false;
            _directionalDepthState.DepthBufferFunction = CompareFunction.Greater;


            _depthStateDrawLights = new DepthStencilState();

            //we draw our volumes with front-face culling, so we have to use GreaterEqual here
            _depthStateDrawLights.DepthBufferFunction = CompareFunction.GreaterEqual;
            //with our z-buffer reconstructed we only need to read it
            _depthStateDrawLights.DepthBufferWriteEnable = false;
            
            _depthStateReconstructZ = new DepthStencilState
            {
                DepthBufferEnable = true,
                DepthBufferWriteEnable = true,
                DepthBufferFunction = CompareFunction.Always
            };

            _lightAddBlendState = new BlendState()
                {
                    AlphaSourceBlend = Blend.One,
                    ColorSourceBlend = Blend.One,
                    AlphaDestinationBlend = Blend.One,
                    ColorDestinationBlend = Blend.One,
                };

            CreateGBuffer(factory);            
        }
 public override void Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, IObject obj)
 {
     Effect = factory.GetEffect("Effects/baker");
     base.Initialize(ginfo, factory, obj);
     Effect.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);
     rt = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
 }
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     Effect = factory.GetEffect("ssao",false,true);
     tex = factory.GetTexture2D("noisetex", true);
     sBlurPost = new SBlurPost(blurAmount, BlurRadiusSize);
     sBlurPost.Init(ginfo, factory);
     RenderTarget2D = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
     RenderTarget2D2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
 }
            public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
            {
                shader = factory.GetEffect("HBAO\\HorizonBasedAmbientOcclusion");
                Texture randomNormalTexture = factory.GetTexture2D("HBAO\\RandomNormal");
                shader.Parameters["randomTexture"].SetValue(randomNormalTexture);
                
                epResolution = shader.Parameters["resolution"];
                epInverseResolution = shader.Parameters["invResolution"];
                epNumberSteps = shader.Parameters["numberSteps"];
                epNumberDirections = shader.Parameters["numberDirections"];
                epContrast = shader.Parameters["contrast"];
                epLineAttenuation = shader.Parameters["attenuation"];
                epRadius = shader.Parameters["radius"];
                epAngleBias = shader.Parameters["angleBias"];
                // Others
                epFocalLength = shader.Parameters["focalLength"];
                epInvFocalLength = shader.Parameters["invFocalLength"];
                epHalfPixel = shader.Parameters["halfPixel"];
                epSqrRadius = shader.Parameters["sqrRadius"];
                epInvRadius = shader.Parameters["invRadius"];
                epTanAngleBias = shader.Parameters["tanAngleBias"];

                RenderTarget2D = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
                RenderTarget2D2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
                depthrender = factory.CreateRenderTarget(ginfo.BackBufferWidth , ginfo.BackBufferHeight, SurfaceFormat.Single,true);

                g = new GaussianBlurPostEffect(false);
                g.Init(ginfo, factory);
                renderdepth = factory.GetEffect("HBAO\\generateDepth");
                ssaofinal = factory.GetEffect("ssaofinal", false, true);

            }
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("Effects/backgroundTexture");
     BackGroundTexture = factory.GetTexture2D(BackTextureName);
     
 }
        public override void  Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
        {
 	        base.Initialize(ginfo, factory, obj);
            this._shader = factory.GetEffect("WaterComplete",true,true);         
            refractionRT = factory.CreateRenderTarget(WIDTH,HEIGHT);
            reflectionRT = factory.CreateRenderTarget(WIDTH, HEIGHT);
            normal0 = factory.GetTexture2D("wave0", true);
            normal1 = factory.GetTexture2D("wave1", true);                                    
        }        
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("Night",false,true);
     tex = factory.GetTexture2D("noise_tex6",true);
 }
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("Effects/AdvancedColorTone");
 }
 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);
 }
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 /// <param name="ginfo"></param>
 /// <param name="factory"></param>
 /// <param name="obj"></param>
 public override void Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
 {
     this._shader = factory.GetEffect("Effects//ShatterEffect");            
     base.Initialize(ginfo, factory, obj);
 }
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("Effects/dream");
 }
 protected override void LoadContent(PloobsEngine.Engine.GraphicInfo GraphicInfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     effect =  factory.GetEffect("Effects/decal"); 
     base.LoadContent(GraphicInfo, factory);
     this.GraphicInfo = GraphicInfo;
 }
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        /// <param name="ginfo"></param>
        /// <param name="factory"></param>
        /// <param name="obj"></param>
        public override void Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
        {
            this._shader = factory.GetEffect(effect,true,true);            
            base.Initialize(ginfo, factory, obj);

            PProjection = this._shader.Parameters["Projection"];
            PView = this._shader.Parameters["View"];
            PuseSpecular = this._shader.Parameters["useSpecular"];
            PuseBump = this._shader.Parameters["useBump"];
            PuseGlow = this._shader.Parameters["useGlow"];
            PuseParalax = this._shader.Parameters["useParalax"];
            Pid = this._shader.Parameters["id"];
            //PTexture = this._shader.Parameters["Texture"];
            PspecularPowerScale = this._shader.Parameters["specularPowerScale"]; 
            PspecularIntensityScale = this._shader.Parameters["specularIntensityScale"];
            PspecularPower = this._shader.Parameters["specularPower"];
            PspecularIntensity = this._shader.Parameters["specularIntensity"];
            PWorld = this._shader.Parameters["World"];
            PWorldInverseTranspose = this._shader.Parameters["WorldInverseTranspose"];
            //PNormalMap = this._shader.Parameters["NormalMap"];
            //PSpecularMap = this._shader.Parameters["SpecularMap"];
            //Pglow = this._shader.Parameters["glow"];
            //PAmbientCube = this._shader.Parameters["ambientcube"];
            PAmbientCubeMapScale = this._shader.Parameters["ambientScale"];

            if (useAmbientCubeMap == true )
            {
                this._shader.CurrentTechnique = this._shader.Techniques["Technique2"];
            }
            else
            {
                this._shader.CurrentTechnique = this._shader.Techniques["Technique1"];
            }

        }
 public override void Init(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("MotionBlur",false,true);
 }
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        /// <param name="ginfo"></param>
        /// <param name="factory"></param>
        /// <param name="obj"></param>
        public override void Initialize(PloobsEngine.Engine.GraphicInfo ginfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IObject obj)
        {
            this._shader = factory.GetEffect(effect,false,true);            
            base.Initialize(ginfo, factory, obj);

            PProjection = this._shader.Parameters["Projection"];
            PView = this._shader.Parameters["View"];
            PuseSpecular = this._shader.Parameters["useSpecular"];
            PuseBump = this._shader.Parameters["useBump"];
            PuseGlow = this._shader.Parameters["useGlow"];
            PCameraPos = this._shader.Parameters["CameraPos"];
            Pid = this._shader.Parameters["id"];
            //PTexture = this._shader.Parameters["Texture"];
            PspecularPowerScale = this._shader.Parameters["specularPowerScale"]; 
            PspecularIntensityScale = this._shader.Parameters["specularIntensityScale"];
            PspecularPower = this._shader.Parameters["specularPower"];
            PspecularIntensity = this._shader.Parameters["specularIntensity"];
            PWorld = this._shader.Parameters["World"];
            PWorldInverseTranspose = this._shader.Parameters["WorldInverseTranspose"];
            //PNormalMap = this._shader.Parameters["NormalMap"];
            //PSpecularMap = this._shader.Parameters["SpecularMap"];
            //Pglow = this._shader.Parameters["glow"];
            PreflectionIndex = this._shader.Parameters["reflectionIndex"];
            //PDiffuse = this._shader.Parameters["DifTex"];
        }