public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {
     this.toon = factory.GetEffect("toon1",false,true);
     this.line = factory.GetEffect("LineDetection",false,true);
     this.cell = factory.GetTexture2D("Toon",true);            
     target = factory.CreateRenderTarget(ginfo.BackBufferWidth,ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
 }
 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {
     //Load the asset
     effect = factory.GetEffect("gamma",true,true);            
     switch (_gType)
     {
         case GammaType.Normal:
             effect.CurrentTechnique = effect.Techniques[0];
             break;
         case GammaType.Simple:
             effect.CurrentTechnique = effect.Techniques[1];
             break;
         case GammaType.InvertNormal:
             effect.CurrentTechnique = effect.Techniques[2];
             break;
         case GammaType.InvertSimple:
             effect.CurrentTechnique = effect.Techniques[3];
             break;
         case GammaType.VerySimple:
             effect.CurrentTechnique = effect.Techniques[4];
             break;
         case GammaType.InvertVerySimple:
             effect.CurrentTechnique = effect.Techniques[5];
             break;
         default:
             break;
     }
 }
 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {           
     depht = factory.GetEffect("depth",false,true);
     target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,
         ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
     be= new GaussianBlurPostEffect();
     be.Init(ginfo, factory); 
 }
        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
            target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);            
            effect = factory.GetEffect("glowPost",false,true);

            gbp = new GaussianBlurPostEffect();
            gbp.Init(ginfo, factory); 


        }
 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {
     //Load the asset
     effect = factory.GetEffect("colorCorrection",false,true);            
 }
 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {
     
     effect = factory.GetEffect("Sun",false,true);
     if (flareTexture==null)
         tex = factory.GetTexture2D("flare",true);
     else
         tex = factory.GetTexture2D(flareTexture);          
 }
 public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor, bool useFloatBuffer)
 {
     this.backGroundColor = BackGroundColor;
     colorRT2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, 8, RenderTargetUsage.DiscardContents);
     colorRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents);
     normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
     depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
     lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);            
     clearBufferEffect = manager.GetAsset<Effect>("ClearGBuffer",true);
     effect = factory.GetEffect("Effects//hibe");
     
 }
 public override void  Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {         
     effect = factory.GetEffect("BlackWhite",false,true);            
 }
 public override void Initialize(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, IObject obj)        
 {
     this._shader = factory.GetEffect("SphericalBillboard",true,true);
     base.Initialize(ginfo, factory, obj);
 }
 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("AntiAliasing",false,true);        
 }
        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);

            target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);

            target3 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);

            effect = factory.GetEffect("SSAOPOST", false, true);
            ssaofinal = factory.GetEffect("ssaofinal", false, true);

            RandomTexture = factory.GetTexture2D("random", true);
            gbp = new GaussianBlurPostEffect();
            gbp.Init(ginfo, factory);
        }
        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            effect = factory.GetEffect("Fog",false,true);                        

            switch (fogType)
            {
                case FogType.LINEAR:
                    effect.CurrentTechnique = effect.Techniques["FogShader"];
                    break;
                case FogType.EXPONENCIAL:
                    effect.CurrentTechnique = effect.Techniques["FogExponencialShader"];
                    break;
                case FogType.EXPONENCIALSQUARED:
                    effect.CurrentTechnique = effect.Techniques["FogExponencialSquaredShader"];
                    break;
                default:
                    break;
            }
        }        
 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {            
     this.noise = factory.GetEffect("noise",false,true);            
 }
 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {
     effect = factory.GetEffect("CuingDepth",false,true);            
 }
 public override void Initialize(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, IObject obj)        
 {
     base.Initialize(ginfo, factory, obj);
     this._shader = factory.GetEffect("AnimatedBillboard",false,true);
     this.aniTex = obj.Modelo.getTexture(TextureType.DIFFUSE,0,0);
     obj.Modelo.GetTextureInformation(0)[0].OnTextureChange += new OnTextureChange(Modelo_OnTextureChange);
     totalwidth = aniTex.Width;
     this.width = aniTex.Width / numberOfFrames;
     this.height = aniTex.Height;
     size = width / totalwidth;
 }
        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            gblur = factory.GetEffect("gblur",true,true);
            if (useHalfSingleRenderTarget)
            {
                target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
            }
            else
            {
                target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
            }

            Vector2 texelSize = new Vector2(1f / ginfo.BackBufferWidth, 1f / ginfo.BackBufferHeight);
            SetBlurParameters(texelSize.X, 0, ref sampleOffsetsH, ref sampleWeightsH);
            SetBlurParameters(0, texelSize.Y, ref sampleOffsetsV, ref sampleWeightsV);
        }
 public override void Initialize(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, IObject obj)        
 {
     base.Initialize(ginfo, factory, obj);
     this.ginfo = ginfo;
     this._shader = factory.GetEffect("Terrain",true,true);            
     if (terrainType == TerrainType.SINGLETEXTURE)
     {
         this._shader.CurrentTechnique = this._shader.Techniques["Technique1"];
     }
     else
     {
         this._shader.CurrentTechnique = this._shader.Techniques["MultiTexture"];
     }
 }
        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            
            Saturate = factory.GetEffect("Saturate",false,true);
            Saturate.Parameters["BloomThreshold"].SetValue(bloomThreshold);
            Combine = factory.GetEffect("Combine",false,true);

            renderTarget0 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
            renderTarget1 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
            
            gaussian = new GaussianBlurPostEffect();            
            gaussian.Init(ginfo,factory); 
            
        }  
        public override void  Initialize(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, IObject obj)        
        {
            base.Initialize(ginfo, factory, obj);
            effect = factory.GetEffect("Water",true,true);
            normal = factory.GetTexture2D("waves2", true);
            //effect.Parameters["tNormalMap"].SetValue(factory.GetTexture2D("waves2",true));

            if (String.IsNullOrEmpty(TexureName) && environmentTexture == null)
            {
                ActiveLogger.LogMessage("WaterModel: TextCubeName cannot be null/empty", LogLevel.FatalError);
                throw new Exception("WaterModel: TextCubeName cannot be null/empty");
            }
            if (environmentTexture == null)
            {
                environmentTexture = factory.GetTextureCube(TexureName);                
            }
        }
        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool cullPointLight, bool useFloatingBufferForLightning)
        {
            _lightAddBlendState = new BlendState()
            {
                AlphaSourceBlend = Blend.One,
                ColorSourceBlend = Blend.One,
                AlphaDestinationBlend = Blend.One,
                ColorDestinationBlend = Blend.One,
            };
            this.ginfo = ginfo;
            shadow = new DirectionalShadowRenderer();
            shadow.ShadowFilteringType = filteringType;
            shadow.ShadowMapSize = shadowMapSize;
            shadow.SplitConstant = splitConstant;
            
            shadownBufferSize = ginfo.BackBufferWidth;
            shadowRT = factory.CreateRenderTarget(shadownBufferSize, shadownBufferSize, SurfaceFormat.Single, ginfo.UseMipMap,DepthFormat.Depth24Stencil8,ginfo.MultiSample);

            if (useFloatingBufferForLightning)
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.PreserveContents);
            else
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.PreserveContents);

            pointLightEffect = factory.GetEffect("PointLight",false,true);
            directionalLightEffect = factory.GetEffect("ShadowDirectionalCascade",false,true);
            spotLightEffect = factory.GetEffect("ShadowSpot",false,true);
            sphereModel = new SimpleModel(factory, "Dsphere", true);
            blank = factory.CreateTexture2DColor(1, 1, Color.White);

            rt = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.Depth24Stencil8,ginfo.MultiSample);
            deferredRT = factory.CreateRenderTarget(shadownBufferSize, shadownBufferSize, SurfaceFormat.Single,ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
            shadow.Load(factory,ginfo);

            switch (shadowFilterSpot)
            {
                case ShadowFilter.NONE:
                    spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique1"];
                    break;                
                case ShadowFilter.PCF3x3:
                    spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique2"];
                    break;             
                case ShadowFilter.PCF7x7SOFT:
                    spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique3"];
                    break;
                default:
                    break;
            }

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

            if (texCube == null)
            {
                texCube = factory.GetTextureCube(texName, false);             
            }
            
            
            base.Initialize(ginfo, factory, obj);
        }