<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[ANSWERED] Fisheye Undistort?]]></title><description><![CDATA[<p>Hi all, </p>
<p>Does anyone know a way to undistort a feed from a fisheye lens? I know there is an actor to create a fisheye effect, but I wondered if there is some way of undoing the distortion?<br /></p>
<p>Nic</p>]]></description><link>https://community.troikatronix.com/topic/9440/answered-fisheye-undistort</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 14:51:39 GMT</lastBuildDate><atom:link href="https://community.troikatronix.com/topic/9440.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 May 2026 18:03:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [ANSWERED] Fisheye Undistort? on Thu, 21 May 2026 18:16:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/124">@dusx</a> Thanks, that really helped. It was in fact the opposite effect (to create a kind of negative fisheye process), but I tweaked the code you sent to do this.</p>]]></description><link>https://community.troikatronix.com/post/57629</link><guid isPermaLink="true">https://community.troikatronix.com/post/57629</guid><dc:creator><![CDATA[nic]]></dc:creator><pubDate>Thu, 21 May 2026 18:16:00 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Fisheye Undistort? on Tue, 19 May 2026 22:17:53 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/570">@nic</a></p><p>Here is a GLSL shader, that will unwarp a 'fisheye' (its not going to be perfect, since its not calibrated to any specific lens), but it should provide a decent result.</p><p></p><pre>
/*
Fisheye Correction - Fragment Shader
For Isadora GLSL Shader actor
*/
// ISADORA_PLUGIN_NAME("Fisheye Correction")
// ISADORA_PLUGIN_DESC("Corrects fisheye lens distortion from an input video stream to create a flatter, non-fisheye output.")
// ISADORA_FLOAT_PARAM(strength, strn, 0.0, 200.0, 100.0, "Amount of fisheye correction. Higher values remove more barrel distortion.")
uniform float strength;
// ISADORA_FLOAT_PARAM(zoom, zoom, 50.0, 200.0, 115.0, "Zooms the corrected image to hide curved black edges.")
uniform float zoom;
// ISADORA_FLOAT_PARAM(horz_center, ctrx, -100.0, 100.0, 0.0, "Horizontal center of the lens correction.")
uniform float horz_center;
// ISADORA_FLOAT_PARAM(vert_center, ctry, -100.0, 100.0, 0.0, "Vertical center of the lens correction.")
uniform float vert_center;
// ISADORA_FLOAT_PARAM(edge_softness, edge, 0.0, 20.0, 2.0, "Softens the edge where the corrected image runs outside the source.")
uniform float edge_softness;
// Built-in Isadora uniforms
uniform vec2 resolution;
uniform sampler2D tex0;
void main(void)
{
    vec2 uv = gl_TexCoord[0].xy;
    // Move coordinates so that 0,0 is the image center.
    vec2 center = vec2(0.5) + vec2(horz_center, vert_center) / 200.0;
    vec2 p = uv - center;
    // Correct for non-square aspect ratio.
    float aspect = resolution.x / resolution.y;
    p.x *= aspect;
    // Zoom after correction. Higher zoom crops the outer edges.
    p /= zoom / 100.0;
    // Distance from lens center.
    float r = length(p);
    // Barrel/fisheye correction.
    // The shader samples farther outward as pixels move from the center,
    // which visually straightens fisheye-curved lines.
    float k = strength / 100.0;
    float corrected_r = r * (1.0 + k * r * r);
    vec2 corrected_p = p;
    if (r &gt; 0.00001) {
        corrected_p = normalize(p) * corrected_r;
    }
    // Undo aspect correction and return to texture coordinates.
    corrected_p.x /= aspect;
    vec2 sample_uv = corrected_p + center;
    // Create a soft mask so out-of-range areas fade to black.
    float soft = edge_softness / 100.0;
    float mask_x = smoothstep(0.0, soft, sample_uv.x) *
                   smoothstep(0.0, soft, 1.0 - sample_uv.x);
    float mask_y = smoothstep(0.0, soft, sample_uv.y) *
                   smoothstep(0.0, soft, 1.0 - sample_uv.y);
    float mask = mask_x * mask_y;
    // Clamp sampling to avoid texture wrapping artifacts.
    sample_uv = clamp(sample_uv, vec2(0.0), vec2(1.0));
    vec4 color = texture2D(tex0, sample_uv);
    gl_FragColor = vec4(color.rgb * mask, color.a);
}</pre>]]></description><link>https://community.troikatronix.com/post/57614</link><guid isPermaLink="true">https://community.troikatronix.com/post/57614</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Tue, 19 May 2026 22:17:53 GMT</pubDate></item></channel></rss>