internal static void Initialize(FeGame game, int width, int height, int windowWidth, int windowHeight, bool fullscreen) { _game = game; GraphicsManager = new GraphicsDeviceManager(game); Resolution = new ResolutionManager(GraphicsManager, width, height, windowWidth, windowHeight, fullscreen); PostProcessing = new PostProcessingStack(); // TODO allow changing borderless and resizing game.Window.IsBorderlessEXT = false; game.Window.AllowUserResizing = false; _allRenderers = new List <Renderer>(); _defaultRenderers = new List <Renderer>(); _guiRenderers = new List <Renderer>(); AddRenderer(new DefaultRenderer()); #if DEBUG AddRenderer(new DebugRenderer()); #endif AddRenderer(new GuiRenderer()); }
private void OnEnable() { HandlePPPositionRequest += ProviderPPPosition; // Initialize members. mMainCamera = gameObject.GetComponent <Camera>(); if (mMainCamera == null) { throw new Exception("FovSystemManager require Camera component to operate."); } ValidateMainCamera(mMainCamera, renderSettings); if (mOcclusionRenderer == null) { mOcclusionRenderer = OcclusionMaskRenderer.InitializeMaskRenderer(gameObject, renderSettings.occlusionLayers, materialContainer.OcclusionMaskShader); } if (mLightMaskRenderer == null) { mLightMaskRenderer = LightMaskRenderer.InitializeMaskRenderer(gameObject); } if (mBackgroundRenderer == null) { mBackgroundRenderer = BackgroundRenderer.InitializeMaskRenderer(gameObject); } if (mPostProcessingStack == null) { mPostProcessingStack = new PostProcessingStack(materialContainer); } }
private void OnEnable() { Logger.Log("Lighting system enabled.", Category.Lighting); //don't run lighting system on headless if (GameData.IsHeadlessServer) { return; } OnLightingSystemEnabled?.Invoke(true); if (!SystemInfo.supportsAsyncGPUReadback) { Logger.LogWarning("LightingSystem: Async GPU Readback not supported on this machine, slower synchronous readback will" + " be used instead.", Category.Lighting); } HandlePPPositionRequest += ProviderPPPosition; // Initialize members. mMainCamera = gameObject.GetComponent <Camera>(); if (mMainCamera == null) { throw new Exception("FovSystemManager require Camera component to operate."); } // Let's force camera to cull background light mMainCamera.cullingMask &= ~renderSettings.backgroundLayers; // Now validate other settings ValidateMainCamera(mMainCamera, renderSettings); if (mOcclusionRenderer == null) { mOcclusionRenderer = OcclusionMaskRenderer.InitializeMaskRenderer(gameObject, renderSettings.occlusionLayers, materialContainer.OcclusionMaskShader); } if (mLightMaskRenderer == null) { mLightMaskRenderer = LightMaskRenderer.InitializeMaskRenderer(gameObject); } if (mBackgroundRenderer == null) { mBackgroundRenderer = BackgroundRenderer.InitializeMaskRenderer(gameObject); } if (mPostProcessingStack == null) { mPostProcessingStack = new PostProcessingStack(materialContainer); } if (!renderSettings.disableAsyncGPUReadback && SystemInfo.supportsAsyncGPUReadback) { mTextureDataRequest = new TextureDataRequest(); } operationParameters = new OperationParameters(mMainCamera, renderSettings, matrixRotationMode);; ResolveRenderingTextures(operationParameters); }
private void OnEnable() { //don't run lighting system on headless if (GameData.IsHeadlessServer) { return; } if (!SystemInfo.supportsAsyncGPUReadback) { UnityEngine.Debug.LogWarning("LightingSystem: Async GPU Readback not supported on this machine, slower synchronous readback will" + " be used instead."); } HandlePPPositionRequest += ProviderPPPosition; // Initialize members. mMainCamera = gameObject.GetComponent <Camera>(); if (mMainCamera == null) { throw new Exception("FovSystemManager require Camera component to operate."); } ValidateMainCamera(mMainCamera, renderSettings); if (mOcclusionRenderer == null) { mOcclusionRenderer = OcclusionMaskRenderer.InitializeMaskRenderer(gameObject, renderSettings.occlusionLayers, materialContainer.OcclusionMaskShader); } if (mLightMaskRenderer == null) { mLightMaskRenderer = LightMaskRenderer.InitializeMaskRenderer(gameObject); } if (mBackgroundRenderer == null) { mBackgroundRenderer = BackgroundRenderer.InitializeMaskRenderer(gameObject); } if (mPostProcessingStack == null) { mPostProcessingStack = new PostProcessingStack(materialContainer); } }