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

[graphics] tfrag3 renderer #978

Merged
merged 16 commits into from
Dec 4, 2021
Merged

[graphics] tfrag3 renderer #978

merged 16 commits into from
Dec 4, 2021

Conversation

water111
Copy link
Collaborator

There are a few things to take care of before we can merge this:

  • make the extractor print an error if you don't have the DGO
  • handle the final boss missing texture somehow
  • handle the connection from the game to the renderer - right now the levels/time of day are not sent to the renderer.
  • make a nicer "debug" mode that lets you turn on many levels at once, or override time of day from the game
  • general clean up of the extractor

Known issues:

  • the loading causes a short pause.
  • some alpha blending modes are not supported.
  • ice and trans do not appear to render at all
  • the texture wrapping in boggy swamp might be wrong
  • there is a bright white thing in fj temple (might just be the alpha not handled right)
  • there is an issue with texture coordinate clamping - we may need separate modes for clamp u/clamp v.

Future to-do:

  • frustum culling (the bspheres are in the format already and the index data is arranged so this is easy to check)
  • vertex deduplication
  • some more checks of the z buffer scaling/accuracy. The stuff super far in the distance is close to being clipped and there's some fighting on the weird mountain things in finalboss.

@water111
Copy link
Collaborator Author

texture clamp bug:
image
missing transparent:
image
boggy swamp:
image

In good news the texture fighting on some things is much better. For example, the chain in rock village is perfect now (this is bad even in PCSX2):
image

Also the mysterious texture corruptions, weird colors when looking up, and missing tfrags from previous renderers are completely gone.

@water111
Copy link
Collaborator Author

tfrag3 with sprites:
image

@water111
Copy link
Collaborator Author

The texture clamp issue is just that we need separate u/v clamps. Adding this increased draw calls by ~15%. I think if we really needed, we could manually inspect textures and pick clamps to reduce the total number of draw types. But probably not worth it for now, when we are under 100 draw calls/level.

The transparent stuff is luckily not an issue with extraction. The blue mesh is the transparent tfrag tree.
image

@coveralls
Copy link

coveralls commented Dec 4, 2021

Pull Request Test Coverage Report for Build 1537922048

  • 119 of 1818 (6.55%) changed or added relevant lines in 50 files are covered.
  • 33 unchanged lines in 14 files lost coverage.
  • Overall coverage decreased (-1.0%) to 54.64%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/util/Serializer.h 0 1 0.0%
decompiler/ObjectFile/ObjectFileDB_IR2.cpp 0 1 0.0%
decompiler/analysis/mips2c.cpp 0 1 0.0%
decompiler/data/TextureDB.h 0 1 0.0%
decompiler/level_extractor/extract_tfrag.h 0 1 0.0%
game/graphics/opengl_renderer/Profiler.cpp 0 1 0.0%
game/graphics/opengl_renderer/debug_gui.cpp 0 1 0.0%
game/mips2c/mips2c_table.h 0 1 0.0%
decompiler/analysis/label_types.cpp 0 2 0.0%
decompiler/Disasm/InstructionDecode.cpp 3 6 50.0%
Files with Coverage Reduction New Missed Lines %
decompiler/config.cpp 1 0%
decompiler/ObjectFile/ObjectFileDB.cpp 1 0%
game/graphics/opengl_renderer/Shader.cpp 1 0%
game/graphics/opengl_renderer/tfrag/program6_cpu.cpp 1 0%
game/graphics/opengl_renderer/tfrag/TFragment.cpp 1 0%
tools/level_tools/level_dump/main.cpp 1 0%
decompiler/data/dir_tpages.cpp 2 0%
decompiler/data/game_text.cpp 2 0%
decompiler/data/tpage.cpp 2 0%
decompiler/util/data_decompile.cpp 2 49.53%
Totals Coverage Status
Change from base Build 1528481071: -1.0%
Covered Lines: 40507
Relevant Lines: 74135

💛 - Coveralls

@water111 water111 merged commit 0832029 into master Dec 4, 2021
@water111 water111 deleted the w/tfrag-extractor branch December 4, 2021 17:33
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