• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    GLSL Chromakey

    Showcase
    2
    3
    495
    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.
    • Aolis
      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
      MacBook Pro, Apple M3 Max, 128 GB
      Sonoma 14.3.1

      Woland 1 Reply Last reply Reply Quote 1
      • Woland
        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: https://support.troikatronix.com/support/tickets/new
        Support Policy: https://support.troikatronix.com/support/solutions/articles/13000064762
        Add-Ons: https://troikatronix.com/add-ons/ & https://troikatronix.com/add-ons/?u=woland
        Professional Services: https://support.troikatronix.com/support/solutions/articles/13000109444

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

        Aolis 1 Reply Last reply Reply Quote 0
        • Aolis
          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
          MacBook Pro, Apple M3 Max, 128 GB
          Sonoma 14.3.1

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