Slightly more accurate, likely going to have to change how paletted textures work
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#ifdef DUSK_OPENGL_LEGACY
|
#ifdef DUSK_OPENGL_LEGACY
|
||||||
shaderdefinition_t SHADER_UNLIT_DEFINITION = { 0 };
|
shaderdefinition_t SHADER_UNLIT_DEFINITION = { 0 };
|
||||||
#elifdef DUSK_OPENGL_ES
|
#elif defined(DUSK_OPENGL_ES)
|
||||||
shaderdefinition_t SHADER_UNLIT_DEFINITION = {
|
shaderdefinition_t SHADER_UNLIT_DEFINITION = {
|
||||||
.vert =
|
.vert =
|
||||||
"#version 300 es\n"
|
"#version 300 es\n"
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
"out vec4 FragColor;\n"
|
"out vec4 FragColor;\n"
|
||||||
"void main() {\n"
|
"void main() {\n"
|
||||||
" vec4 texColor = texture(u_Texture, v_TexCoord);\n"
|
" vec4 texColor = texture(u_Texture, v_TexCoord);\n"
|
||||||
" uint index = uint(floor(texColor.r * 255.0));\n"
|
" uint index = uint(clamp(texColor.r * 255.0 + 0.5, 0.0, 255.0));\n"
|
||||||
" uint palColor = u_Colors[index];\n"
|
" uint palColor = u_Colors[index];\n"
|
||||||
" float r = float((palColor >> 24) & 0xFFu) / 255.0;\n"
|
" float r = float((palColor >> 24) & 0xFFu) / 255.0;\n"
|
||||||
" float g = float((palColor >> 16) & 0xFFu) / 255.0;\n"
|
" float g = float((palColor >> 16) & 0xFFu) / 255.0;\n"
|
||||||
@@ -84,7 +84,6 @@
|
|||||||
" float a = float((palColor >> 0) & 0xFFu) / 255.0;\n"
|
" float a = float((palColor >> 0) & 0xFFu) / 255.0;\n"
|
||||||
" vec4 paletteColor = vec4(r, g, b, a);\n"
|
" vec4 paletteColor = vec4(r, g, b, a);\n"
|
||||||
" FragColor = paletteColor;\n"
|
" FragColor = paletteColor;\n"
|
||||||
// " FragColor = paletteColor * v_Color;\n"
|
|
||||||
"}\n"
|
"}\n"
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user