-
Notifications
You must be signed in to change notification settings - Fork 176
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
Improve the Quantum Storage Renderer #2318
Improve the Quantum Storage Renderer #2318
Conversation
(yes this is copied from the discord) Here's a sparkc profile without the renderer changes (in the quantum controller pr brance), and here's with the render changes. I'm not sure how accurate these are, but they were profiled for 300s while I'm looking at ~100 quantum storage chests and not moving. 2nd sparkc profile without the changes, and another with the changes |
(copied from discord) New profile with the text rendering removed + previous changes, and without any changes on master (with command |
New profiles: round 2 https://spark.lucko.me/HDGZWCFdtV - using mc's font renderer directly instead of TextTexture https://spark.lucko.me/KG13MeawaE - not rendering if the player is too far |
use static variable instead of creating a new renderer every frame
52c6c72
to
0f5f660
Compare
for (EnumFacing facing : EnumFacing.VALUES) { | ||
for (EnumFacing boxFace : EnumFacing.VALUES) { | ||
// do not render the box when "facing" is "frontFacing", otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't understand this part, we are already looping through EnumFacing, why do we need to start another loop through EnumFacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the outer loop is for the sides of the machine, the inner loop is for rendering the boxes for the inside and outside of the chest. essentially rendering certain faces of a box for each side.
src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumTank.java
Show resolved
Hide resolved
src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumTank.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/client/renderer/texture/custom/QuantumStorageRenderer.java
Show resolved
Hide resolved
b459b51
to
81f17e9
Compare
0ee0a01
to
8709399
Compare
…well split rendering of text and chest stack
d996734
to
d336641
Compare
d336641
to
7c2d690
Compare
(cherry picked from commit 06938f0)
(cherry picked from commit 06938f0)
What
This pr improves the quantum storage render by rendering the minimum amount of faces needed (15). Previously, it would render 31 faces.
also improves quantum tank rendering fluid contents by only rendering the two needed faces instead of all six
Implementation Details
idk why a
foreach()
was used for theboxFacingMap
also previously it was
facing, boxFacingMap.get(box)
inrenderFace()
, which looked backwards to mestore the TextTexture as a static final variable instead of instantiating it every frame
Outcome
more fps
Potential Compatibility Issues
none