Jump to content
  • Advertisement
Sign in to follow this  
Eric F.

DX11 Highlighting objects in 2d game like in Baldur's Gate/Pillars of Eternity possible in HLSL+DX11 shader?

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

Hi all,

 

I was wondering if it is possible to create a HLSL shader to highlight objects like in baldur's gate or pillar of eternity, ie:

 

85299537.jpg

 

Or if this is done using a semi transparent texture on top of the object.

 

I'm not an expert with shaders, so I dont know if it is possible to detect edges like that.

 

Thanks for any help!

 

Share this post


Link to post
Share on other sites
Advertisement

well Baldur's Gate is a pretty ancient game nowadays...1998...but oh how I loved it back in the day.  They *probably* did something along the lines of creating some kind of hitbox (or any general polygon really) and if the mouse was detected to be inside of it, draw it to the screen with whatever generic shape renderer they had access to.

Share this post


Link to post
Share on other sites

I see 2 aspects to this, both quite simple in isolation, and neither involving edge detection:

 

1) Decide the bounds of the area to highlight. In old 2D games this was probably based on tile boundaries, or just an arbitrary rectangle created in the level editor. If the object itself has some intrinsic dimensions then the area can be calculated from that.

2) Draw the highlight as a semi-opaque colour overlay.

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!