public SurfaceManager(ShaderManager shaders, DeferredBuffer deferredBuffer) { this.shaders = shaders; this.deferredBuffer = deferredBuffer; this.initialise(shaders, deferredBuffer); SurfaceManager.Instance = this; }
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); }
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); }
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(); }