Beispiel #1
0
    void Start()
    {
        Renderers = GetComponentsInChildren <Renderer>();
        GlowCameraController.RegisterObject(this);

        tag = "Editable";
    }
Beispiel #2
0
    /// <summary>
    /// On Awake, we cache various values and setup our command buffer to be called Before Image Effects.
    /// </summary>
    private void Awake()
    {
        _instance = this;

        _glowMat      = new Material(Shader.Find("Hidden/GlowControlShader"));
        _blurMaterial = new Material(Shader.Find("Hidden/Blur"));

        _prePassRenderTexID  = Shader.PropertyToID("_GlowPrePassTex");
        _blurPassRenderTexID = Shader.PropertyToID("_GlowBlurredTex");
        _tempRenderTexID     = Shader.PropertyToID("_TempTex0");
        _blurSizeID          = Shader.PropertyToID("_BlurSize");
        _glowColorID         = Shader.PropertyToID("_GlowColor");

        _commandBuffer      = new CommandBuffer();
        _commandBuffer.name = "Glowing Objects Buffer";         // This name is visible in the Frame Debugger
        GetComponent <Camera>().AddCommandBuffer(CameraEvent.BeforeImageEffects, _commandBuffer);
    }