Forum

    • Register
    • Login
    • Search
    • Categories

    Shader array declaration, how?

    General Questions
    2
    9
    45
    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.
    • ustk
      ustk last edited by

      I am trying to declare an array but it doesn't work despite I am doing it the same way as in ShaderToy...
      Should it be declared differently in Hise?

      const vec2 wandsSpeed[10] = vec2[10] ( vec2( 0.4657,  0.2149), vec2( 0.5536,  0.1345),
                                             vec2( 0.3457, -0.4645), vec2(-0.1473, -0.5532),
                                             vec2( 0.3632,  0.2387), vec2( 0.3891,  0.0344),
                                             vec2(-0.0321,  0.1032), vec2(-0.1358, -0.3682),
                                             vec2( 0.2634,  0.4276), vec2(-0.3541,  0.3025));
      

      Gives me this:
      Screenshot 2022-04-06 at 13.22.59.png

      I've also tried different variations of it with no luck, including C++ fashion

      Tired to press F5 in the forum...
      Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

      1 Reply Last reply Reply Quote 0
      • ustk
        ustk last edited by

        I might have found a reason, but the proposed alternative doesn't work either
        https://stackoverflow.com/questions/28435438/how-to-write-const-array-in-glsl-es

        @Christoph-Hart what is the GLSL version in Hise?

        Console.print(trace(myshader.getOpenGLStatistics())); // returns null
        

        Tired to press F5 in the forum...
        Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

        1 Reply Last reply Reply Quote 0
        • ustk
          ustk last edited by

          Finally got it to work

          they have to be declared dynamically inside main (even if they are constant values or not)

          Tired to press F5 in the forum...
          Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

          d.healey 1 Reply Last reply Reply Quote 1
          • d.healey
            d.healey @ustk last edited by

            @ustk Update the documentation

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            ustk 1 Reply Last reply Reply Quote 0
            • ustk
              ustk @d.healey last edited by

              @d-healey Done
              https://github.com/christophhart/hise_documentation/pull/12

              Tired to press F5 in the forum...
              Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

              d.healey 1 Reply Last reply Reply Quote 0
              • d.healey
                d.healey @ustk last edited by

                @ustk Thanks! I apparently have the power to merge it, I have wielded the power!

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                ustk 2 Replies Last reply Reply Quote 1
                • ustk
                  ustk @d.healey last edited by

                  @d-healey You're too fast, I'm not sure you should have more power 😛

                  Tired to press F5 in the forum...
                  Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                  1 Reply Last reply Reply Quote 1
                  • ustk
                    ustk @d.healey last edited by

                    @d-healey Strangely the online doc hasn't been updated yet... Server cache refresh time perhaps?

                    Tired to press F5 in the forum...
                    Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                    d.healey 1 Reply Last reply Reply Quote 0
                    • d.healey
                      d.healey @ustk last edited by

                      @ustk Yeah I think there is some manual intervention required to regenerate the online doc, I do not have that much power... yet

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

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

                      22
                      Online

                      741
                      Users

                      5.4k
                      Topics

                      50.4k
                      Posts