Skip to content

Commit

Permalink
winex11.drv: fshack: Interpolate looked up colour in gamma shader.
Browse files Browse the repository at this point in the history
CW-Bug-Id: #20400
  • Loading branch information
Paul Gofman authored and ivyl committed Mar 30, 2022
1 parent 3caf432 commit 0e62b8d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions dlls/winex11.drv/opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2149,12 +2149,19 @@ static const char *fs_hack_gamma_frag_shader_src =
"\n"
"layout(location = 0) out vec4 outColor;\n"
"\n"
"vec3 color_from_index(vec3 index)\n"
"{\n"
" ivec3 i = ivec3(index);\n"
" return vec3(values[i.r].r, values[i.g].g, values[i.b].b);\n"
"}\n"
"\n"
"void main(void)\n"
"{\n"
" vec4 lookup = texture(tex, texCoord) * 255.0;\n"
" outColor.r = values[int(lookup.r)].r;\n"
" outColor.g = values[int(lookup.g)].g;\n"
" outColor.b = values[int(lookup.b)].b;\n"
" vec3 lookup = texture(tex, texCoord).xyz * 255.0;\n"
" vec3 lookup1, lookup2;\n"
" lookup1 = floor(lookup);\n"
" lookup2 = ceil(lookup);\n"
" outColor.xyz = mix(color_from_index(lookup1), color_from_index(lookup2), lookup - lookup1);\n"
" outColor.a = 1.0;\n"
"}\n"
;
Expand Down

0 comments on commit 0e62b8d

Please sign in to comment.