Sign in to follow this  

Circular clipping (Target HUD)

This topic is 681 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 have this system to render the 3d of target monster ingame:

8c0ff563b3.jpg

 

I wanted change this square rect to circular rect, like this:

525029e09d.jpg

 

not render what is outside from circle. I thought in scissor or viewport but dont work to circular clipping... someone have any idea to make this work? like backbuffer, alpha texture etcc

 

tnx

Share this post


Link to post
Share on other sites

 

Use the clip intrinsic in your shader:
clip( -distance( texcoord, circleCenter_texcoord ) + circleRadius )

 

have some way without shaders?

 

Draw a flat circle with stencil write enabled, then render the other image with stencil-testing enabled.

(And stop using the fixed-function pipeline.  I usually never help people who are not using shaders out of principle.)

 

 

L. Spiro

Edited by L. Spiro

Share this post


Link to post
Share on other sites

This topic is 681 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.

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