From c39ff632b46c179709101c5b50a061ebd723689f Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Sun, 26 Jan 2025 14:31:52 -0600 Subject: final commit --- src/shaders/land.frag | 16 +++++++++++++++- src/shaders/stars.lua | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src/shaders') diff --git a/src/shaders/land.frag b/src/shaders/land.frag index 1eb8d93..54ca24d 100644 --- a/src/shaders/land.frag +++ b/src/shaders/land.frag @@ -19,6 +19,7 @@ uniform float time; //used for noise uniform sampler2D atlas; uniform float nlamps; uniform float water; +//uniform sampler2D bubbles; varying vec2 worldxy; varying vec2 norm; @@ -78,8 +79,21 @@ void main() { float rng = random(vec2(coord.x, coord.y) + vec2(color, time)); color -= (pow(rng / 1.3, 10. * color)) * streamer; // add noise to water - if(water > 1.) + if(water > 1.){ color += (noise(coord.xy + vec2(time, time)) - 0.0) * 0.1; + } + if(water > 2.){ + color -= noise(coord.xy + vec2(time,time)) * 0.3; + } + /* + for(int i = 1; i < 1024; i++){ + vec4 bubble = texture2D(bubbles,vec2(i,0)); + /* + if(distance(bubble.xy, coord.xy) < 10.){ + color = 1.; + } + */ + //} /* */ if(color > 1.) gl_FragColor = highlight * normal.a; diff --git a/src/shaders/stars.lua b/src/shaders/stars.lua index 3e4138e..95938b4 100644 --- a/src/shaders/stars.lua +++ b/src/shaders/stars.lua @@ -68,7 +68,7 @@ node:action(function(self) self("bind").world_y = world.world_y local lamps = world.level.lamps_on_screen() for i,v in pairs(lamps) do - print("Setting lamp", i, "to", v) + --print("Setting lamp", i, "to", v) self("bind")["lamp" .. tostring(i)] = v end end) -- cgit v1.2.3-70-g09d2