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

    GLSL blur

    How To... ?
    glsl shader help tutor add-ons blur
    5
    12
    585
    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.
    • FredF
      Fred @boyexploded
      last edited by Fred

      @boyexploded you might also want to take an easier route and start with something from shadertoy. Here is a pretty cool motion blur https://www.shadertoy.com/view...

      http://www.fredrodrigues.net/
      https://github.com/fred-dev
      OSX 10.15.15 MBP 2019 16" 2.3 GHz 8-Core i9, Radeon Pro 5500M 8 GB, 32g RAM
      Windows 10 7700K, GTX 1080ti, 32g RAM, 2tb raided SSD
      Windows 10 Threadripper 3960x 64g ram, 1tb NVME, rtx 2080ti + rtx2070 super

      B 1 Reply Last reply Reply Quote 3
      • JuriaanJ
        Juriaan Tech Staff @boyexploded
        last edited by

        @boyexploded
        I was about to say the same as @Fred did. ShaderToy is an amazing resource and most of their shaders work in Isadora with little to no modification.
        We also did a Guru Session on YouTube about the subject;

        And we have a Help article about modifying Shaders

        https://support.troikatronix.c...

        Isadora 3.1.1, Dell XPS 17 9710, Windows 10
        Interactive Performance Designer, Freelance Artist, Scenographer, Lighting Designer, TroikaTronix Community moderator
        Always in for chatting about interaction in space / performance design. Drop me an email at hello@juriaan.me

        B 1 Reply Last reply Reply Quote 1
        • DusXD
          DusX Tech Staff
          last edited by DusX

          This thread contains a zip of many Interactive Shader Format shaders (ISF) converted to work with Isadora as GLSL.
          https://community.troikatronix...

          I am not sure there are any motion blur effects in there.. but I thought I remember seeing one that used a persistent buffer.

          Troikatronix Technical Support

          • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
          • Isadora Add-ons: https://troikatronix.com/add-ons/
          • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

          Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

          B FredF 2 Replies Last reply Reply Quote 0
          • B
            boyexploded @bonemap
            last edited by

            @bonemap Thanks, man. I've been trying to go through the chapters for a minute now; I should've included that in OP. Struggling with it hard but thanks for the rec. Would you say you're proficient in opengl? Would be v grateful to talk w somebody, I learn best with a tutor. Thanks again

            1 Reply Last reply Reply Quote 0
            • B
              boyexploded @Fred
              last edited by

              @fred Thanks Fred. I'm working with some code from glslsandbox right now. I was able to make some intentional changes through trial and error. Any chance you've got a good handle and opengl and would be willing to chat about my project and what I'm trying to do? Thanks for the recommendation regardless ❤

              FredF 1 Reply Last reply Reply Quote 0
              • B
                boyexploded @Juriaan
                last edited by

                @juriaan thaanks, Juriaan. I've used some of the suggestions in the Help article to some effect, but even with those, I'm running into errors that I can't figure out. I've also watched the tutorial once but it might be helpful to review it. Otherwise, would you be able to direct me to any tutors in opengl? Would really like to talk in real time with an expert. Thanks for your suggestion, regardless!

                1 Reply Last reply Reply Quote 0
                • B
                  boyexploded @DusX
                  last edited by

                  @dusx I hadn't seen this before thanks, DusX! I will look through and see if I can find any solutions. Would you be able to point me to somebody I could speak with directly in real time about this project? Would be v grateful! Thanks regardless!

                  1 Reply Last reply Reply Quote 0
                  • FredF
                    Fred @boyexploded
                    last edited by

                    @boyexploded I would take it slow, it is a lot to learn and do things in steps. It is likely you might not understand everything all at once.


                    As a simple exercise start with the code in the default GLSL actor and see what you can do with it.

                    uniform sampler2D tex0;
                    void main(void) {
                    vec3 c0 = texture2D(tex0, gl_TexCoord[0].xy).rgb;
                    gl_FragColor = vec4(c0, 1.0);
                    }

                    This is basically sampling colours from your input texture (tex0 - this comes from what you connect to the vid-gpu input), in the same pixel order that it outputs.


                    Here are some things to help udnerstand what is happening.

                    uniform sampler2D tex0;
                    void main(void) {
                    vec3 c0 = texture2D(tex0, gl_TexCoord[0].xy).rgb;
                        gl_FragColor = vec4(c0.r, c0.g, c0.b, 1.0);
                    }

                    This does the same thing as the default but note now we can see the different channels in the output signal (the last value that is set to 1 is the alpha value).

                    You can do some simple manipulation by swapping the channles in the output like this:

                    uniform sampler2D tex0;
                    void main(void) {
                    vec3 c0 = texture2D(tex0, gl_TexCoord[0].xy).rgb;
                    gl_FragColor = vec4(c0.b, c0.g, c0.r, 1.0);
                    }

                    This is a pretty simple maniupulation of just the output channel

                    uniform sampler2D tex0;
                    void main(void) {
                    vec3 c0 = texture2D(tex0, -gl_TexCoord[0].xy).rgb;
                        gl_FragColor = vec4(c0, 1.0);
                    }

                    This will turn the image upside down because you sample the colours from the input in the opposite order they are used for output.

                    void main(void) {
                    vec3 c0 = texture2D(tex0, gl_TexCoord[0].xy).rgb;
                    gl_FragColor = vec4(c0.b / gl_TexCoord[0].x, c0.g/gl_TexCoord[0].x, c0.r/gl_TexCoord[0].x, 1.0);
                    }

                    This uses the x coordinate of the sampler to change the RGB levels - so what happens is the image fades accross the x axis (left to right)

                    These all just use the fragment shader (which you can kind of imagine is the bit that decides what colours go where). This is based on just a simple plane, so a square image. A vertex shader will let you perform manipulation on the plane, so it might not be a plane any more but you can move the points around. When we work with GLSL they are not necessarily just points, but can be thought of as points on a mesh of triangles that are connected. You can move points around but keep the connections between them or also break and or rebuild the connections between the points.

                    So to do something complicated is not a matter of just understanding how GLSL works, you need to be able to imagine the effect you want in terms of what kind of mainpulation of colours, sampling spaces and geometry. So what maths and manipulation would you apply where to get what you want. This is made a little more difficult as Isadora does not have a super logical way to use a buffer. For motion blur a buffer may be important as it would allow you to store the last frame generated and blend it back with the next incoming frame (because motion blur requires you manipulate things over time).

                    That can all get pretty complicated, so there is of course a shortcut. The shortcut is to find some existing code and work out how to port it to Isadora. This can get complicated as the default lables for input textures and samplers and some default behaivour of each platform is different. This means you need to get some basic understanding of the platforms you are using as a source.

                    Having said that depending on your needs a motion blur can be just blending some of the last frame with the current frame (in a simple way). Some more advanced motion blur with instead look at the geometry and textures in a frame and specifically understand thier motion vectors and place appropirately faded versions of them in the correct positions. This is likely not so useful as you are probalby feeding the the shader with a flat texture.

                    As @DusX suggested there is an example of a shader with a persistent buffer somewhere on this forum - it has been discussed and I am sure Mark posted something some time.

                    Again,  there is a lot to learn, and some advice is dont rush in, do some basic steps, set some simple goals like making a GLSL actor where you can control the level of each channel, do some messing around to get familiar first. If you find an example you like on another platform, do the same messing around there so you understand where the texture comes in and out, how it is labelled, how external parameters are setup etc and then try smash everything together.

                    It may of may not be worth it, I think it is but that depends on you. There are also some platforms like Vuo that you can use to make a composition and then export the composition as an FFLG plugin that can be used inside Isadora.


                    Hope this helps - happy shading!

                    http://www.fredrodrigues.net/
                    https://github.com/fred-dev
                    OSX 10.15.15 MBP 2019 16" 2.3 GHz 8-Core i9, Radeon Pro 5500M 8 GB, 32g RAM
                    Windows 10 7700K, GTX 1080ti, 32g RAM, 2tb raided SSD
                    Windows 10 Threadripper 3960x 64g ram, 1tb NVME, rtx 2080ti + rtx2070 super

                    1 Reply Last reply Reply Quote 4
                    • FredF
                      Fred @DusX
                      last edited by

                      @dusx Hey, just to dredge this up, I had a good search and cannot find the example of the GLSL actor with a persistent buffer. @mark sorry to crash you in on this thread, do you have it on hand?

                      Cheers

                      Fred

                      http://www.fredrodrigues.net/
                      https://github.com/fred-dev
                      OSX 10.15.15 MBP 2019 16" 2.3 GHz 8-Core i9, Radeon Pro 5500M 8 GB, 32g RAM
                      Windows 10 7700K, GTX 1080ti, 32g RAM, 2tb raided SSD
                      Windows 10 Threadripper 3960x 64g ram, 1tb NVME, rtx 2080ti + rtx2070 super

                      DusXD 1 Reply Last reply Reply Quote 0
                      • DusXD
                        DusX Tech Staff @Fred
                        last edited by

                        @fred said:

                        sorry to crash you in on this thread, do you have it on hand?

                         No problem... this is very much related. I believe this is the post you are after: https://community.troikatronix...

                        Troikatronix Technical Support

                        • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                        • Isadora Add-ons: https://troikatronix.com/add-ons/
                        • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

                        Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

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