private void OnEnable() { this.MyCamera = base.gameObject.GetComponent <Camera>(); this.frostEffect = base.GetComponent <Frost>(); this.ScionStuff = base.GetComponent <ScionPostProcess>(); this.bleedEffect = base.GetComponent <BleedBehavior>(); this.aa_FXAA = base.GetComponent <FXAA>(); this.aa_SMAA = base.GetComponent <SMAA>(); this.amplifyMotion = base.GetComponent <AmplifyMotionEffect>(); this.sessao = base.GetComponent <SESSAO>(); this.hbao = base.GetComponent <HBAO>(); this.waterViz = base.gameObject.GetComponent <WaterViz>(); this.waterBlur = base.gameObject.GetComponent <WaterBlurEffect>(); this.waterBlurCeto = base.gameObject.GetComponent <UnderWaterPostEffect>(); this.farShadowCascade = base.gameObject.GetComponent <FarShadowCascade>(); if (Sunshine.Instance) { this.SunshineOccluders = Sunshine.Instance.Occluders; } this.reflexionMode_complex = LayerMask.GetMask(new string[] { "Camera", "Ignore Raycast" }); this.reflexionMode_simple = LayerMask.GetMask(new string[] { "Camera" }); this.reflexionMode_off = 0; }
static public int get_shader(IntPtr l) { try { FXAA self = (FXAA)checkSelf(l); pushValue(l, self.shader); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { FXAA o; o = new FXAA(); pushValue(l, o); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_shader(IntPtr l) { try { FXAA self = (FXAA)checkSelf(l); UnityEngine.Shader v; checkType(l, 2, out v); self.shader = v; return(0); } catch (Exception e) { return(error(l, e)); } }
static public int OnRenderImage(IntPtr l) { try { FXAA self = (FXAA)checkSelf(l); UnityEngine.RenderTexture a1; checkType(l, 2, out a1); UnityEngine.RenderTexture a2; checkType(l, 3, out a2); self.OnRenderImage(a1, a2); return(0); } catch (Exception e) { return(error(l, e)); } }
private void LoadContent() { Bloom bloom = new Bloom(PostProcessor, Content); bloom.Radius = 1.5f; PostProcessor.Effects.Add(bloom); _fxaaPPE = new FXAA(PostProcessor, Content); PostProcessor.Effects.Add(_fxaaPPE); //Negative negative = new Negative(PostProcessor, Content); //PostProcessor.Effects.Add(negative); _smaaPPE = new SMAA(PostProcessor, Content); PostProcessor.Effects.Add(_smaaPPE); }
/// <summary> /// Creates a bunch of stuff (such as the biome library, primitive library etc.) which won't change /// from game to game. /// </summary> public void InitializeStaticData(string companyName, string companyMotto, NamedImageFrame companyLogo, Color companyColor) { CompositeLibrary.Initialize(); CraftLibrary = new CraftLibrary(); if (SoundManager.Content == null) { SoundManager.Content = Content; SoundManager.LoadDefaultSounds(); SoundManager.SetActiveSongs(ContentPaths.Music.dwarfcorp, ContentPaths.Music.dwarfcorp_2, ContentPaths.Music.dwarfcorp_3, ContentPaths.Music.dwarfcorp_4); } new PrimitiveLibrary(GraphicsDevice, Content); InstanceManager = new InstanceManager(); EntityFactory.InstanceManager = InstanceManager; InstanceManager.CreateStatics(Content); Color[] white = new Color[1]; white[0] = Color.White; pixel = new Texture2D(GraphicsDevice, 1, 1); pixel.SetData(white); Tilesheet = TextureManager.GetTexture(ContentPaths.Terrain.terrain_tiles); AspectRatio = GraphicsDevice.Viewport.AspectRatio; DefaultShader = Content.Load<Effect>(ContentPaths.Shaders.TexturedShaders); DefaultShader.Parameters["xFogStart"].SetValue(40.0f); DefaultShader.Parameters["xFogEnd"].SetValue(80.0f); VoxelLibrary = new VoxelLibrary(); VoxelLibrary.InitializeDefaultLibrary(GraphicsDevice, Tilesheet); bloom = new BloomComponent(Game) { Settings = BloomSettings.PresetSettings[5] }; bloom.Initialize(); fxaa = new FXAA(); fxaa.Initialize(); SoundManager.Content = Content; PlanService.Restart(); ComponentManager = new ComponentManager(this, companyName, companyMotto, companyLogo, companyColor); ComponentManager.RootComponent = new Body("root", null, Matrix.Identity, Vector3.Zero, Vector3.Zero, false); Vector3 origin = new Vector3(WorldOrigin.X, 0, WorldOrigin.Y); Vector3 extents = new Vector3(1500, 1500, 1500); ComponentManager.CollisionManager = new CollisionManager(new BoundingBox(origin - extents, origin + extents)); Alliance.Relationships = Alliance.InitializeRelationships(); JobLibrary.Initialize(); MonsterSpawner = new MonsterSpawner(); EntityFactory.Initialize(); }
public override void Load() { base.Load(); if (GraphicsDevice != null) { // Effects m_ClearGBufferEffect = RenderManager.Instance.LoadEffect("Shaders/Deferred Rendering/ClearGBuffer"); // Post Processing m_GaussianEffect = RenderManager.Instance.GetEffect("GaussianBlurPostProcessor"); m_DepthOfFieldEffect = RenderManager.Instance.GetEffect("DOFPostProcessor"); m_BloomEffect = RenderManager.Instance.GetEffect("BloomPostProcessor"); m_MergeEffect = RenderManager.Instance.GetEffect("MergeBloomPostProcessor"); m_EdgeDetectionEffect = RenderManager.Instance.GetEffect("EdgeDetectionPostProcessor"); m_MLAAEffect = RenderManager.Instance.GetEffect("MLAAPostProcessor"); m_FilmGrainEffect = RenderManager.Instance.GetEffect("FilmMappingPostProcessor"); m_SSAOEffect = RenderManager.Instance.GetEffect("SSAO"); m_SSAOBlurEffect = RenderManager.Instance.GetEffect("SSAOBlur"); m_SSAOMergeEffect = RenderManager.Instance.GetEffect("SSAOMerge"); m_FXAAEffect = RenderManager.Instance.GetEffect("FXAA"); // Post Processor m_MLAAProcessor = new MLAA(GraphicsDevice, m_MLAAEffect, m_EdgeDetectionEffect); m_SSAOProcessor = new SSAO(GraphicsDevice, m_SSAOEffect, m_SSAOBlurEffect, m_SSAOMergeEffect); m_FXAAProcessor = new FXAA(GraphicsDevice, m_FXAAEffect); // These post processors were created up front so just assign the effect so them m_DepthOfFieldPostProcessor.Effect = m_DepthOfFieldEffect; m_DepthOfFieldPostProcessor.BlurEffect = m_GaussianEffect; m_BloomPostProcessor.Effect = m_BloomEffect; m_BloomPostProcessor.BlurEffect = m_GaussianEffect; m_BloomPostProcessor.MergeEffect = m_MergeEffect; m_FilmGrainProcessor.Effect = m_FilmGrainEffect; } }