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...:

      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
              • ?
                A Former User @Christoph Hart
                last edited by

                @Christoph-Hart 😁👍💪🙏🙏🙏

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

                  Is it possible to have multiple shader-panels in one interface?

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

                    Yes, you can even have multiple shaders per panel.

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

                      @Christoph-Hart

                      Content.makeFrontInterface(600, 500);
                      
                      const var Panel1 = Content.getComponent("Panel1");
                      const var Panel2 = Content.getComponent("Panel2");
                      
                      
                      const var shader = Content.createShader("shader");
                      shader.setFragmentShader("shader.glsl");
                      
                      const var shader2 = Content.createShader("shader2");
                      shader2.setFragmentShader("shader2.glsl");
                      
                      Panel1.setPaintRoutine(function(g)
                      {
                      	g.applyShader(shader, [0, 0, this.getWidth(), this.getHeight()]);
                      });
                      
                      Panel2.setPaintRoutine(function(g)
                      {
                      	 g.applyShader(shader2, [0, 0, this.getWidth(), this.getHeight()]);
                      });
                      

                      Something along those lines?

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

                        Yes, but you don't need the setFragmentShader calls, if you create a shader it automatically compiles it (the call is only required if you want to change the code dynamically).

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

                          oh and you can use this.getLocalBounds(0) instead of [0, 0, this.getWidth(), this.getHeight()]. Less typing, more fun.

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

                            @Christoph-Hart Got it! It's pretty crazy really... Mind blown... 🤯💪😁

                            So far my compiled plugin crashes (some GL problems) when I open it...
                            and...
                            somehow both shaders react to the sliders on the ui... even though only one shader has these inputs...

                            lots to learn...

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

                              @Christoph-Hart Is it possible to send values from shaders back to the onInit???

                              I understand how I can add a uniform float and influence it with a knob, panel, timer, etc... but can I do the same thing backwards from a shader variable?

                              I hope that makes sense...

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

                                No, it's a unidirectional communication and the uniform variables are read only in GLSL - it will be accessed by each pixel calculation so it can't change.

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

                                  @Christoph-Hart How is iTime related to timer objects in HISE?

                                  I have a synth timer running in my instrument and the shader panel just runs along with it although I don't pass it anything...

                                  Also when I drag a knob the shader starts moving along. Without me setting up a callback that passes a uniform variable into it...
                                  Got me thinking that maybe a knob also runs on an internal timer-like object... 🤯

                                  EDIT: It seems like iTime is always running... also while editing the shader keeps changing in the background and visually only shows updates when hovering over UI elements and interacting with them. When I hit compile it catches up with iTime and all is in sync again...

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

                                    Maybe I should hit the screensaver business after all... 😂

                                    Hoping to pass the obligatory psychedelically-influenced first phase of shader coding soon to produce more meaningful and interesting stuff...

                                    HISE_openGL.gif

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

                                      Yeah, I've been there too. The moment where you stare at a real screensaver and think "Wow that's really beautiful, I wonder how they programmed that" is the moment you need to reevaluate some life choices :)

                                      But have you started playing around with 3D ray marching? That's where the real fun begins :)

                                      ustkU 1 Reply Last reply Reply Quote 2
                                      • ustkU
                                        ustk @Christoph Hart
                                        last edited by

                                        @Christoph-Hart I wanted to dive in shaper code, but I find the code style just :face_vomiting:
                                        So I postpone this moment the more I can and push even more the panel's paintRoutine in the waiting 🤣

                                        Can't help pressing F5 in the forum...

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

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

                                          code style just

                                          What do you dislike there? I quickly got used to it (GLSL is C-like so at least there's no Lua madness involved and once you've wrapped your head around how it works (it's really different from the 2D canvas approach), you'll start enjoying it.

                                          ustkU ? 2 Replies Last reply Reply Quote 0
                                          • ustkU
                                            ustk @Christoph Hart
                                            last edited by

                                            @Christoph-Hart Yeah I imagine I have to get used to it :)
                                            I don't like the fact there're no ready methods for drawing basic stuff, even for a circle you have to make your own method. But it makes it powerfull :)

                                            Can't help pressing F5 in the forum...

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

                                            21

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.4k

                                            Posts