All Questions

Community

A
SnowRoad11
posted to: Gaussian blur

Only getting 1 dimension

Hi,

here are the images for what I'm getting, Blur2 doesn't seem to work:

https://postimg.cc/gallery/MvkVzzn

maybe I did something wrong?

  • Razoric replied
    Solution

    Blur2's Viewport should also contain a TextureRect. It should display the ViewportTexture that is produced by Blur1's Viewport.

    So the order of operations would be something like:

    1. TextureRect is drawn inside of Blur1. The TextureRect is the one that has the first blur shader, so it's drawn with the first blur pass directly into the viewport. It has whatever texture (in your case the Godot icon.) Its ViewportContainer is invisible (self-modulate's alpha set to 0)
    2. TextureRect is drawn inside of Blur2. This texture rect uses the ViewportTexture created by Blur1. Either it, or its ViewportContainer, can have the second pass blur shader. Its ViewportContainer is visible, so it displays the result.
  • Razoric replied
    Solution

    The alternative is to have nested viewports (Blur1's ViewportContainer is a child of Blur2, and you use the ViewportContainers to blur.)

  • A
    SnowRoad11 replied

    I see. my bad I misunderstood the instructions, thank you