HISE Logo Forum
    • Categories
    • Register
    • Login

    I'll just leave this here...

    Scheduled Pinned Locked Moved General Questions
    106 Posts 16 Posters 9.8k Views
    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 Former User @Christoph Hart
      last edited by

      @Christoph-Hart said in I'll just leave this here...:

      Nah, it's something around the glue code that I have to add in order to make it work, so any example will cause the same error.

      I will have to check again thoroughly on Monday, but what macOS version and GPU are you using?

      macOS Catalina 10.15., MacPro 2019 (3.2 GHz 16-Core Intel Xeon W) with an AMD Radeon Pro 580X 8 GB card

      1 Reply Last reply Reply Quote 0
      • Dominik MayerD
        Dominik Mayer
        last edited by Dominik Mayer

        I'll leave this HISE snippet here for a quickstart into GLSL with HISE: (requires the latest scriptnode_codegen_rewrite branch)

        HiseSnippet 954.3ocsV01aaSDG+bZLrXHSLI9.XkW4HUxbfsARSSj17vVzZSsl2JHgPcWsuDepmuyx97FQSUhOZ7J97v2.3+4yN1EbKn.Dk27+4e+e7rWpHfjkIRQF8d81DBx3SM82xkQSivTNZ4Ljw8MOEmIIo1ZVGuMAmkQBQFFG7bECidcQE+9su8XLCyCH0rPnyEz.xIzXprlq2jWRYrE3PxqowMz9QSVFH3SELQNfmCLcQI3fqvaHqvJ05XhL9n4gToH0WhkjLjQ2iEga8iDumq0+bZF8RFQQLF4CNRydgfEpPrhKZZDkE5Uk2YHvKd0UgCzUgO27TZHcG+5pwmUHvt1hl0CiN2E7F2DdtsBO21fmQC30UCuGX5GjRSj0RTX6SLWxgF0ZLzBZBKstnN+ZGyoBPCtbTL9JxhTfXmENOw08P6G65N7o8s5aAMhLo86vo1dXNgM19Y1U1tgHmJhSDbfvYfV7.kU01jEAM2zF1DjRfRheAamAZwCzQ5gOTSNJiHOlQ3gKx4ANxzbxgk9YzyO4B+WM8hiNw6EGY2j6YqlqcReKMNTNwC5UxWIxkTNwYM3LIUvc1Lru0G5a0ayHbRBaaITzt5P6e.xc3uLhloxuuiFJibFVy3ED5lHoyveTEtqqhYcB+Rt3xauFUHsHcobFfJ6JTYK3ExTlkJXNAU1bH3UVNoDy0En2voqEowyvRryf3smqTZPkxJnUfr6DEJ2TFuoXF6RXEy4lvPmdMv3JgjbF2Yn0Gr5Ycsk8eVz50sJqzcLnN2lX0xe5cYnCOO9RU2QmdUJBaA2bMy71WyZdEHPWUZnnfujSkmkP321sATYoTsFVhJPUYwR38KWB8YTn6fnvt1GaVTGQE.t4kQzaVp5YUtA7HDkDRpjpR.iYj2AmI0618LmQxtRJRfKd65dvkOcP6Ws4qF2Kh48L0i9neZW.+4US1VG8YSduZbdGie45IQEiy6371zInFgp6ea9UGJTyP4kOA8WOVAmLEg4Lr7l2QUOdTJ.5523fk5nDOiJ21rD9u93Zq82+gv8AldTYPT63sSK3E5z+ei2xmp5aNe8ZRfrFrcMW78+29tTqPQehcyoXYJEFHLWkG6CubGP.jvgIR0loQG0Njl1UQqpL9vQ9BheG9UJbrh1nT33JgnXbPp3h.8lm5wv6UvAvDu3aB5AebBPauakyzzcjKJFdi9hf.Uo3K.r2tMe4dXyWsG17n8vlGuG17j8vludOr4atSaTedzQ4RQrdMAX3Mu3zmgwbNFlxJlHQ+APSk4ct
        

        The new shader.glsl file will get created in the the Scripts folder of your project. Now it has to be filled with some content to make it work: Gladly Chris has introduced a new shortcut to directly access the .glsl file in HISE. Click the "onInit"-callback dropdown on the top of the Code Editor to open the file directly in the Code-editor, paste this snippet and compile [f5].

        uniform float myValue;
        
        void main()
        {
            // Normalized pixel coordinates (from 0 to 1)
            vec2 uv = fragCoord/iResolution.xy;
        
            // Time varying pixel color
            vec3 col = myValue * sin(uv.xyx+vec3(1,2,3));
        
            // Output to screen
            fragColor = pixelAlpha * vec4(col, 1);
        }
        

        Happy journey :)

        ? 1 Reply Last reply Reply Quote 2
        • ?
          A Former User @Dominik Mayer
          last edited by A Former User

          @Dominik-Mayer Thanks for this Dominik. I tried your snippet but my interface still returns an unknown error! Are you on Mac or Windows?

          EDIT: Thinks for the myValue inclusion in your script. That was a question I actually had! 🙏

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by Christoph Hart

            Hmm, I'm at the end of my options to figure out why it's not working on your end - I just checked and it works on my mac mini which has an ancient GPU and shader version.

            A last thing you can do is to download and compile the JUCE OpenGL 2d demo app here:

            Link Preview Image
            JUCE/examples/GUI/OpenGLDemo2D.h at master · juce-framework/JUCE

            JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins. - JUCE/examples/GUI/OpenGLDemo2D.h at master · juce-framework/JUCE

            favicon

            GitHub (github.com)

            And see if these minimal shaders work.

            ? 1 Reply Last reply Reply Quote 0
            • ?
              A Former User @Christoph Hart
              last edited by

              @Christoph-Hart said in I'll just leave this here...:

              Hmm, I'm at the end of my options to figure out why it's not working on your end - I just checked and it works on my mac mini which has an ancient GPU and shader version.

              A last thing you can do is to download and compile the JUCE OpenGL 2d demo app here:

              Link Preview Image
              JUCE/examples/GUI/OpenGLDemo2D.h at master · juce-framework/JUCE

              JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins. - JUCE/examples/GUI/OpenGLDemo2D.h at master · juce-framework/JUCE

              favicon

              GitHub (github.com)

              And see if these minimal shaders work.

              Will do so Christoph. Thanks for the efforts... So this might be something on my end really! Maybe a GPU problem? I’ll check the JUCE example...

              1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart
                last edited by

                Maybe a GPU problem?

                Yes that is most likely - I've tested it on NVIDIA GPUs and Intel HD graphics on Windows and macOS but I don't have any ATI GPU to test. I'm a bit surprised how flaky the GPU support for different GLSL features is given that it's such a common standard.

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @Christoph Hart
                  last edited by

                  @Christoph-Hart I forgot that I ran those 2 openGL demos from JUCE a couple of weeks ago. They both work fine on my system... 🤔 I get the feeling that it is something really small and stupid that I am missing... (when is it not??🙈...)

                  1 Reply Last reply Reply Quote 0
                  • Christoph HartC
                    Christoph Hart
                    last edited by

                    If you add some empty lines in your main method, does the line number at the syntax error message change?

                    ? 1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User @Christoph Hart
                      last edited by A Former User

                      @Christoph-Hart The error I get for @Dominik-Mayer's example is this one: Screenshot 2021-06-07 at 16.52.34.png
                      No specific lines are mentioned. One error per compile...

                      And the following line 11 error is for Console.print(shader.getOpenGLStatistics());
                      The line number changes when adding empty lines.

                      Screenshot 2021-06-07 at 16.51.45.png

                      EDIT: Just to be sure. Are there any specific flags, checkboxes that I need to set in Projucer that I might have forgotten?

                      EDIT 2:

                      Screenshot 2021-06-07 at 17.15.23.png

                      I haven't seen this one before...

                      1 Reply Last reply Reply Quote 0
                      • Christoph HartC
                        Christoph Hart
                        last edited by

                        No, I was refering to the

                        ERROR 0:16'}': syntax error: syntax error
                        

                        message. You can ignore any message that starts with Line XX, Column YY - these are HiseScript errors which you don't need to bother about for this issue. The OpenGL errors start with ERROR:

                        Try to reproduce the one above, then add a few lines in the main function and check whether the line number increases (so that it points to an error at the end of the file vs. at the beginning (where I had to add some boilerplate code).

                        ? 2 Replies Last reply Reply Quote 0
                        • ?
                          A Former User @Christoph Hart
                          last edited by

                          @Christoph-Hart I got the error... then added a few lines... got the same error... added a few more lines... same error... So it stayed the same, 3 times...

                          Though if you asked my how I reproduced them systematically... Couldn't say... there's (at least) no apparent system to it... clicking... compiling... changing windows selection seems to have an influence. (Canvas: Interface back to Script Editor... selecting panel... compiling with shift-f5 from the shader code window...) It's a nasty business.

                          So here's that nasty bugger once more:
                          Screenshot 2021-06-07 at 17.47.27.png

                          Dominik MayerD 1 Reply Last reply Reply Quote 0
                          • Dominik MayerD
                            Dominik Mayer @A Former User
                            last edited by

                            @UrsBollhalder

                            Just a random guess:
                            Did you make sure to get rid of the ""s around "shader"?. It should look like this:

                            g.applyShader(shader, [0, 0, this.getWidth(), this.getHeight()]);
                            

                            Found this in your earlier snippet, but hope you've gotten rid of it by now..

                            All bests,
                            Dominik

                            ? 1 Reply Last reply Reply Quote 0
                            • ?
                              A Former User @Dominik Mayer
                              last edited by

                              @Dominik-Mayer I think I got rid of it, yes! But I’ll double check when I get back! 🙏

                              1 Reply Last reply Reply Quote 0
                              • BrianB
                                Brian
                                last edited by

                                I wonder if we could use a tool like this to come up with visuals?

                                Its very similar to Touch Designer and could help us peeps that are less code savvy

                                Link Preview Image
                                Nodes – a new way to create with code | https://nodes.io

                                Nodes is a new way to create with code.

                                favicon

                                (nodes.io)

                                ? 1 Reply Last reply Reply Quote 0
                                • ?
                                  A Former User @Brian
                                  last edited by A Former User

                                  @briandoliveira said in I'll just leave this here...:

                                  I wonder if we could use a tool like this to come up with visuals?

                                  Its very similar to Touch Designer and could help us peeps that are less code savvy

                                  Link Preview Image
                                  Nodes – a new way to create with code | https://nodes.io

                                  Nodes is a new way to create with code.

                                  favicon

                                  (nodes.io)

                                  Nodes looks really interesting as well!! I have to take a closer look later.

                                  Shader Code is quite special imho. It’s not immediately accessible I find. But the possibilities with OpenGL to create graphics that you can influence with a mouse or otherwise in real-time and hook it up to your instrument and its functionalities are quite astonishing. At least if you’re into that kind of thing. It’s like a multiverse filmstrip! 🤯🥳🤯

                                  1 Reply Last reply Reply Quote 0
                                  • ?
                                    A Former User @Christoph Hart
                                    last edited by

                                    @Christoph-Hart said in I'll just leave this here...:

                                    No, I was refering to the

                                    ERROR 0:16'}': syntax error: syntax error
                                    

                                    message. You can ignore any message that starts with Line XX, Column YY - these are HiseScript errors which you don't need to bother about for this issue. The OpenGL errors start with ERROR:

                                    Try to reproduce the one above, then add a few lines in the main function and check whether the line number increases (so that it points to an error at the end of the file vs. at the beginning (where I had to add some boilerplate code).

                                    So this is today's macOS - HISE - OpenGL error:
                                    Adding lines doesn't change anything. It'll come up fairly regularly... Maybe it helps...

                                    Screenshot 2021-06-17 at 10.39.50.png

                                    1 Reply Last reply Reply Quote 0
                                    • Christoph HartC
                                      Christoph Hart
                                      last edited by

                                      But the line number is different. Can you check the file in another text editor to check whether there is a duplicate } at the end of your shader file? I remember there was an issue with the new code editor that somehow hides the last character...

                                      ? 4 Replies Last reply Reply Quote 0
                                      • ?
                                        A Former User @Christoph Hart
                                        last edited by

                                        @Christoph-Hart said in I'll just leave this here...:

                                        But the line number is different. Can you check the file in another text editor to check whether there is a duplicate } at the end of your shader file? I remember there was an issue with the new code editor that somehow hides the last character...

                                        Well. That } was on me and my own stupidity! 😬 Didn't even have to open another text editor... Sorry...

                                        But I could swear that unknown error is Catalina related... If I were on Mojave, it'd probably be working! Damn... This is bugging me...

                                        1 Reply Last reply Reply Quote 0
                                        • ?
                                          A Former User @Christoph Hart
                                          last edited by A Former User

                                          @Christoph-Hart I finally got it working on my MacBook Air 2014... Re-installed everything... Went back to Catalina and compiled HISE etc. Also openGL seems to be working. But I do get this a lot:
                                          Interface:! ERROR: No definition of main in fragment shader

                                          Also with the "simpler" examples on shadertoy.

                                          Am I missing something?

                                          @Dominik-Mayer's snippet works just fine now!
                                          My 2019 MacPro beast machine still does throw me the Interface:! Unknown Error

                                          1 Reply Last reply Reply Quote 0
                                          • ?
                                            A Former User @Christoph Hart
                                            last edited by A Former User

                                            @Christoph-Hart Hey Christoph. I've been noticing some changes on the HISE / shader code - front...

                                            I manage to get it to show the shaders occasionally. I still get an unknown error (both on my MacBook Air 2014 and my MacPro 2019). So, one out of 10 times I hit compile, it acutally shows me the shaders... but very inconsistently...

                                            Really excited about this!

                                            (dev branch, latest commit, 1f682f5)

                                            Screenshot 2021-08-25 at 11.12.28.png

                                            This one I found while trying some shadertoy examples:

                                            Screenshot 2021-08-25 at 11.32.10.png

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

                                            19

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.4k

                                            Posts