Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ uniform float FogStart;
uniform float FogEnd;
uniform vec4 FogColor;

in int isGUI;
in int isHand;
flat in int isGUI;
flat in int isHand;
in float zpos;
in float vertexDistance;
in vec4 vertexColor;
Expand All @@ -33,12 +33,13 @@ void main() {
if (color.a < 0.1) discard; // Snipped due to size.

// updated to 1.19.4 thanks to the der discohund
// updated to 1.20 thanks to HalbFettKaese + Evtema3

// Switch used parts of the texture depending on where the model is displayed
if (isGUI == 0 && roughly_equal(alpha, 253.0, 0.01)) discard;
// Switch used parts of the texture depending on where the model is displayed (using alpha255 by default)
if (isGUI == 0 && roughly_equal(alpha255, 253.0, 0.01)) discard;
if (isGUI == 1) {
if (zpos > 125.0 && roughly_equal(alpha, 254.0, 0.01)) discard; // Handled as inventory slot
else if (zpos <= 125.0 && roughly_equal(alpha, 253.0, 0.01)) discard; // Handled as on the player doll
if (zpos > 100.0 && roughly_equal(alpha255, 254.0, 0.01)) discard; // Handled as inventory slot
else if (zpos <= 100.0 && roughly_equal(alpha255, 253.0, 0.01)) discard; // Handled as on the player doll
}

fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ out vec2 texCoord2;
out vec4 normal;

// updated to 1.19.4 thanks to the der discohund
// updated to 1.20 thanks to HalbFettKaese + Evtema3

// gui item model detection from Onnowhere
bool isgui(mat4 ProjMat) {
return ProjMat[3][2] == -2.0;
return abs(ProjMat[3][3]) > 0.01;
}
// first person hand item model detection from esben
bool ishand(float FogStart) {
Expand Down
2 changes: 1 addition & 1 deletion pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 8,
"pack_format": 15,
"description": "Adds a way to have different items in the hand and the GUI."
}
}