Pass:setViewport
EditSets the viewport. Everything rendered will get mapped to the rectangle defined by the viewport. More specifically, this defines the transformation from normalized device coordinates to pixel coordinates.
Arguments
Name | Type | Default | Description |
x | number | The x coordinate of the upper-left corner of the viewport. | |
y | number | The y coordinate of the upper-left corner of the viewport. | |
w | number | The width of the viewport. Must be positive. | |
h | number | The height of the viewport. May be negative. | |
dmin | number | 0.0 | The min component of the depth range, between 0 and 1. |
dmax | number | 1.0 | The max component of the depth range, between 0 and 1. |
Returns
Nothing
Disable the viewport.
Arguments
None
Returns
Nothing
Notes
The viewport rectangle can use floating point numbers.
A negative viewport height (with a y coordinate equal to the bottom of the viewport) can be used to flip the rendering vertically.
The default viewport extends from (0, 0)
to the dimensions of the canvas, with min depth and max depth respectively set to 0 and 1.