Document code, and clean up

This commit is contained in:
PedroEdiaz
2024-10-21 16:50:49 -06:00
parent 6e54aa9fea
commit 17e1cf8804
13 changed files with 245 additions and 193 deletions

View File

@@ -62,7 +62,12 @@ const char * fs =
" vec3 lightPos = vec3(0,0,-15);"
" vec3 lightDir = normalize(lightPos - FragPos);"
" float diffuse = max(dot(Normal, lightDir), 0.0);"
/*
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 ambient = 0.5;"
" FragColor = (ambient + diffuse)*color;"
"}";