-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Jozufozu
wants to merge
14
commits into
1.20/dev
Choose a base branch
from
1.20/text-visual
base: 1.20/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
Jozufozu
force-pushed
the
1.20/text-visual
branch
from
September 29, 2024 19:14
4b4bddd
to
183e2d7
Compare
- 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.