Ejemplo n.º 1
0
 private void Update()
 {
     if (this._currentResolution != this.Resolution)
     {
         this._currentResolution = this.Resolution;
         this.ChangeResolution();
     }
     if (((Texture)this._volumeLightTexture).get_width() == this._camera.get_pixelWidth() && ((Texture)this._volumeLightTexture).get_height() == this._camera.get_pixelHeight())
     {
         return;
     }
     this.ChangeResolution();
 }
Ejemplo n.º 2
0
    private void Awake()
    {
        this._camera = (Camera)((Component)this).GetComponent <Camera>();
        if (this._camera.get_actualRenderingPath() == 1)
        {
            this._camera.set_depthTextureMode((DepthTextureMode)1);
        }
        this._currentResolution = this.Resolution;
        Shader shader1 = Shader.Find("Hidden/BlitAdd");

        if (Object.op_Equality((Object)shader1, (Object)null))
        {
            throw new Exception("Critical Error: \"Hidden/BlitAdd\" shader is missing. Make sure it is included in \"Always Included Shaders\" in ProjectSettings/Graphics.");
        }
        this._blitAddMaterial = new Material(shader1);
        Shader shader2 = Shader.Find("Hidden/BilateralBlur");

        if (Object.op_Equality((Object)shader2, (Object)null))
        {
            throw new Exception("Critical Error: \"Hidden/BilateralBlur\" shader is missing. Make sure it is included in \"Always Included Shaders\" in ProjectSettings/Graphics.");
        }
        this._bilateralBlurMaterial = new Material(shader2);
        this._preLightPass          = new CommandBuffer();
        this._preLightPass.set_name("PreLight");
        this.ChangeResolution();
        if (Object.op_Equality((Object)VolumetricLightRenderer._pointLightMesh, (Object)null))
        {
            GameObject primitive = GameObject.CreatePrimitive((PrimitiveType)0);
            VolumetricLightRenderer._pointLightMesh = ((MeshFilter)primitive.GetComponent <MeshFilter>()).get_sharedMesh();
            Object.Destroy((Object)primitive);
        }
        if (Object.op_Equality((Object)VolumetricLightRenderer._spotLightMesh, (Object)null))
        {
            VolumetricLightRenderer._spotLightMesh = this.CreateSpotLightMesh();
        }
        if (Object.op_Equality((Object)VolumetricLightRenderer._lightMaterial, (Object)null))
        {
            Shader shader3 = Shader.Find("Sandbox/VolumetricLight");
            if (Object.op_Equality((Object)shader3, (Object)null))
            {
                throw new Exception("Critical Error: \"Sandbox/VolumetricLight\" shader is missing. Make sure it is included in \"Always Included Shaders\" in ProjectSettings/Graphics.");
            }
            VolumetricLightRenderer._lightMaterial = new Material(shader3);
        }
        if (Object.op_Equality((Object)VolumetricLightRenderer._defaultSpotCookie, (Object)null))
        {
            VolumetricLightRenderer._defaultSpotCookie = this.DefaultSpotCookie;
        }
        this.LoadNoise3dTexture();
        this.GenerateDitherTexture();
    }