1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-09-03 02:47:56 +00:00
Files
CC-Tweaked/src/main
Merith d8bb05f30e [Iris] Merge Rendering Experiments to 1.18.2 (#78)
* Quick and dirty test.

- 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.

* Use entity RenderType for rendering terminals in world.

- 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.

* More stuff

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.

* Found a new rendertype for monitors, fixed normals

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.

* Re-enable vbos

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 :( :(

Co-authored-by: Toad-Dev <748280+toad-dev@users.noreply.github.com>
2022-03-27 15:13:53 -07:00
..
2022-03-27 09:26:06 +02:00