From b4be9e522b51b01c7870821648e85f97c1fdb09b Mon Sep 17 00:00:00 2001 From: Sebastian Park Date: Mon, 22 Apr 2024 22:35:26 -0400 Subject: Add more diffuse and increase beer constant. --- resources/shaders/shader.frag | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'resources/shaders/shader.frag') 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?)) } -- cgit v1.2.3-70-g09d2