Inheritance: Fusion.Engine.Common.GameModule
Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="engine"></param>
        public RenderSystem(Game Game) : base(Game)
        {
            Counters = new RenderCounters();

            Width           = 1024;
            Height          = 768;
            Fullscreen      = false;
            StereoMode      = StereoMode.Disabled;
            InterlacingMode = InterlacingMode.HorizontalLR;
            UseDebugDevice  = false;
            VSyncInterval   = 1;
            MsaaEnabled     = false;
            UseFXAA         = true;

            this.Device = Game.GraphicsDevice;

            spriteEngine  = new SpriteEngine(this);
            filter        = new Filter(this);
            ssaoFilter    = new SsaoFilter(this);
            hdrFilter     = new HdrFilter(this);
            dofFilter     = new DofFilter(this);
            lightRenderer = new LightRenderer(this);
            sceneRenderer = new SceneRenderer(this);
            sky           = new Sky(this);
            bitonicSort   = new BitonicSort(this);
            vtSystem      = new VTSystem(this);

            Game.Config.ExposeConfig(lightRenderer, "LightRenderer", "light");
            Game.Config.ExposeConfig(ssaoFilter, "SSAO", "ssao");
            Game.Config.ExposeConfig(vtSystem, "VirtualTexture", "vt");

            Device.DisplayBoundsChanged += (s, e) => {
                DisplayBoundsChanged?.Invoke(s, e);
            };
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="gameTime"></param>
        /// <param name="stereoEye"></param>
        internal void Draw(GameTime gameTime, StereoEye stereoEye)
        {
            Counters.Reset();

            var targetColorSurface = Device.Display.BackbufferColor.Surface;
            var targetDepthSurface = Device.Display.BackbufferDepth.Surface;

            //	render world :
            RenderWorld.Render(gameTime, stereoEye, targetColorSurface);

            //	draw sprites :
            SpriteEngine.DrawSprites(gameTime, stereoEye, targetColorSurface, SpriteLayers);

            if (ShowCounters)
            {
                Counters.PrintCounters();
            }
        }
		/// <summary>
		/// 
		/// </summary>
		/// <param name="engine"></param>
		public RenderSystem ( Game Game ) : base(Game)
		{
			Counters	=	new RenderCounters();

			Width			=	1024;
			Height			=	768;
			Fullscreen		=	false;
			StereoMode		=	StereoMode.Disabled;
			InterlacingMode	=	InterlacingMode.HorizontalLR;
			UseDebugDevice	=	false;
			VSyncInterval	=	1;
			MsaaEnabled		=	false;
			UseFXAA			=	true;

			this.Device	=	Game.GraphicsDevice;

			viewLayers	=	new List<RenderLayer>();
			spriteEngine	=	new SpriteEngine( this );
			gis				=	new Gis(Game);
			filter			=	new Filter( Game );
			ssaoFilter		=	new SsaoFilter( Game );
			hdrFilter		=	new HdrFilter( Game );
			dofFilter		=	new DofFilter( Game );
			lightRenderer	=	new LightRenderer( Game );
			sceneRenderer	=	new SceneRenderer( Game, this );
			sky				=	new Sky( Game );
			bitonicSort		=	new BitonicSort( Game );

			Device.DisplayBoundsChanged += (s,e) => {
				var handler = DisplayBoundsChanged;
				if (handler!=null) {
					handler(s,e);
				}
			};
		}