CaffeineMC / sodium-fabric

A Minecraft mod designed to improve frame rates and reduce micro-stutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vertex color alpha is not supported

PepperCode1 opened this issue · comments

Request Description

Terrain geometry, built using block models and the default fluid renderer or fluid render handlers, encodes vertex color. In vanilla, all four components of the color work as expected, being multiplied into the corresponding component of the final fragment color at some point. However, Sodium uses the vertex color alpha as an additional multiplier for all other color components, usually equivalent to the AO value from smooth lighting, instead of a multiplier for the fragment alpha. With Sodium 0.6 officially supporting FRAPI, which allows modifying all components of the vertex color, and with support for fluid render handlers being added recently, which also support creating geometry with vertex colors in which the alpha is less than one, it would make sense for Sodium to match vanilla behavior for better mod compatibility than to perform the AO multiplication on the GPU for a likely imperceptible performance improvement.

It is true that Iris passes the AO values in the alpha component of the vertex color when a shaderpack enables the "separateAo" feature, but Iris' shaderpack format should not hinder mod compatibility when Iris is not even present. Iris should also consider changing its format to support vertex color alpha by putting the AO value into the W component of the normal vector, which is normally padding and thus unused.

This is also required for compatibility with Fluid Void Fading.

We will triage this for Sodium 0.6.0-beta1.