예제 #1
0
        public override void Prepare(Material uberMaterial)
        {
            GrainModel.Settings settings = base.model.settings;
            uberMaterial.EnableKeyword("GRAIN");
            float realtimeSinceStartup = Time.realtimeSinceStartup;
            float z = Random.value;
            float w = Random.value;

            if ((this.m_GrainLookupRT == null) || !this.m_GrainLookupRT.IsCreated())
            {
                GraphicsUtils.Destroy(this.m_GrainLookupRT);
                RenderTexture texture = new RenderTexture(0xc0, 0xc0, 0, RenderTextureFormat.ARGBHalf)
                {
                    filterMode = FilterMode.Bilinear,
                    wrapMode   = TextureWrapMode.Repeat,
                    anisoLevel = 0,
                    name       = "Grain Lookup Texture"
                };
                this.m_GrainLookupRT = texture;
                this.m_GrainLookupRT.Create();
            }
            Material mat = base.context.materialFactory.Get("Hidden/Post FX/Grain Generator");

            mat.SetFloat(Uniforms._Phase, realtimeSinceStartup / 20f);
            Graphics.Blit(null, this.m_GrainLookupRT, mat, !settings.colored ? 0 : 1);
            uberMaterial.SetTexture(Uniforms._GrainTex, this.m_GrainLookupRT);
            uberMaterial.SetVector(Uniforms._Grain_Params1, new Vector2(settings.luminanceContribution, settings.intensity * 20f));
            uberMaterial.SetVector(Uniforms._Grain_Params2, new Vector4((((float)base.context.width) / ((float)this.m_GrainLookupRT.width)) / settings.size, (((float)base.context.height) / ((float)this.m_GrainLookupRT.height)) / settings.size, z, w));
        }
예제 #2
0
        public override void Prepare(Material uberMaterial)
        {
            GrainModel.Settings settings = base.model.settings;
            uberMaterial.EnableKeyword("GRAIN");
            float realtimeSinceStartup = Time.realtimeSinceStartup;
            float value  = Random.value;
            float value2 = Random.value;

            if (this.m_GrainLookupRT == null || !this.m_GrainLookupRT.IsCreated())
            {
                GraphicsUtils.Destroy(this.m_GrainLookupRT);
                this.m_GrainLookupRT = new RenderTexture(192, 192, 0, 2)
                {
                    filterMode = 1,
                    wrapMode   = 0,
                    anisoLevel = 0,
                    name       = "Grain Lookup Texture"
                };
                this.m_GrainLookupRT.Create();
            }
            Material material = this.context.materialFactory.Get("Hidden/Post FX/Grain Generator");

            material.SetFloat(GrainComponent.Uniforms._Phase, realtimeSinceStartup / 20f);
            Graphics.Blit(null, this.m_GrainLookupRT, material, (!settings.colored) ? 0 : 1);
            uberMaterial.SetTexture(GrainComponent.Uniforms._GrainTex, this.m_GrainLookupRT);
            uberMaterial.SetVector(GrainComponent.Uniforms._Grain_Params1, new Vector2(settings.luminanceContribution, settings.intensity * 20f));
            uberMaterial.SetVector(GrainComponent.Uniforms._Grain_Params2, new Vector4((float)this.context.width / (float)this.m_GrainLookupRT.width / settings.size, (float)this.context.height / (float)this.m_GrainLookupRT.height / settings.size, value, value2));
        }
예제 #3
0
 // Token: 0x06006869 RID: 26729 RVA: 0x00027A79 File Offset: 0x00025C79
 public void EDEGJLKIJED(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #4
0
 // Token: 0x0600685D RID: 26717 RVA: 0x00027A79 File Offset: 0x00025C79
 public void IFDQONCQDKD(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #5
0
 // Token: 0x06006862 RID: 26722 RVA: 0x00027A79 File Offset: 0x00025C79
 public void HJDODIPCIGF(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #6
0
 // Token: 0x06006882 RID: 26754 RVA: 0x00027A79 File Offset: 0x00025C79
 public void NEBHFCDDQGL(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #7
0
 // Token: 0x06006885 RID: 26757 RVA: 0x00027A79 File Offset: 0x00025C79
 public void HDBPOECEBFO(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #8
0
 // Token: 0x06006880 RID: 26752 RVA: 0x00027A79 File Offset: 0x00025C79
 public void CEOMMEOIBJE(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #9
0
 // Token: 0x06006881 RID: 26753 RVA: 0x00027A79 File Offset: 0x00025C79
 public void HMHGDNBBPBP(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #10
0
 // Token: 0x06006877 RID: 26743 RVA: 0x00027A79 File Offset: 0x00025C79
 public void LEMOMMDPLKK(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #11
0
 // Token: 0x0600685C RID: 26716 RVA: 0x00027A79 File Offset: 0x00025C79
 public void DGLGPOBMNLQ(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #12
0
 // Token: 0x06006876 RID: 26742 RVA: 0x00027A79 File Offset: 0x00025C79
 public void IQDEILBBNEE(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #13
0
 // Token: 0x06006873 RID: 26739 RVA: 0x00027A79 File Offset: 0x00025C79
 public void FIHCDJGMDOJ(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #14
0
 // Token: 0x06006872 RID: 26738 RVA: 0x00027A79 File Offset: 0x00025C79
 public void PKPPHCBPDQL(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #15
0
 // Token: 0x06006871 RID: 26737 RVA: 0x00027A79 File Offset: 0x00025C79
 public void CKEBGJBCHHE(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }
예제 #16
0
 // Token: 0x0600686F RID: 26735 RVA: 0x00027A79 File Offset: 0x00025C79
 public void FPPMCMPJPLF(GrainModel.Settings BGBMIEJJQKC)
 {
     this.m_Settings = BGBMIEJJQKC;
 }