HISE Logo Forum
    • Categories
    • Register
    • Login

    Shader array declaration, how?

    Scheduled Pinned Locked Moved General Questions
    11 Posts 3 Posters 410 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.
    • ustkU
      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

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

      1 Reply Last reply Reply Quote 0
      • ustkU
        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
        

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

        1 Reply Last reply Reply Quote 0
        • ustkU
          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)

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

          d.healeyD 1 Reply Last reply Reply Quote 1
          • d.healeyD
            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

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

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

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

              d.healeyD 1 Reply Last reply Reply Quote 1
              • d.healeyD
                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

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

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

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

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

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

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

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      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

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

                        This post is deleted!
                        CyberGenC 1 Reply Last reply Reply Quote 0
                        • CyberGenC
                          CyberGen @CyberGen
                          last edited by

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          57

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          102.1k

                          Posts