HISE Logo Forum
    • Categories
    • Register
    • Login

    Some modes on don't work on image components

    Scheduled Pinned Locked Moved Bug Reports
    8 Posts 4 Posters 373 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.
    • T
      tomekslesicki
      last edited by tomekslesicki

      I'm in a bit of a tough spot at the moment. I'm currently using panels and paint routines to overlay some textures over the interface:

      const var Texture = Content.getComponent("Texture");
      
      Texture.loadImage("{PROJECT_FOLDER}texture.png", "TextureImage");
      
      Texture.setPaintRoutine(function(g)
      {
      	g.beginBlendLayer("Overlay", 1);
      	g.drawImage("TextureImage", [0, 0, this.getWidth(), this.getHeight()], 0, 0); 
      	g.endLayer();
      });
      

      The image is Retina-ready at twice the resolution of the panel.

      The problem with that is that depending on screen resolution, the size of the drawn image changes and it doesn't cover the entire panel. It happens both on Windows and Mac and on some screen sizes, it works fine, while at others it doesn't cover the whole panel.

      Now, if I were to discard the panel and replace it with an image component with the same picture, set to 0.5 scale, it would work perfect across all devices BUT the problem is, most blending modes don't work there, so if I set the blending of the image to Overlay, it's not drawn at all. Blending modes like Screen work fine, but not Overlay. Multiply doesn't work either.

      I'd assume it's faster to fix the blending modes on images than scaling based on the screen size so I'm happy to go with the quickest solution.

      @Christoph-Hart could you please fix this?

      T 1 Reply Last reply Reply Quote 0
      • T
        tomekslesicki @tomekslesicki
        last edited by tomekslesicki

        I took some time to investigate this further and it seems like the issue with scaling painted images is caused by the app OS app scaling. Here's the Windows bit, and I'm sure there's something similar on macOS too:

        Screenshot 2022-10-04 100956.jpg

        It's perfectly reproducable in HISE, you don't even need to compile the plugin to see the issue.

        Changing the drawImage dimensions to fixed pixel values as opposed to
        this.getWidth() doesn't solve the issue, unfortunately.

        I would really appreciate a fix to either the scaling issue, or the blending mode problem as described in the post above. Either one would work for me but it's very important for me to fix the project I'm working on.

        Thank you!

        1 Reply Last reply Reply Quote 0
        • T
          tomekslesicki
          last edited by

          One more update: blending modes on image components don’t work consistently across all DAWs. In Ableton, the image is diplayed fine but in Reaper it’s not visible at all.

          Maybe fixing the scaling is easier after all? @Christoph-Hart it would be great to hear what you think

          Matt_SFM 1 Reply Last reply Reply Quote 0
          • Matt_SFM
            Matt_SF @tomekslesicki
            last edited by Matt_SF

            @tomekslesicki what I did once was to write the dimensions like that :

            Engine.getOs() == "WIN"? g.drawSomething([area1]) : g.drawSomething([area2]) ;
            

            It works for simple things. But IIRC the blendLayers don't scale with the zoom factor if you're using resizable GUIs

            Develop branch
            Win10 & VS17 / Ventura & Xcode 14. 3

            1 Reply Last reply Reply Quote 0
            • Dan KorneffD
              Dan Korneff
              last edited by

              I've been having an issue with HISE and Reaper forever. Using Zoom settings in Windows doesn't seem to apply to HISE scaling

              Dan Korneff - Producer / Mixer / Audio Nerd

              1 Reply Last reply Reply Quote 0
              • T
                tomekslesicki
                last edited by

                @Christoph-Hart I’m giving this a friendly bump :-)

                T 1 Reply Last reply Reply Quote 0
                • T
                  tomekslesicki @tomekslesicki
                  last edited by

                  @Christoph-Hart any hope for fixing it?

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

                    I've pushed a fix that I think will fix all scaling issues for script panels, but there are so many edge cases and branches in that code that I wouldn't be too surprised if I broke something on another end.

                    We'll see in a few days :)

                    Oh and the ScriptImage blending mode is completely broken, I don't know why it should have worked at any time, but the blend function requires a source image to blend on which the logic doesn't supply so there's less than little hope for that solution :)

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

                    50

                    Online

                    1.7k

                    Users

                    11.7k

                    Topics

                    102.1k

                    Posts