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

Started by
2 comments, last by Eric F. 7 years, 8 months ago

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!

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.

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.

Thanks guys.

This topic is closed to new replies.

Advertisement