Can you please explain how to convert shaders to the Löve?
For example this one: https://www.shadertoy.com/view/3s3GDn
Code: Select all
void mainImage( out vec4 fragColor, in vec2 fragCoord ){
vec2 uv = fragCoord/iResolution.xy;
vec2 pos = 0.5 - uv;
pos.y /= iResolution.x/iResolution.y;
float dist = 1.0/length(pos);
dist *= 0.1;
dist = pow(dist, 0.8);
vec3 col = dist * vec3(1.0, 0.5, 0.25);
col = 1.0 - exp( -col );
fragColor = vec4(col, 1.0);
}
Code: Select all
myShader = love.graphics.newShader[[
vec4 effect (vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords)
{
vec2 uv = fragCoord/iResolution.xy;
vec2 pos = 0.5 - uv;
pos.y /= iResolution.x/iResolution.y;
float dist = 1.0/length(pos);
dist *= 0.1;
dist = pow(dist, 0.8);
vec3 col = dist * vec3(1.0, 0.5, 0.25);
col = 1.0 - exp( -col );
return vec4(col, 1.0);
}
]]
(or this tutorial, but for Love2d https://inspirnathan.com/posts/65-glow- ... shadertoy/)