• Advertisement
Sign in to follow this  

Clipping Shader Post-Proccess

This topic is 763 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:

 

clip_image002_thumb.jpg?w=488&h=383

 

I using this mask to make this:

ba5b3e36a7.png

 

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
Advertisement

'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