Skip to content

[Sofa.GL] DrawToolGL: improve indices text rendering quality#6093

Merged
hugtalbot merged 5 commits into
sofa-framework:masterfrom
fredroy:update_showindices_render
May 21, 2026
Merged

[Sofa.GL] DrawToolGL: improve indices text rendering quality#6093
hugtalbot merged 5 commits into
sofa-framework:masterfrom
fredroy:update_showindices_render

Conversation

@fredroy
Copy link
Copy Markdown
Contributor

@fredroy fredroy commented Apr 23, 2026

Based on

3 improvements:

  • enable mipmap so the rendering when smaller will be better quality
  • disable depth test so no more hidden indices re-enabled per reviewer request
  • add shadow around the indices, so it is readable with a white/clear background

before:
Screenshot 2026-04-23 at 13 00 51
Screenshot 2026-04-23 at 13 00 58

PR:
Screenshot 2026-04-23 at 13 08 46
Screenshot 2026-04-23 at 13 08 27

--
EDIT: with depth test
Screenshot 2026-04-24 at 15 50 15
Screenshot 2026-04-24 at 15 50 21


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

fredroy added 2 commits April 23, 2026 11:34
The indices text now maintains a constant screen-space size regardless of zoom level and scene dimensions, removing the need to manually adjust showIndicesScale per scene.

  - Compute per-vertex scale from the projection matrix and camera depth in GlText::textureDraw_Indices
  - Handle both perspective and orthographic projections
  - Add alpha blending for smoother text rendering
  - Update all callers to pass a dimensionless multiplier (default 1.0) instead of bbox-dependent world-space size
- Add drop shadow (black, 70% opacity, 1.5px offset) behind each label for readability against any background
- Disable depth test so indices always render on top of geometry
- Enable mipmaps on the ASCII texture atlas for cleaner downsampling
@fredroy fredroy added pr: enhancement About a possible enhancement pr: status to review To notify reviewers to review this pull-request pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI labels Apr 23, 2026
@hugtalbot
Copy link
Copy Markdown
Contributor

Thank you so much @fredroy
Users will enjoy it!

@alxbilger alxbilger added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels May 19, 2026
@hugtalbot
Copy link
Copy Markdown
Contributor

There were minor conflicts, @fredroy could you check my corrections please?

@fredroy
Copy link
Copy Markdown
Contributor Author

fredroy commented May 20, 2026

There were minor conflicts, @fredroy could you check my corrections please?

should be ok

@hugtalbot hugtalbot merged commit 08c90f7 into sofa-framework:master May 21, 2026
13 checks passed
@hugtalbot hugtalbot deleted the update_showindices_render branch May 21, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI pr: enhancement About a possible enhancement pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants