/// <summary>
        /// Load graphics content for the screen.
        /// </summary>
        /// <param name="GraphicInfo"></param>
        /// <param name="factory"></param>
        /// <param name="contentManager"></param>
        protected override void  LoadContent(Engine.GraphicInfo GraphicInfo, Engine.GraphicFactory factory, IContentManager contentManager)
        {
             base.LoadContent(GraphicInfo, factory, contentManager);            
             videoPlayer = new VideoPlayer();
             myVideoFile = contentManager.GetAsset<Video>(location);            
             videoPlayer.IsLooped = false;            

        }
        /// <summary>
        /// Gets a user created effect.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="clone">if set to <c>true</c> [clone].</param>
        /// <param name="isInternal">if set to <c>true</c> [is internal].</param>
        /// <returns></returns>
        public Effect GetEffect(String name, bool clone = false, bool isInternal = false)
        {
            Effect effect = contentManager.GetAsset <Effect>(name, isInternal);

            if (clone)
            {
                return(effect.Clone());
            }
            return(effect);
        }
        //EffectParameter Depth;
        //EffectParameter Color;
        /// <summary>
        /// Initializes a new instance of the <see cref="RestoreDepth"/> class.
        /// </summary>
        /// <param name="useFloatBuffer">if set to <c>true</c> [use float buffer].</param>
        /// <param name="manager">The manager.</param>
        /// <param name="factory">The factory.</param>
        /// <param name="ginfo">The ginfo.</param>
        public RestoreDepth(bool useFloatBuffer,IContentManager manager,GraphicFactory factory, GraphicInfo ginfo)
        {
            this.usefloatBuffer = useFloatBuffer;
            this.restore = manager.GetAsset<Effect>("RestoreDepth",true);
            this.restore.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);
            
            //Depth = restore.Parameters["DepthTexture"];
            //Color = restore.Parameters["ColorTexture"];

            if (useFloatBuffer)
                target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
            else
                target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
        }        
        //EffectParameter PcolorMap;
        //EffectParameter PlightMap;

        #endregion

#region IDeferredFinalCombination Members


        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool useFloatBuffer, bool saveToTexture )
        {
            this.useFloatBuffer = useFloatBuffer;
            this.ginfo = ginfo;
            this.saveToTexture = saveToTexture;
            finalCombineEffect = manager.GetAsset<Effect>("CombineFinal",true);
            PhalfPixel = finalCombineEffect.Parameters["halfPixel"];            
            PambientColor = finalCombineEffect.Parameters["ambientColor"];
            //PEXTRA1 = finalCombineEffect.Parameters["EXTRA1"];
            //PcolorMap = finalCombineEffect.Parameters["colorMap"];
            //PlightMap = finalCombineEffect.Parameters["lightMap"];
            

            PhalfPixel.SetValue(ginfo.HalfPixel);
            if (saveToTexture)
            {
                if (useFloatBuffer)
                    target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
                else
                    target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
            }                        
        }
 public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor,bool useFloatBuffer)
 {
     this.useFloatBuffer = useFloatBuffer;                                    
     normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth , ginfo.BackBufferHeight, SurfaceFormat.Color, false, DepthFormat.Depth24, 0, RenderTargetUsage.DiscardContents);
     depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, false, DepthFormat.Depth24, 0, RenderTargetUsage.DiscardContents);
     //lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);            
     clearBufferEffect = manager.GetAsset<Effect>("PrePass2/ClearGBuffer");
 }
示例#6
0
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            mouseT = contentManager.GetAsset <Texture2D>("Images//mouse//defualt");

            base.LoadContent(GraphicInfo, factory, contentManager);
        }
 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");
     
 }
示例#8
0
文件: Menu.cs 项目: tubitos/1
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            mouseT = contentManager.GetAsset<Texture2D>("Images//mouse//defualt");

            base.LoadContent(GraphicInfo, factory, contentManager);
        }
示例#9
0
        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor,bool useFloatBuffer)
        {
            this.useFloatBuffer = useFloatBuffer;
            this.backGroundColor = BackGroundColor;
                        
            const int multisample = 0;
            colorRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, multisample, RenderTargetUsage.DiscardContents);
            normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
            depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
            lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);            
            clearBufferEffect = manager.GetAsset<Effect>("ClearGBuffer",true);

            clearBufferEffect.Parameters["BackColor"].SetValue(backGroundColor.ToVector3());
        }
        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool cullPointLight, bool useFloatingBufferForLightning)
        {
            this.ginfo = ginfo;
            this.cullPointLight = cullPointLight;
            if (useFloatingBufferForLightning)
            {
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
                samplerState = SamplerState.PointClamp;
            }
            else
            {
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
                samplerState = ginfo.SamplerState;
            }

            directionalLightEffect = manager.GetAsset<Effect>("PrePass2/DirectionalLight");
            pointLightEffect = manager.GetAsset<Effect>("PrePass2/PointLight");
            sphereModel = new SimpleModel(factory, "Models/Dsphere");
            spotLightEffect = manager.GetAsset<Effect>("PrePass2/SpotLight");
            
            spotLightEffect.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);
            pointLightEffect.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);

            DirectionalhalfPixel = directionalLightEffect.Parameters["halfPixel"];
            

            DirectionallightDirection = directionalLightEffect.Parameters["lightDirection"];
            DirectionalColor = directionalLightEffect.Parameters["Color"];
            DirectionallightIntensity = directionalLightEffect.Parameters["lightIntensity"];

            PointWordViewProjection = pointLightEffect.Parameters["wvp"];
            PointlightPosition = pointLightEffect.Parameters["lightPosition"];
            PointColor = pointLightEffect.Parameters["Color"];
            PointlightRadius = pointLightEffect.Parameters["lightRadius"];
            PointlightIntensity = pointLightEffect.Parameters["lightIntensity"];
            Pointquadratic = pointLightEffect.Parameters["quadratic"];
            PointcameraPosition = pointLightEffect.Parameters["cameraPosition"];

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