HISE Logo Forum
    • Categories
    • Register
    • Login

    How i can create a blurred panel (with border settings support)?

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 65 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.
    • It_UsedI
      It_Used
      last edited by It_Used

      I'm trying to create a transparent panel that blurs the background, I tried to write this in css using: "filter: blur();" as well as the "backdrop-filter: blur();"
      But there was no effect, I decided to write it on stock graphics. and here are the problems I have encountered:

      1. When zooming, the rounded rectangle scales too. (Half fixed)
      2. The panel borders are not defined correctly. I understand that if you use Paint Routine, then this is how it should be, but I also apply a mask, but the mask does not affect the blur effect.
      3. When zooming, the blur factor increases or decreases (it depends on the distance of the camera to the panel).
        I need some advice. Thanks all in advance))) ❤️

      Script:

      /*
      
      	Author: It_Used
      	Date: 18.05.25 | 1:47
      	
      */
      
      Content.makeFrontInterface(600, 600);
      
      // Declare the main panel.
      const var Panel1 = Content.getComponent("Panel1");
      
      // Declare corners settings var.
      reg CornerSize = 10;
      
      // Declare the path var.
      const var panelPath = Content.createPath();
      
      // Draw a blurred panel.
      Panel1.setPaintRoutine(function(g)
      {
      	
      	// Draw path. for mask.	
      	panelPath.addRoundedRectangle([0, 0, this.getWidth(), this.getHeight()], CornerSize);
      		
      	// Start 1st. layer for blur.
      	g.beginLayer(true);
      	
      	// Set blur.
      	g.gaussianBlur(5);
      	
      	// End 1st. blur layer.
      	g.endLayer();
      	
      	// Start 2nd. layer for border rectangle and apply a mask.
      	g.beginLayer(false);
      	
      	// Apply mask.
      	g.applyMask(panelPath, [0, 0, this.getWidth(), this.getHeight()], false);
      	
      	// End of 2nd. layer.
      	g.endLayer();
      	
      	// Set colour for border rect. 
      	g.setColour(Colours.withAlpha(Colours.black, 0.25));
      	
      	// Draw border rect.
      	g.fillRoundedRectangle([0, 0, this.getWidth(), this.getHeight()], CornerSize);	
      	
      });
      

      Snippet:

      Hise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MqIm0iKI2mUNYs6yMLyqZ73KTm5kGA22Wkjt.0p5+h+IGKyhlNhH1BdqzGVNtvPnF2pEN0eyENyVW2I4c4LFxYcYT48CHr2T0dz7B.PqGzEJBhUUamKCrKfHjTEBZGPdBrWWRs2R5GPBOSxCPZe5xhWvtQxXsWcdk4tSgM2PTn96UziaWA8zkaG9hAsmkt23osOW8jbofW9r1dwOIWJocTaTlg5CWcntGdDwe9PE29eZnjjmBQnsdq5185zbfcq5M50ry11CZUqdil85r8.6Z0a0PIp0fZ06AsrGrcqjVC1Fz0qQmln4Dqq8GZHzBZ00tAJNo9VSZUEo5ZGAdMS0vEZTrHrVNBeZgiv54H7mKbD1HGg+YgivcyQ3uT3H714H72JbD1LGg+dgivV4H7YZEFBKMuxscNDaW7PrRNDOs3gX9sU7JdHleekWgJbHleikMJdYw76r7YEODyu0xV+ui3mrJhwGhcdYwjCzl4qK19wY+5hON22L8Eix+MSe4OzdzjrWqCURldw8qlHPM2yZPxIeNA6RiByd6RA7fnf6yNQMb66ScNKwbOtua2v7RSBh53NYCA50u3jqoeL2MxGKW8dbT210bEvYTV4xSTW2AKjJmk81vdmc4NusHdc89Toi2Ey3ZW.ivIYdev37qD6p5GNdLbtzT.2P+nu88y8egRtlkIGikBp5codQSGBKebHvnyf0upyHpslZMeReaUeUFXHbJ93N+E7YtxJp9ZyUVYgRzTrif+HmjSlptzsqDKAXhEeAkkzOV02rBJ9zpYyySotzG43rZndMGqdYcr1k0w5WVGabYcb2Kqi29x5Xy+cGUWQ6dQR9zjWaPni6eX7Q80zNjggUfwqVQ+MzhLpKJ
      
      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @It_Used
        last edited by ustk

        @It_Used You're just hitting the two ancestral scale factor problems with blur and mask that have been raised a million times...

        I'm no good with CSS but I hope it can handle this in Hise

        Hise made me an F5 dude, browser just suffers...

        It_UsedI 1 Reply Last reply Reply Quote 0
        • It_UsedI
          It_Used @ustk
          last edited by

          @ustk Thank you very much for your reply)
          I'll take that into consideration. ❤️

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

          28

          Online

          1.9k

          Users

          12.3k

          Topics

          107.2k

          Posts