Skip to content

Commit

Permalink
Added a darkened ring inside drop circumference + lightened spot in t…
Browse files Browse the repository at this point in the history
…he middle to mimic lensing better.
  • Loading branch information
GeReV committed Nov 11, 2020
1 parent 6aedca1 commit 943d106
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion assets/shaders/drop.frag
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ void main()

float opacity = smoothstep(0.0, 0.1, 1.0 - length(uv));

Color = vec4(color, opacity);
const float min_lightness = 0.2;
const float max_lightness = 1.2;
const float lightness_power = 3.0;
float lightness = mix(min_lightness, max_lightness, 1.0 - pow(length(uv), lightness_power));
// float lightness = 1.0;

Color = vec4(color * lightness, opacity);
}

0 comments on commit 943d106

Please sign in to comment.