mojira.dev
MC-234030

Debug markers' colors no longer work

Hello,

 

The debug markers are really useful for developers to debug the game or even add new things to the game. Unfortunately since 1.17 the Blue and Red values of the color are no longer working.

 

What causes the issue?

The line:

fragColor = color * ColorModulator;

in the original assets assets/minecraft/shaders/core/position_color.fsh file:

#version 150
in vec4 vertexColor;
uniform vec4 ColorModulator;
out vec4 fragColor;
void main() {
 vec4 color = vertexColor;
 if (color.a == 0.0) {
 discard;
 }
 fragColor = color * ColorModulator;
}

 Working fix (tested with a resourcepack), thanks to @DeltaEvo :

#version 150
in vec4 vertexColor;
uniform vec4 ColorModulator;
out vec4 fragColor;
void main() {
 vec4 color = vertexColor;
 if (color.a == 0.0) {
 discard;
 }
 if (ColorModulator == vec4(0.0f, 1.0f, 0.0f, 0.75f))
 fragColor = color;
 else
 fragColor = color * ColorModulator;
}

 

Please use the fixed version or similar in a future update!

Thank you,

Thomas

Comments 5

Still not working on 1.18 pre-release 4... 😔

Still not working on 1.18 pre-release 6

Still not working on 1.18 Release Candidate 1

We do not have enough information to reproduce this issue.

Please include the following information to help us understand your problem:

Steps to Reproduce:
1. (Explain what needs to be done for the issue to happen)
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

Please also attach any needed commands, datapacks, resourcepacks, screenshots, videos, or worlds needed to help reproduce this issue.

Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

This is still an issue as of 1.21.11.


Steps to Reproduce:

  • Extract the 1.21.11 client JAR.

  • Open assets/minecraft/shaders/core/position_color.fsh.

  • Observe that vertex color is unconditionally multiplied by ColorModulator on line 14.


Code Analysis:

#version 330

#moj_import <minecraft:dynamictransforms.glsl>

in vec4 vertexColor;

out vec4 fragColor;

void main() {
    vec4 color = vertexColor;
    if (color.a == 0.0) {
        discard;
    }
    fragColor = color * ColorModulator;
}

assets/minecraft/shaders/include/dynamictransforms.glsl:

#version 330

layout(std140) uniform DynamicTransforms {
    mat4 ModelViewMat;
    vec4 ColorModulator;
    vec3 ModelOffset;
    mat4 TextureMat;
};


Observed Results: The shader unconditionally multiplies vertex color by ColorModulator (fragColor = color * ColorModulator). When debug markers are rendered, ColorModulator is set to vec4(0.0, 1.0, 0.0, 0.75), which zeroes out the Red channel (×0.0) and distorts Blue/Alpha (×0.75). Only the Green channel passes through correctly. Though the shader has been upgraded from GLSL 150 to 330 and ColorModulator moved from a standalone uniform into a UBO (DynamicTransforms), the core issue remains unchanged.

Expected Results: Debug markers should render with their intended colors, including Red and Blue values, as they did prior to 1.17.

Thomas Marchand

(Unassigned)

Community Consensus

(Unassigned)

1.17.1, 1.18 Pre-release 4, 1.18 Release Candidate 1, 1.21.11

Retrieved