Getting true panel width / height (with scaling applied)

Hello,
please what would be a recommended way of getting panel’s true width and height (even on high dpi monitors with scaling applied)? I have tried using PanelCOMP.width / PanelCOMP.height, but it doesn’t seem to provide actual (scaled) dimensions. Thanks :slight_smile:

I’m afraid that info is meant to be abstract and there’s no reliable way to get it. Part of the problem being that you could have multiple views of a single panel, so you can never resolve this to one reliable number.

If you want to rig something, you can use:

  • monitors info to get the zoom on each monitor
  • network pane scale to get the zoom on network nodes
  • windowCOMP sizes to get window size in pixels

However, in general, I’d say this is better to leave abstract. Might be able to help more if you describe the use case.

1 Like

Does panelCOMP.panel.screenw give what you want ?

@Ivan thank you very much for reply. I haven’t realized that, but it makes total sense. I want to create some UI elements that would be drawn directly to screen resolution (meaning that their TOP texture background wouldn’t have to be scaled and interpolated, but rather would be in native resolution).

dpi_scale in monitors info sounds exactly like a thing that I need. I guess I just have to multiply my panel dimensions by this number and UI elements will be in correct resolution. I guess multi monitor setups could cause some problems with this solution, but I guess there is no other way around it.

Thank you very much for info :slight_smile:

Unfortunately no, this basically provides the same information as panel.width

We are working on a solution for this exact problem. Not sure when we will get there, but it’s on our list.

Aha, that’s great to hear. May I ask what are the core concepts behind this planned solution? I am imagining it might be something like a new resolution option on TOP operator - something like “parent panel dynamic resolution” (changing TOP resolution dynamically based on requested parent panel resolution)? I am just guessing here.

We’ve debated a few different approaches here, but we’re currently looking at getting away from TOPs in this case because of the overhead in rendering to separate textures first. Two ideas are either a GLSL Comp that allows for shaders that write directly to a panel, and/or a Render COMP that renders directly to the screen. We’re not settled yet on a solution though, so it could still be something different.

1 Like

Interesting, thank you very much for this insight

GLSL COMP seems like a great new addition to experimental series. :partying_face: Please are there also plans to add Render COMP, or was this idea transformed into something else?