local shader; local program = [[ extern Texture img; extern number dt; Color effect(Color col, Texture tex, vec2 uv, vec2 screen) { return Texel(img, uv); //return vec4(1, 0, 1, 1); //return sin(dt)*Texel(tex, uv) * Texel(img, uv); } ]] local img local img2 function jin.core.onLoad() shader = jin.graphics.newShader(program) img = jin.graphics.newTexture("img.png") img2 = jin.graphics.newTexture("img2.bmp") end function jin.core.onEvent(e) if e.type == "quit" then jin.core.stop() end end local dt = 0 function jin.core.onDraw() dt = dt + 0.1 jin.graphics.useShader(shader) shader:sendTexture("img", img2) shader:sendNumber("dt", dt) jin.graphics.draw(img, 0, 0) jin.graphics.unuseShader() end