Page MenuHome

GPU: Add Polyline shader (wide line emulation)
ClosedPublic

Authored by Clément Foucault (fclem) on Apr 21 2020, 11:20 PM.
Tags
None
Subscribers
None
Tokens
"Love" token, awarded by Tetone."Love" token, awarded by billreynish."Love" token, awarded by Severin.

Details

Summary

This new shader is able to emulate smooth wide lines drawing using a
geometry shader.

This shader needs viewportSize and lineWidth uniforms to be set.

There is multiple variants to replace the usage of wide lines for most
shaders.

A version without geometry shader could be developped for metal in
the future based on this implementation since we can create a special
routine in immBegin based on the bound shader.

This patch only fix the gizmo_types files and the navigation gizmo.
Other areas could be fixed afterward, I just limited the patch size.

Would be nice to include that for 2.83 as it is a huge usability issue.

Related to T57570.

Diff Detail

Repository
rB Blender
Branch
tmp-wide-line-emulation (branched from master)
Build Status
Buildable 7665
Build 7665: arc lint + arc unit

Event Timeline

Clément Foucault (fclem) requested review of this revision.Apr 21 2020, 11:20 PM
Clément Foucault (fclem) created this revision.
  • Fix shader not working on OSX
  • Add perpendicular direction offset as it is better in most cases

This seems to work to make lines display thick on macOS.

This revision is now accepted and ready to land.Apr 23 2020, 11:05 PM