/// <summary> /// Creates a new instance of engine configuration. /// </summary> public EngineConfig() { this.Chunk = new ChunkConfig(); this.Cache = new CacheConfig(); this.Graphics = new GraphicsConfig(); this.Audio = new AudioConfig(); this.World = new WorldConfig(); this.Debugging = new DebugConfig(); this.Bloom = new BloomConfig(); }
private static BloomStorage CreateBloomStorage(BloomConfig bloomConfig = null) { var storage = new BloomStorage(bloomConfig ?? new BloomConfig(), new MemDb(), new InMemoryDictionaryFileStoreFactory()); var bucketItems = storage.MaxBucketSize * Buckets; for (long i = 0; i < bucketItems; i++) { storage.Store(i, Core.Bloom.Empty); } return(storage); }
public void onGUI(float x, float y) { if (GUI.Button(new Rect(x, y, 75, 20), "Default")) { m_activeConfig = new BloomConfig(); } if (GUI.Button(new Rect(x + 75, y, 75, 20), "Medium")) { m_activeConfig = BloomConfig.getMediumPreset(); } if (GUI.Button(new Rect(x + 150, y, 75, 20), "High")) { m_activeConfig = BloomConfig.getHighPreset(); } if (GUI.Button(new Rect(x + 225, y, 75, 20), "Load")) { load(); } y += 25; m_activeConfig.bloomEnabled = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.bloomEnabled, "Enable bloom"); y += 25; m_activeConfig.intensity = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 2.0f, "Intensity", m_activeConfig.intensity); y += 25; m_activeConfig.threshhold = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 1.0f, "Threshold", m_activeConfig.threshhold); y += 25; m_activeConfig.blurSpread = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 2.0f, "Spread", m_activeConfig.blurSpread); y += 25; m_activeConfig.blurIterations = PPFXUtility.drawIntSliderWithLabel(x, y, 1, 5, "Spread", m_activeConfig.blurIterations); y += 25; m_activeConfig.lensflareEnabled = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.lensflareEnabled, "Enable lensflare."); y += 25; m_activeConfig.lensflareIntensity = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 2.0f, "Intensity", m_activeConfig.lensflareIntensity); y += 25; m_activeConfig.lensflareThreshold = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 1.0f, "Threshold", m_activeConfig.lensflareThreshold); y += 25; m_activeConfig.lensflareSaturation = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 1.0f, "Saturation", m_activeConfig.lensflareSaturation); y += 25; m_activeConfig.lensflareRotation = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 3.14f, "Rotation", m_activeConfig.lensflareRotation); y += 25; m_activeConfig.lensflareStretchWidth = PPFXUtility.drawSliderWithLabel(x, y, 0.0f, 5.0f, "Width", m_activeConfig.lensflareStretchWidth); y += 25; m_activeConfig.lensflareBlurIterations = PPFXUtility.drawIntSliderWithLabel(x, y, 1, 5, "Blur Iterations", m_activeConfig.lensflareBlurIterations); y += 25; m_activeConfig.lensFlareStyle = (LensFlareStyle)PPFXUtility.drawIntSliderWithLabel(x, y, 0, 2, "Style", m_activeConfig.getLensFlareStyleLabel(), (int)m_activeConfig.lensFlareStyle); y += 25; //m_activeConfig.lensflareSun = GUI.Toggle(new Rect(x, y, 200.0f, 20.0f), m_activeConfig.lensflareSun, "Enable sun lensflare."); //y += 25; applyConfig(); }
private void load() { m_activeConfig = ConfigUtility.Deserialize <BloomConfig>(configFilename); }