summaryrefslogtreecommitdiff
path: root/resources/shaders/shader.frag
diff options
context:
space:
mode:
authorSebastian Park <SebPark03@gmail.com>2024-04-22 22:35:26 -0400
committerSebastian Park <SebPark03@gmail.com>2024-04-22 22:35:26 -0400
commitb4be9e522b51b01c7870821648e85f97c1fdb09b (patch)
treeed7f9274c46af89fb3b3dc917cb5cf8e35bc3024 /resources/shaders/shader.frag
parentc7207643ad8c39f8ab802791f5833f4af23f67b6 (diff)
Add more diffuse and increase beer constant.
Diffstat (limited to 'resources/shaders/shader.frag')
-rwxr-xr-xresources/shaders/shader.frag9
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?))
}