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

[Iris] Merge Rendering Experiments to 1.18.1 #77

Merged
merged 5 commits into from
Mar 27, 2022

Conversation

Merith-TK
Copy link
Collaborator

No description provided.

- VBO monitor renderer path has been hijacked to test not using VBOs,
 instead we recreate the terminal geometry every frame.
- Add an explicit call the BufferSource.endBatch(). This actually fixes
 the incompatibility with Batched Entity Rendering. Who knew it was that
 easy?

 Results: works with Iris without shaders enabled.
- FixedWidthFontRenderer now emits quads and fills out all the vertex
 elements needed for the entity vertex format, which is, well, *all* of
 them.
- FixedWidthFontRenderer now takes a PoseStack so it can offset the char
 quads from the background.
- TERMINAL_MODE changed to quads so remaining custom RenderTypes work
 with FWFR.

New progress at this commit:
- Iris and Canvas both render the hi-jacked VBO backend properly.

Issues:
- Char quads have a blacker background than empty quads due to
 mismatched lightmaps.
- Items in hand have improper normals.
- TBO renderer is untested. Need to make sure it wasn't broken.
Progress:
- "VBO" code path now works fine with shaders.
- Printout GUI has lightmap issue.
- Pocket computer frames don't have right normals in world.
- Pocket computer lights don't work.

TODOs:
- Investigate whether VBOs can be used again without breaking compat.
If not, the code path needs to be renamed and the code for managing VBO
resources should be removed.
- Make sure TBO code path still works. Wouldn't be surprised if I broke
something there.
Progress:
- Monitors render fullbright in every direction.
- Normals are right on pocket computers and printouts, so lighting
  effects like directional light and shadow maps looks correct.
- BEST monitor renderer settings will detect shader mods and
  automatically enable shader compatible code path.

Details:
- The "textIntensity" rendertype is exactaly what we need for monitors.
  It's shader doesn't apply a directional light so monitors look
  fullbright consistent no matter what direction they're facing.
- Consolidated all references to rendertypes into RenderTypes class.
- Improved consistency of rendering classes. Methods pass a PoseStack
  instead of a Matrix4f down the chain where possible so that normals
  can be calculated, and most rendering classes now fill out all vertex
  elements so they can be used with any vanilla vertex format.
- Rendering methods should prefer to take a VertexConsumer rather than a
  BufferSource, the caller should provide appropriate buffer as that's
  where the context for buffer choice is.

TODO:
- Investigate re-enabling VBOs, and, if not an option, clean up naming
  and VBO related resource code.
Things were extremely slow without them in torture tests. They seem to
work fine with Iris. Will need to test with Canvas too. I don't know why
that hack with the inverse view rotation uniform works but fog doesn't
render correctly without it.

Unfortunately, the z-offset method does cause visible artifacts.
Background quads can sometimes be seen under the edges of adjacant
characters, giving the monitor a stitched together look. Will have to
investigate splitting all the background and char quads into two draw
calls and using glPolygonOffset on the characters :( which probably
means two vbos :( :(
@Merith-TK Merith-TK merged commit fb43159 into mc-1.18.x/1.18.1 Mar 27, 2022
@SquidDev SquidDev deleted the rendering-experiments branch April 28, 2022 21:35
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.

2 participants