Fix gamma, add Glad, error if glad is compiled with emscripten

This commit is contained in:
PedroEdiaz
2024-11-28 09:55:48 -06:00
parent 589721a953
commit 1e009d5bdf
5 changed files with 19 additions and 9 deletions

View File

@@ -67,7 +67,8 @@ const char * fs_plain =
"void main()"
"{"
" FragColor = texture( palette, vec3( 0, 0, index ) ).rgba;"
" vec4 color = texture( palette, vec3(0,0,index)).rgba;"
" FragColor = vec4(pow(vec3(color),vec3(1.0/2.2)),color.a);"
"}";
const char * fs =
@@ -102,6 +103,6 @@ const char * fs =
" float specular = pow(abs(dot(normalize(Normal), halfwayDir)), 32.0);\n"
" float diffuse = abs(dot(normalize(Normal), lightDir));\n"
" vec3 result = (0.5 + 1.5*diffuse + 4*specular) * color.rgb;\n"
" FragColor = vec4(result, color.a)*1/2.2;\n"
" vec3 result = pow((0.5 + 0.5*diffuse + 1.5*specular) * color.rgb, vec3(1.0/2.2));\n"
" FragColor = vec4(result, color.a);\n"
"}";