Skip to content

SDF Font generation#1333

Closed
marauder2k7 wants to merge 28 commits intoTorqueGameEngines:developmentfrom
marauder2k9-torque:SDFFontGeneration
Closed

SDF Font generation#1333
marauder2k7 wants to merge 28 commits intoTorqueGameEngines:developmentfrom
marauder2k9-torque:SDFFontGeneration

Conversation

@marauder2k7
Copy link
Contributor

needs work but the basic groundwork is there

@Azaezel Azaezel added the WIP Issue is a known Work In progress; Please Check back later label Dec 5, 2024
backup before a rip my hair out.
SDF Generation works but is generating incorrect output.
sdf fixed had to use an upscaled original glyph....
added shader in hlsl to render the font on screen statics for now but will become uniforms for customisation.
some tweaks and docs added to the shader
also removed previous debug alpha check and added a discard
fix spacing size.
use spread function instead of fixed value
move all the * 0.25 to gfont so its centralized for later
added a debug view to gfxFontRenderBatcher
updated font glyph metrics for padding
most changes made for str width, height and xIncrement.... more to be done.
updates to padding and render logic
changed more function calls!
reuse functions that take rounding into account
add glsl shader for rendering sdf
change console profile to use arial, lucida didnt like sdf....
update file version and push error if its not a match
few missed usages
commented out debug image output
cleanup some excess code
change a few classes to use precise, mostly tooltips so the box fully encompasses the text
wasnt packing glyphs......
add sheet fixes, wasnt calculating and reseting values...... yeah..
reduced inner loops for the sdf function to speed up generation
fix missing characters in lucida, not converting to f32 was bad....
comment out debug output
change the sdf algo to calc the min middle distance as well
increase the intensity to push closer to white
apply a gaussian to the sdf after it is generated
increase the padding to stop overlap issues.
the sdf method now tweaks the values based on inner or outer distance and sets the min and max accordingly, hopefully making sure 0.5 is the glyph edge.
@marauder2k7
Copy link
Contributor Author

I have a better method for doing this, the branch is out of date since the new changes and would make more sense to just use this branch as a reference. Will have a new PR up for doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Issue is a known Work In progress; Please Check back later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants