Merge: roberto -> main

This commit is contained in:
PedroEdiaz
2024-10-22 19:26:10 -06:00
parent b50fbf9d2d
commit 7787daa2da
6 changed files with 122 additions and 49 deletions

View File

@@ -45,6 +45,7 @@ const char * fs_plain =
" FragColor = texture( palette, vec3( 0, 0, index ) ).rgba;"
"}";
const char * fs =
"#version 330 core\n"
@@ -62,11 +63,7 @@ const char * fs =
" vec3 lightPos = vec3(0,0,-15);"
" vec3 lightDir = normalize(lightPos - FragPos);"
/*
We use the absoulute value, insted of the traditional "max(...,0.0);"
so we can ignore the orientation of the triangles in openGL.
*/
" float diffuse = abs(dot(Normal, lightDir)); "
" float diffuse = max(dot(Normal, lightDir),0.0); "
" float ambient = 0.5;"
" FragColor = (ambient + diffuse)*color;"