示例#1
0
 public SurfaceManager(ShaderManager shaders, DeferredBuffer deferredBuffer)
 {
     this.shaders        = shaders;
     this.deferredBuffer = deferredBuffer;
     this.initialise(shaders, deferredBuffer);
     SurfaceManager.Instance = this;
 }
示例#2
0
        private void initialise(ShaderManager shaders, DeferredBuffer deferredBuffer)
        {
            this.initMatrices();

            this.gameSpriteSettings = new SurfaceSetting[]
            {
                this.gameModelview,
                this.gameProjection,
                SurfaceBlendSetting.PremultipliedAlpha
            };

            this.initFonts(shaders);
            this.initParticles(shaders);

            this.initSprites(shaders);

            this.initHexagons(shaders);
            this.initHud(shaders);
            this.initTutorial(shaders);

            this.initWalls(shaders);

            this.initDeferred(shaders, deferredBuffer);

            this.initOverlay(shaders);
        }
示例#3
0
 private void initDeferred(ShaderManager shaders, DeferredBuffer deferredBuffer)
 {
     this.PointLights = new IndexedSurface <DeferredPointLightVertex>();
     this.PointLights.AddSettings(
         this.gameModelview,
         this.gameProjection,
         SurfaceBlendSetting.PremultipliedAlpha,
         deferredBuffer
         );
     shaders.PointLights.UseOnSurface(this.PointLights);
 }
示例#4
0
        public GameRenderer()
        {
            this.deferredBuffer = new DeferredBuffer();
            this.shaders        = new ShaderManager();
            this.surfaces       = new SurfaceManager(this.shaders, this.deferredBuffer);
            this.sprites        = new SpriteManager(this.surfaces);


            this.debugDeferred = new PostProcessSurface();
            this.debugDeferred.AddSettings(this.deferredBuffer);
            this.shaders.DebugDeferred.UseOnSurface(this.debugDeferred);

            this.copyLightToScreen = new PostProcessSurface();
            this.copyLightToScreen.AddSetting(this.deferredBuffer.LightAccumulationTexture);
            this.shaders.PostCopy.UseOnSurface(this.copyLightToScreen);

            this.shaderReloadTimer = Stopwatch.StartNew();
        }