GPU Kernel
7 nodes
On this page 7
Element
FunctionThe element this evaluation of the kernel computes - its column and row - and the size of the grid it belongs to.
Element() -> (X: Integer, y: Integer, width: Integer, height: Integer)
int Element(out int y, out int width, out int height)
Returns
| X | Integer |
| y | Integer |
| width | Integer |
| height | Integer |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- GPU Kernel
- Package
- GPU Kernels
Sample
FunctionThe value of a field at this element.
Sample(field: Scalar Field) -> Number
double Sample(ScalarField2D field)
Parameters
| name | type | default | description |
|---|---|---|---|
| field | Scalar Field | — | An input of the kernel: a field the size of the grid. |
Returns
| Value | Number |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- GPU Kernel
- Package
- GPU Kernels
Sample Image
FunctionThe colour of a picture at this element, each channel from 0 to 1.
SampleImage(image: Pixel Image) -> Hdr Color Element
HdrColorElement SampleImage(PixelImage image)
Parameters
| name | type | default | description |
|---|---|---|---|
| image | Pixel Image | — | An input of the kernel: a picture the size of the grid. |
Returns
| Color | Hdr Color Element |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- GPU Kernel
- Package
- GPU Kernels
Sample Image Offset
FunctionThe colour of a picture at an offset from this element, each channel from 0 to 1: (1, 0) is its neighbour on the right, (0, 1) the one below. Past an edge, the nearest pixel on the edge is read.
SampleImageOffset -> Hdr Color Element
image: Pixel Image
offsetX: Integer
offsetY: IntegerHdrColorElement SampleImageOffset(
PixelImage image,
int offsetX,
int offsetY)Parameters
| name | type | default | description |
|---|---|---|---|
| image | Pixel Image | — | An input of the kernel: a picture the size of the grid. |
| offsetX | Integer | — | How many columns to the right; negative is to the left. |
| offsetY | Integer | — | How many rows down; negative is up. |
Returns
| Color | Hdr Color Element |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- GPU Kernel
- Package
- GPU Kernels
Sample Offset
FunctionThe value of a field at an offset from this element: (1, 0) is its neighbour on the right, (0, 1) the one below. Past an edge, the nearest element on the edge is read, as though the field went on at its edge's values.
SampleOffset -> Number
field: Scalar Field
offsetX: Integer
offsetY: Integerdouble SampleOffset(
ScalarField2D field,
int offsetX,
int offsetY)Parameters
| name | type | default | description |
|---|---|---|---|
| field | Scalar Field | — | An input of the kernel: a field the size of the grid. |
| offsetX | Integer | — | How many columns to the right; negative is to the left. |
| offsetY | Integer | — | How many rows down; negative is up. |
Returns
| Value | Number |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- GPU Kernel
- Package
- GPU Kernels
Time
FunctionThe time the kernel is drawn at, in seconds, for a picture that moves: whatever plays the kernel frame by frame gives it the seconds since it started, and a run draws the first moment, 0, so it draws the same picture every time. For a moment of your own choosing in a run, declare a number input and use that instead.
Time() -> Number
double Time()
Returns
| Seconds | Number |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- GPU Kernel
- Package
- GPU Kernels
UV
FunctionThe element's position in shader coordinates: centred on the grid, the shorter side spanning -1 to 1, up being up - what the shapes and coordinate nodes take.
UV() -> Vector 2D
Vector2D UV()
Returns
| UV | Vector 2D |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- GPU Kernel
- Package
- GPU Kernels