• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    GLSL Chromakey

    Showcase
    2
    3
    243
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Aolis
      last edited by Aolis

      Hey there,

      I just finished messing around with getting some glsl chromakey / green-screen shader code I found at shadertoy.com working in Izzy and thought I might share it here.

      You can copy and paste the code below into a new GLSL actor. You can also use this user actor:Chromakey++.iua3

      // this was converted into izziease from a bit of code "Created by jackdavenport in 2015-05-30" 
      // it may be found here https://www.shadertoy.com/view...

      // ISADORA_FLOAT_PARAM(thresh, thsh, 0.0, 1.0, 1.0, "Threshold amount.");

      uniform float thresh;

      // ISADORA_FLOAT_PARAM(padd, padd, 0.0, 1.0, 1.0, "Padding amount.");

      uniform float padd;

      // ISADORA_FLOAT_PARAM(red_color, red, 0.0, 1.0, 1.0, "Amount of red to key out.");
      // ISADORA_FLOAT_PARAM(green_color, gren, 0.0, 1.0, 1.0, "Amount of green to key out.");
      // ISADORA_FLOAT_PARAM(blue_color, blue, 0.0, 1.0, 1.0, "Amount of blue to key out.");

      uniform float red_color;
      uniform float green_color;
      uniform float blue_color;

      void mainImage ( out vec4 fragColor, in vec2 fragCoord )
      {
      vec2 uv = fragCoord.xy / iResolution.xy;
          
          vec4 greenScreen = vec4(red_color, green_color, blue_color, 1.0);
          vec4 color = texture(iChannel0, uv);
          
          vec3 diff = color.xyz - greenScreen.xyz;
          float fac = smoothstep(thresh-padd,thresh+padd, dot(diff,diff));
          
          color = mix(color, texture(iChannel1, uv), 1.-fac);
      fragColor = color;
      }

      Media Artist & Teacher
      Trashcan Late 2012, Mojave / MacBook Pro 2019 5600M, Catalina

      WolandW 1 Reply Last reply Reply Quote 1
      • WolandW
        Woland Tech Staff @Aolis
        last edited by

        @aolis

        It'd be great if you could add this to the TroikaTronix Add-Ons page, as it's the ideal place to archive useful tools for the community.


        Best wishes,

        Woland

        TroikaTronix Technical Support
        New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
        TroikaTronix Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
        TroikaTronix Add-Ons Page: https://troikatronix.com/add-ons/

        | Isadora 3.2.6 | Mac Pro (Late 2013), macOS 10.14.6, 3.5GHz 6-core, 1TB SSD, 64GB RAM, Dual AMD FirePro D700s |

        A 1 Reply Last reply Reply Quote 0
        • A
          Aolis @Woland
          last edited by

          @woland

          I would love to do that, was not sure if it is up to snuff I suppose and so shied away from that - but will do.

          -alex

          Media Artist & Teacher
          Trashcan Late 2012, Mojave / MacBook Pro 2019 5600M, Catalina

          1 Reply Last reply Reply Quote 1
          • First post
            Last post