Jump to content
  • Advertisement
Sign in to follow this  
pristondev

Circular clipping (Target HUD)

This topic is 899 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
Advertisement

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

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?

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
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!