aboutsummaryrefslogtreecommitdiff
path: root/bin/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'bin/main.lua')
-rw-r--r--bin/main.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/main.lua b/bin/main.lua
index ca3108c..11af7fd 100644
--- a/bin/main.lua
+++ b/bin/main.lua
@@ -8,7 +8,7 @@ vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords)
vec3 light_vec = vec3(mouse,1);
vec3 light_direction = light_vec - vec3(pixel_coords, 0);
float distance = length(light_direction);
- light_direction = normalize(light_direction) * abs(sin(i));
+ light_direction = normalize(light_direction);
vec3 normal = Texel(texture, texture_coords).xyz;
normal.y = 1 - normal.y;
@@ -58,16 +58,17 @@ jin.core.onEvent = function(e)
end
end
local mx, my
-jin.core.onUpdate = function()
+jin.core.onUpdate = function(dt)
mx, my = jin.mouse.position()
mx = mx / 2
my = my / 2
- my = wh - my
+ my = wh - my
end
img:setAnchor(16, 16)
local cvs = jg.Canvas(320, 240)
local i = 0
jin.core.onDraw = function()
+-- if true then return end
i = i + 0.1
jg.bind(cvs)
jg.use(effect)