Skip to main content
gamedev.net
🔒 Locked

GLSL Multipass Tutorial

Started by Triscuit 0 replies 1.8k views
Original Post
Triscuit
Triscuit
I have a vertex and fragment shader that unwrap a model into texture space and calculate per-pixel lighting. I then save it to a texture. What I want to do is in another pass, blur that texture 1 pixel in every direction. Does anyone have any pointers for implementing a multipass shader in GLSL?
dimensionX
dimensionX
If you already have the unwrapped texture in the texture memory what the problem ? Bind that texture to a texture unit and enable the vertex/fragment shader that will do the blurring. Simply,

glUseProgramObject(unwrap shader);
......
glUseProgramObject(NULL);

.........
.........

glUseProgramObject(blur shader);
........
glUseProgramObject(NUL);

That's it!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.