Commit 08c90f7
[Sofa.GL] DrawToolGL: improve indices text rendering quality (#6093)
* auto-scale indices display based on camera distance
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
* improve indices text rendering quality
- 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
* set an option to render with depth test (true by default)
---------
Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>1 parent 0cf5f5e commit 08c90f7
2 files changed
Lines changed: 39 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
214 | 219 | | |
215 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
216 | 225 | | |
217 | 226 | | |
218 | 227 | | |
| |||
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
226 | | - | |
227 | | - | |
228 | 235 | | |
229 | 236 | | |
230 | 237 | | |
| |||
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 258 | + | |
256 | 259 | | |
257 | 260 | | |
258 | 261 | | |
| |||
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
284 | 312 | | |
285 | 313 | | |
286 | 314 | | |
| |||
295 | 323 | | |
296 | 324 | | |
297 | 325 | | |
| 326 | + | |
298 | 327 | | |
299 | 328 | | |
300 | | - | |
301 | 329 | | |
302 | 330 | | |
303 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments