Jump to content
  • Advertisement
Sign in to follow this  
golgoth

GLSL post effects!

This topic is 4771 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all! Im trying to multi sample the final output of my rendering pipepline! i had succesful results using glEnable(GL_MULTISAMPLE_ARB) but it is really slow... so id like to try it with a glsl shader... the process is simple... i render to texture the pBuffer and apply it to a plane in ortho mode over everything... so far its all good, the entire scene is rendered on that plane... i can also apply a simple fragment shader like: void main (void) { gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); } everything turns green... so the piepline seams ok... now... how can i access and transform every single pixels and play with them?... maybe a simple invert color or to gray scale shader sample will do help alot... ultimatly a blur effect will make my day! thx! golgoth

Share this post


Link to post
Share on other sites
Advertisement
For a simple blur, just sample the texture at multiple points around your current fragment's position and avarage them for the final output. If you put the screen-space fragment position in the texture coordinates then you can offset this for each texture sample you need to do (offset can be calculated based on texture resolution and stored in a uniform var).

However a blur is not the same as multisampling, and even if you were to do multisampling in a fragment shader I doubt I'd be any faster than the normal way (most likely slower).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!