Utility node
Render Size
Reports the current dimensions and properties of the render output window. Outputs the viewport's aspect ratio, width and height in Grafit units, pixel dimensions, Retina/HiDPI scale factor, and orientation. The Width Multiplier and Height Multiplier inputs let you scale the reported Grafit unit values, which is useful for sizing elements to span the full viewport or a fraction of it.
Inputs
| Port | Type | Default |
|---|---|---|
| Width MultiplierScales the reported Width. The viewport half-extent is measured internally, so 2 gives the full width edge to edge and 1 gives half of it. Not clamped; any factor works. | float | 2.0 |
| Height MultiplierScales the reported Height the same way — 2 is the full height of the render window, 1 is half. Not clamped; any factor works. | float | 2.0 |
Outputs
| Port | Type |
|---|---|
| Aspect Ratio | float |
| Width | float |
| Height | float |
| Pixel Width | float |
| Pixel Height | float |
| Scale Factor | float |
| Orientation | float |
Grafit Coordinate System Relationship
Grafit uses a fit-to-shortest-edge coordinate system where the shorter dimension of the viewport always maps to the range [-1, +1] and the longer dimension extends proportionally beyond.
For a landscape viewport with aspect ratio 1.5:
- Y axis:
-1.0to+1.0(the shorter edge, height) - X axis:
-1.5to+1.5(extends proportionally with the aspect ratio)
The Render Size node's Grafit-unit outputs reflect this. With the default multipliers of 2.0:
- Width =
grafitWidth 2.0=1.5 2.0=3.0(full X span from-1.5to+1.5) - Height =
grafitHeight 2.0=1.0 2.0=2.0(full Y span from-1.0to+1.0)
This means you can connect the Width and Height outputs directly to a Rectangle or Canvas node to create an element that exactly fills the viewport.
Use Cases
- Responsive Layouts: Feed the Aspect Ratio into Math or Remap nodes to calculate positions that adapt when the user resizes the output window. For example, anchor a UI element to the top-right corner by using
Width / 2andHeight / 2as X and Y offsets. - Full-Viewport Backgrounds: Connect Width and Height directly to a Rectangle or Canvas node to create a background that always covers the entire viewport, regardless of window size.
- Resolution-Aware Textures: Use Pixel Width and Pixel Height to generate textures at the exact pixel resolution of the output window, avoiding unnecessary oversampling or blurry undersampling.
- Aspect-Ratio-Aware Shapes: Use the Aspect Ratio output to adjust shape proportions so that circles remain circular and squares remain square regardless of the viewport's aspect ratio.
- Retina Detection: Check the Scale Factor output to conditionally increase detail for HiDPI displays, such as doubling line widths or switching to higher-resolution assets.
- Orientation-Dependent Layouts: Use the Orientation output to switch between landscape and portrait layout schemes, repositioning or resizing elements depending on the viewport shape.
Tips
- Default multipliers of 2.0: The defaults are set to
2.0because the Grafit coordinate system spans from-1to+1along the shorter axis, which is a total range of 2 units. This means the Width and Height outputs with default multipliers give you the full viewport span in Grafit units, ready to use as dimensions for full-screen elements. - Half-size calculations: Set a multiplier to
1.0to get the distance from the center to the edge, which is useful for positioning elements at the viewport boundary (e.g.,X = Widthwith multiplier1.0places an element at the right edge). - Fractional sizing: Use multipliers less than
2.0to create elements that are a proportion of the viewport. For example, a multiplier of1.0on Width gives you half the viewport width, useful for split-screen layouts. - Combining with Remap: Connect the Aspect Ratio to a Remap node to map it to a custom range, creating smooth transitions between landscape and portrait layouts.
- Pixel-perfect rendering: When generating textures at exact pixel resolution, use Pixel Width and Pixel Height as inputs to generator nodes. This avoids scaling artifacts and ensures 1:1 pixel mapping.
- Real-time updates: All outputs update in real time as the user resizes the output window, so connected elements respond immediately to window size changes.
Open Render Size in the interactive catalog →
Render Size is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.