mojira.dev
MC-304778

RGSS samples can be cut to half

Minecraft’s RGSS code is sampling high and low integer mip level separately, and then blend them with fractional part of calculated mip level. However, as Minecraft’s block atlas texture is using linear mip filter, this blend can be done in GPU part by directly using mipLevelExact as mip level in textureLod calls, which means we can merge 4x2 RGSS samples to 4x1.

This is a resource pack with optimized RGSS shaders, and containing local git repository for comparing code diff with vanilla.

[media]

These 2 images are result comparation, and containing 2 references only using higher or lower mip level in RGSS code.

Compare1.png
Compare2.png

This is Nsight Graphics' GPU Trace captures, showing performance difference before and after optimization. Using 16x16x16 trial spawmers aligned to render chunk as test scene. As GPU Trace will lock GPU to base clock, in normal gameplay performance will be better on both side.

Performance.png

Environment

Ryzen7 7700X
GeForce RTX 4070

Attachments

Comments 0

No comments.

GeForceLegend

(Unassigned)

Unconfirmed

(Unassigned)

1.21.11 Release Candidate 1

Retrieved