Привет, у меня есть ресурспак майн, который меняет цвет текста, но когда я подсвечиваю с…
- User
Привет, у меня есть ресурспак майн, который меняет цвет текста, но когда я подсвечиваю с помощью светязегося мешочка, то там всё ломается, вот какие файлы у меня загружены:
// this shader file separates 'vertexColor' into the supplied color and the sampled texel, which allows the color code to be precisely identified in the 'rendertype_text.fsh' file.
// the supplied color ('Color') is the formatted text color. // I'm not certain what the sampled texel ('texColor') is, I think it's some sort of shading but I don't know why it applies to UI text.
#version 150
#moj_import <fog.glsl>
in vec3 Position; in vec4 Color; in vec2 UV0; in ivec2 UV2;
uniform sampler2D Sampler2;
uniform mat4 ModelViewMat; uniform mat4 ProjMat; uniform mat3 IViewRotMat; uniform int FogShape;
out float vertexDistance; out vec4 vertexColor; out vec4 texColor; //new out vec2 texCoord0;
void main() { gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
vertexDistance = fog_distance(ModelViewMat, IViewRotMat * Position, FogShape); vertexColor = Color; // Color * texelFetch(Sampler2, UV2 / 16, 0); texColor = texelFetch(Sampler2, UV2 / 16, 0); //new texCoord0 = UV0; }
(rendertype_text.vsh)
{ "blend": { "func": "add", "srcrgb": "srcalpha", "dstrgb": "1-srcalpha" }, "vertex": "rendertype_text", "fragment": "rendertype_text", "attributes": [ "Position", "Color", "texColor", "UV0", "UV2" ], "samplers": [ { "name": "Sampler0" }, { "name": "Sampler2" } ], "uniforms": [ { "name": "ModelViewMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "IViewRotMat", "type": "matrix3x3", "count": 9, "values": [ 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }, { "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] }, { "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] }, { "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }, { "name": "FogShape", "type": "int", "count": 1, "values": [ 0 ] } ] }
(rendertype_text.json)
#version 150
#moj_import <fog.glsl>
uniform sampler2D Sampler0;
uniform vec4 ColorModulator; uniform float FogStart; uniform float FogEnd; uniform vec4 FogColor;
in float vertexDistance; in vec4 vertexColor; in vec4 texColor; //new in vec2 texCoord0;
out vec4 fragColor;
void main() { vec4 color = vertexColor; if (color.a < 0.1) discard;
// red text if (color.r == 1.0 && color.g == 85/255.0 && color.b == 85/255.0) { color = vec4(0.99, 0.32, 0.19, 1); }
- Assistant