35 lines
854 B
Lua
35 lines
854 B
Lua
effect = nil
|
|
video = nil
|
|
|
|
function _create()
|
|
video = Texture.FromGStreamer("filesrc location=" .. Resolve("sunset.mkv"))
|
|
|
|
local fxSrc = [[uniform sampler2D uTexture;
|
|
|
|
void main() {
|
|
vec2 uv = vUV;
|
|
|
|
for (int i = 0; i < uNumDisplays; i++) {
|
|
vec4 displayNorm = uDisplayNorm[i];
|
|
|
|
if (vUV.x >= displayNorm.x && vUV.x <= displayNorm.x + displayNorm.z &&
|
|
vUV.y >= displayNorm.y && vUV.y <= displayNorm.y + displayNorm.w) {
|
|
FragColor = texture(uTexture, GetDisplayUV(uTexture, i));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
]]
|
|
effect = Effect.new(fxSrc)
|
|
end
|
|
|
|
function _update(dt)
|
|
|
|
end
|
|
|
|
function _render()
|
|
gl.Clear(0, 0, 0, 1.0)
|
|
effect:Use()
|
|
effect:SetTexture("uTexture", video, 0)
|
|
effect:Render()
|
|
end |