Sign in to follow this  
prux

Applying pixel shader effect not to the entire texture

Recommended Posts

A pixel shader is only applied to pixel in the geometry that you're rendering. Usually with post-processing, where you want the shader to be applied to the entire screen, you render a full-screen quad (usually using transformed vertices). If you modify the coordinates of the vertices you're rendering, you can have the shader applied to any shape you want.

Share this post


Link to post
Share on other sites
In any case, one can always use a "mask" texture to determine where specific code is executed in any given shader. You could for instance apply a certain section of code to only areas where the alpha channel of a texture is greater than 0.5.

This can be explicitly done using if() blocks, or implicitly using lerp.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this