mojira.dev
MC-310220

Redundant multipliers (COEFF_COUNT-1 / COEFF_COUNT) in OIT .glsl file.

In oit_depth_sample.glsl, at line 28, function normalizeDepth:

return mappedDepth * (1.0 - 1.0 / COEFF_COUNT);

The return value is then multiplied by the same factor again at other two places.

In oit_sample.glsl, at line 20, function evaluateWaveletsCorrected:

depth *= float(COEFF_COUNT - 1) / COEFF_COUNT;

And in oit_add_transmittance.glsl, at line 16, function addTransmittance:

depth *= float(COEFF_COUNT - 1) / COEFF_COUNT;

This mistake may cause a drop in accuracy. I suggest to remove the latter two line of codes.

I applied this solution to a resource pack, and the game works properly. So I suspect that the current implementation is not intended.

Attachments

Comments 4

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media]

Addition: in oit_sampple.glsl, between lines 17~20, this multiplier is wrongly applied after the first use of depth

float scaleCoeffAddend = (currentAbsorbance * -depth) + currentAbsorbance;
scaleCoeff -= scaleCoeffAddend;

depth *= float(COEFF_COUNT - 1) / COEFF_COUNT;

Hi!
Thank you for your report!ย 

  • Can you elaborate on why would it be considered as a bug? What impact on Player it has?

  • Can you also point differences between these two screenshots?

Quick Links:ย 
๐Ÿ““โ€ฏIssue Guidelinesโ€ฏโ€“ ๐Ÿ’ฌโ€ฏMojang Supportโ€ฏโ€“ ๐Ÿ“งโ€ฏSuggestionsโ€ฏโ€“ ๐Ÿ“–โ€ฏMinecraft Wiki

Fixed in 26.3-snapshot-7.

xuyifan

(Unassigned)

Unconfirmed

26.3 Snapshot 4

26.3 Snapshot 7

Retrieved