Skip to content

[Feature]: Enhance text embossing with grayscale height mapping #13

@chrisreddington

Description

@chrisreddington

Description

Currently, the text rendering in gh-skyline uses a binary threshold for pixel values when creating the 3D text geometry. This results in a "hard" embossing effect where pixels are either fully raised or not at all. We can improve the visual quality by using the pixel's grayscale/whiteness value to determine the embossing height, which would preserve font anti-aliasing in the 3D output.

Requirements

  • Modify the text rendering logic to use pixel whiteness values (0-1) to scale embossing height
  • Update isPixelActive() to return a float value representing pixel intensity instead of boolean
  • Scale the voxel depth based on the pixel intensity value
  • Maintain backward compatibility with existing cube generation functions
  • Handle edge cases (completely black/white pixels) appropriately

Definition of Done

  • Text rendering uses grayscale values to determine embossing height
  • Anti-aliased edges of text are preserved in the 3D output
  • Documentation is updated to reflect the new behavior
  • Unit tests cover various pixel intensity scenarios
  • Visual regression tests show improved quality at text edges

Additional Notes

  • Consider adding a configuration option to toggle between binary and grayscale modes
  • Pixel intensity calculation should account for RGB channels appropriately
  • May need to adjust overall embossing depth to maintain visual balance
  • Consider impact on STL file size due to increased geometry complexity

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status

Ready to Start

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions