FrameBuffer Help

<cite>@joshngu9 said:</cite> Sorry to bring this back up but I had one more question: How would I go about creating a quad that filled the entire view port? Ideally is there a way to do this without having to adjust the camera position to ensure that the quad is completely in view? Thanks.
An easy way to do this is as follows: create a quad:

[java]Quad q = new Quad(2,2);[/java]

then in the vertex shader for said quad:

[java]
vec4 pos = vec4(inPosition);
pos.x += -1.0;
pos.y += -1.0;
gl_Position = pos;
[/java]
The quad will then stretch to fill the viewport. I use this method to render height maps using a frame buffer.
Good luck.

1 Like
<cite>@nehon said:</cite> really...you don't want to use a filter? you're kind of reinventing the wheel here... Anyway look an the renderProcess method is the FilterPostProcessor class. Then look at the post.vert that projects the quad to full screeen..
I just would rather not over complicate rendering things to a texture.
<cite>@okelly4408 said:</cite> An easy way to do this is as follows: create a quad:

[java]Quad q = new Quad(2,2);[/java]

then in the vertex shader for said quad:

[java]
vec4 pos = vec4(inPosition);
pos.x += -1.0;
pos.y += -1.0;
gl_Position = pos;
[/java]
The quad will then stretch to fill the viewport. I use this method to render height maps using a frame buffer.
Good luck.

Thanks a lot! This works great.