Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add text visuals to optimize sign and nametag rendering #262

Open
wants to merge 14 commits into
base: 1.20/dev
Choose a base branch
from

Conversation

Jozufozu
Copy link
Member

No description provided.

Jozufozu and others added 9 commits September 29, 2024 12:12
- Get text instancing minimally working
- Use special glyph instance type to instance all characters under the
  same mesh
- Unfortunately MC's font stuff is not threading friendly so hacks were
  required to allow visuals to query glyphs from their beginFrame
- Mixin to CodePointMap to overwrite most methods and synchronize
- Mixin to FontSet to use a custom AsyncFontTexture that defers texture
  init and upload
- Trying to mixin directly to FontTexture or subclass it is very
  complicated because of the calls to getId, but I think that can be
  improved
- Move all text handling into the TextVisual class
- Add SignVisual
- Flesh out the glyph model cache
- Render effect glyphs
- Clean up variable names
- Add mixinextras and remove overwrite
- Merge AsyncFontTexture and FontTexture

Signed-off-by: Jozufozu <[email protected]>
- Rely on transform matrix for all font vertex position stuffs
- Use a skew matrix for italics
- Fix glowing sign rendering
- Use 2 instances per character
- Move most glyph mesh state into the GlyphMode enum
- GlyphSettings now has a GlyphMode and a bold boolean
- Disable diffuse for text
- Render normal text with polygon offset and bias the instancers for
  normal text so they appear in front of shadows or outlines
- Make sink static
- Fix glyph instance color being unnormalized
- TextVisual renders an arbitrary number of layers
- Layers have relatively fine control over how the glyph instances are
  set up
- Encapsulate all fields in TextVisual
- Move Sinks to a thread local
- Move all font/text related mixins into impl
- Handle obfuscation in SignVisuals
- Save 8 bytes per glyph instance by switching uvs to
  FloatRepr.NORMALIZED_UNSIGNED_SHORT
- With vanilla's 256x glyph atlases we could technically save another 4
  bytes, but that would make compat with caxton, which uses 4096x
  atlases, much more difficult later
PepperCode1 and others added 5 commits October 5, 2024 20:17
- Fix packed uvs from being saturated
- Calculate actual bounding sphere for glyph meshes
- Cull objects that are less than a pixel on the screen
- Move text layer handling to the inner loop of Sink
- Make key methods static and pass layer as a parameter
- Flatten TextVisual API to be less of a parameter container
- This is mostly a surface change
- Do not accept x and y positions, instead force the user to translate
  in their matrix
- Track light from light updates to apply when setting up text
- Add (unoptimized) updateLight, backgroundColor, and updateObfuscated
  methods to TextVisual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants