Jump to content
  • Advertisement
Sign in to follow this  

Clipping Shader Post-Proccess

This topic is 1006 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

Hey guys, I need a help to make a circular clipping with shaders in postprocess.

Something like that:




I using this mask to make this:



Post Process:

sampler ColorSampler : register(s0);

And that to call the texture inside shader:

texture MaskTexture;
sampler2D MaskSampler=sampler_state 
    Texture = <MaskTexture>;
    MinFilter = Linear;
    MagFilter = Linear;
    MipFilter = Linear;
    AddressU = Clamp;
    AddressV = Clamp;

Some friends told me to use clip function, but I dont found it in any place, so I dont have idea how to use that, if someone can help me I will be grateful.


Thank you guys!

Edited by pristondev

Share this post

Link to post
Share on other sites

'clip' is documented Here.
Of course, if you only want circles then it would perhaps be easier to mathematically calculate the distance in the pixel shader and pass -1 to clip if the distance is greater than the radius of the circle. No texture required.

Ye is just circles... Can give some example how do this with math, no textures in hlsl?

Sorry but im not pro in dx for now.

Anyway thanks for ur help :D

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!