diff options
author | Sebastian Park <SebPark03@gmail.com> | 2024-04-22 22:35:26 -0400 |
---|---|---|
committer | Sebastian Park <SebPark03@gmail.com> | 2024-04-22 22:35:26 -0400 |
commit | b4be9e522b51b01c7870821648e85f97c1fdb09b (patch) | |
tree | ed7f9274c46af89fb3b3dc917cb5cf8e35bc3024 | |
parent | c7207643ad8c39f8ab802791f5833f4af23f67b6 (diff) |
Add more diffuse and increase beer constant.
-rwxr-xr-x | resources/shaders/shader.frag | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/shaders/shader.frag b/resources/shaders/shader.frag index c48bbe6..82a0387 100755 --- a/resources/shaders/shader.frag +++ b/resources/shaders/shader.frag @@ -45,7 +45,7 @@ void main() { // fragColor = vec4(fragColor.x, 0.f, fragColor.z, 1.f); // fragColor = vec4(test, test, test, 1.f); vec2 refrUV = uvFromWorldPoint(refrPos); - float beerAtt = exp(-length((pos - refrPos)) * 0.5f); + float beerAtt = exp(-length((pos - refrPos)) * 2.0f); // TODO: Make uniform vec4 diffuse = vec4(red * d, green * d, blue * d, 1.0f); vec4 specular = vec4(1, 1, 1, 1) * pow(spec, 10.f); @@ -53,7 +53,7 @@ void main() { // refrProb *= beerAtt; - fragColor = 0.4f * diffuse; // Diffuse + fragColor = 0.75f * diffuse; // Diffuse fragColor += 0.6f * specular; // Specular TODO: Pass multiplications as uniforms. fragColor = clamp(fragColor, 0.f, 1.f); // Clamp fragColor *= (1 - ((beerAtt * refrProb) / 1.f)); @@ -63,4 +63,9 @@ void main() { // Dividing refrProb by 2 just for heuristic. Want more phong to show through. // fragColor = clamp(fragColor, 0.f, 1.f); // fragColor = vec4(refrProb, 0.f, 0.f, 1.f); + + // TODO: ACTUAL LIGHTING MODEL SHOULD BE SOMETHING LIKE + // VELOCITY * DIFFUSE + // (1 - refrProb) * SPECULAR + // refrProb * (BEER * TRANSMISSIVE + (1 - beerAtt) * VOLUME (which is somewhat diffuse too?)) } |