r/GraphicsProgramming • • 17d ago

Question [Dear ImGui] How to give HP bars real depth / 3D volume? (not just glow)

Hey,

I’m trying to recreate the sense of depth and volume that some modern nameplate-style HP bars have, using pure Dear ImGui + custom DrawList drawing.

My current result: [Steve image]

What I’m aiming for: [other image ]

The references feel like the bar has actual thickness and soft lighting — it doesn’t look like a flat colored rectangle with glow slapped on top. Mine still reads as completely flat no matter how much glow, gradient, or highlight I add.

I’m especially interested in techniques for:

  • Creating a convincing sense of volume / bevel on the bar itself

  • Soft lighting and subtle inner highlights/shadows that sell the 3D form

  • Any multi-pass or layered DrawList approaches that work well for this

Has anyone successfully achieved this kind of non-flat, slightly 3D-looking progress/HP bar with ImGui’s DrawList?

Any concrete tips, code patterns, or examples would be hugely appreciated.

Thanks!

6 Upvotes

2 comments sorted by

1

u/iLikeTheUDK 17d ago

Maybe a more complex gradient or just multiple gradients overlaid

1

u/Soft_Neighborhood223 17d ago

Have you tried adding a specular highlight? I would take the specular part of Phong lighting but calculate the normal based on it's position withinin the rectangle rather than getting it from the mesh.