[SOLVED] Fullscreen quad, like in FilterPostProcessor?

Long story short: i want to rewrite the filter post processor with a different design.

I’m having issues in understanding how to make a fullscreen quad that ignores fov and cam transformations, i looked at the FilterPostProcessor code of course, but the code is split in many methods and classes and i can’t understand what is really going on.

Can anyone help me with that?

guiNode maybe ?

imho best is to create a custom quad with vertices (-1,-1) (-1,1) (1,1) (1,-1) (i think gl ranges from (-1,-1) to (1,1)) and then set those directly in the vertexshader. no matrix multiplication is required for a fullscreen quad.

Then set the correct filter material and render the quad.

1 Like

The magic occur in the post.vert shader.
the quad is just a 1, 1 quad projected fullscreen.

the position is transposed in the -1, 1 space (clip space) and that’s it… you have a full screen quad.

Out of curiosity what’s wrong with the FPP, that makes you want to rewrite it?

2 Likes

Thanks to both.

There is nothing wrong with the FPP, what i am doing is a simpler more abstract solution that allows me to quickly write multi pass filters with less “initialization” code.
To explain it with an example:

newFilter({
    gpu({
        mat: "material1.j3md",
        in: {
            Texture: "~scene",
            Depth: "~depth",
            Param1: somevariable
        },
        out: {
            scene: "~scene"
        }
    }),
    cpu({
        run:function(vars){
          .........
        }
    }),
    gpu({
        mat: "material2.j3md",
        in: {
            Texture: "~scene",
        },
        out: {
            scene: "~scene"
        }
    })
}