Fix Iris matrices when rendering sublevels#326
Fix Iris matrices when rendering sublevels#326djefrey wants to merge 1 commit intoryanhcode:mainfrom
Conversation
Iris replaces ShaderInstance with ExtendedShader. When ExtendedShader.apply() is called, modelViewInverse and normalMatrix are updated using MODEL_VIEW_MATRIX value. However, in VanillaChunkedSubLevelRenderData.renderChunkedSubLevel(), MODEL_VIEW_MATRIX.set() is called after apply() has already been called. This leaves the Iris matrices in an incorrect state. This is fixed by delaying the apply() call until just before rendering.
|
tested, awesome! What's with the dynamic effects uniforms not needing to be uploaded anymore? |
|
oh, is it because the apply is afterwards now and uploads them anyway? yeah okay |
|
I made the change when I removed the now useless uploads. |
|
will this have any more noticeable impact than just uploading the individual uniforms like we were doing before? |
|
I've done a simple benchmark: 354 sublevels on a flat world, no shaderpack. However, I noticed that this commit introduces a significant performance regression, as the previous version is around ~1400fps. This regression is caused by |
|
With those numbers, I think it's worth it to have explicit compatibility with Iris here |
Iris replaces
ShaderInstancewithExtendedShader.When
ExtendedShader.apply()is called,modelViewInverseandnormalMatrixare updated usingMODEL_VIEW_MATRIXvalue.However, in
VanillaChunkedSubLevelRenderData.renderChunkedSubLevel(),MODEL_VIEW_MATRIX.set()is called afterapply()has already been called. This leaves the Iris matrices in an incorrect state.This can be fixed by delaying the
apply()call until just before rendering.Before:

After:
