Ocean
15 nodes
On this page 15
Add Ocean Body
FunctionThe sea with a rigid body on it, made by the Box, Sphere, Capsule and the other body nodes. A body lighter than the water (1025 kg/m³) floats and rides the waves, drifts with them and is turned by them; a heavier one sinks. Bodies collide with each other. They do not disturb the sea.
AddOceanBody -> Ocean Scene Description
scene: Ocean Scene Description
body: Body DescriptionOceanSceneDescription AddOceanBody(
OceanSceneDescription scene,
BodyDescription body)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| body | Body Description | — | The body; put it at about the sea's level, since one let go from high up plunges before it settles. |
Returns
| result | Ocean Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Add Ocean Trigger
FunctionThe sea with a trigger for its bodies, made by the Triggers nodes: at a time, at every interval, or when a body touches another, rises or falls past a height or moves faster than a speed, it pushes a body, releases one that was held, spawns a copy of one or removes one. Cargo going over the side one crate at a time, a buoy let go. Triggers are looked at after every step of the bodies, in the order they were added; what they did is in the events of Simulate Ocean's result. A sea does not take Water In Region, Detonate, Set Wind or Unpin Cloth, and says so here.
AddOceanTrigger -> Ocean Scene Description
scene: Ocean Scene Description
trigger: Trigger DescriptionOceanSceneDescription AddOceanTrigger(
OceanSceneDescription scene,
TriggerDescription trigger)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| trigger | Trigger Description | — | The trigger. |
Returns
| result | Ocean Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Export Ocean Meshes
FunctionWrites the sea's surface over a rectangle at every frame of a span of time as a mesh file, in metres and Divooka's axes (+Z up). Returns the files written.
ExportOceanMeshes -> Text Array
scene: Ocean Scene Description
folder: Text
center: Vector3d
Size X: Number
Size Y: Number
cells: Integer
duration: Number
framesPerSecond: Number
prefix: Text
format: Textstring[] ExportOceanMeshes(
OceanSceneDescription scene,
string folder,
Vector3d center,
double sizeX = 100,
double sizeY = 100,
int cells = 256,
double duration = 2,
double framesPerSecond = 24,
string prefix = "ocean",
string format = "ply")Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| folder | Text | — | The folder; created if missing. |
| center | Vector3d | — | The rectangle's middle (m). |
| Size X | Number | 100 | Its extent along X (m). |
| Size Y | Number | 100 | Its extent along Y (m). |
| cells | Integer | 256 | Cells along its longer side. |
| duration | Number | 2 | How long to run (s). |
| framesPerSecond | Number | 24 | Frames per second. |
| prefix | Text | ocean | File name prefix: files are prefix.0001.ply and on. |
| format | Text | ply | The file format: ply (binary, the smallest), obj or stl. |
Returns
| result | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Export Ocean Textures
FunctionWrites the sea's textures over a span of time: for every frame and each of the three patches a displacement map (OpenEXR, 16-bit floats, metres), a normal map and a foam mask (PNG), named prefix.patch.kind.frame, and one text file saying what tiles at what size and how the channels are meant. For a sea made with a loop time, run that long and the last frame leads back into the first. Returns the files written.
ExportOceanTextures -> Text Array
scene: Ocean Scene Description
folder: Text
duration: Number
framesPerSecond: Number
prefix: Textstring[] ExportOceanTextures(
OceanSceneDescription scene,
string folder,
double duration = 4,
double framesPerSecond = 15,
string prefix = "ocean")Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| folder | Text | — | The folder; created if missing. |
| duration | Number | 4 | How long to run (s). |
| framesPerSecond | Number | 15 | Frames per second. |
| prefix | Text | ocean | File name prefix. |
Returns
| result | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
New Ocean
FunctionA sea raised by a wind, by the JONSWAP spectrum of a wind blowing over a hundred kilometres of water. It is worked out on three square patches that each repeat, the largest of the given size and the others a fifth and a thirtieth of it, summed: long swell, waves and ripples.
NewOcean -> Ocean Scene Description
Wind Speed (m/s): Number
Wind Direction (°): Number
size: Number
resolution: Integer
choppiness: Number
seed: Integer
loop: NumberOceanSceneDescription NewOcean(
double windSpeed = 10,
double windDirection = 0,
double size = 500,
int resolution = 256,
double choppiness = 1.1,
int seed = 1,
double loop = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| Wind Speed (m/s) | Number | 10 | The wind's speed (m/s): 5 is a breeze, 10 a fresh wind with whitecaps, 20 a gale with waves metres high. |
| Wind Direction (°) | Number | 0 | Where the wind blows to, in degrees from +X towards +Y. |
| size | Number | 500 | The side (m) of the largest patch: the sea repeats beyond it, and its longest waves are shorter than it. A few hundred metres for an open sea, some tens for a close view of a light wind. |
| resolution | Integer | 256 | Texels along a side of each patch: 64, 128, 256, 512 or 1024. |
| choppiness | Number | 1.1 | How much the crests are sharpened: 0 a rolling swell, 1 as the theory has it, 1.3 folding into whitecaps. |
| seed | Integer | 1 | Another seed is another sea of the same wind. |
| loop | Number | 0 | Make the sea repeat itself exactly after this time (s), for textures a game plays in a loop; 0: it never repeats. |
Returns
| result | Ocean Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Displacement Map
FunctionOne patch of the sea at a time as a displacement texture that tiles: per texel how far the water there has moved from where it rests, in metres, as a floating-point picture whose red is the shift along X, green along Y and blue the height (Z). Columns run along +X and rows along +Y, the patch's corner at the origin. A game moves the vertices of a flat grid by the sum of the three patches, each repeated at its own size. Made on the graphics card.
OceanDisplacementMap -> Hdr Pixel Image
scene: Ocean Scene Description
time: Number
patch: IntegerHdrPixelImage OceanDisplacementMap(
OceanSceneDescription scene,
double time,
int patch = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| time | Number | — | The time (s). |
| patch | Integer | 0 | The patch, 0 (largest) to 2. |
Returns
| result | Hdr Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Foam Map
FunctionOne patch of the sea at a time as a foam mask that tiles: white where that patch's crests are sharp, and fainter where they have just been. A breeze leaves almost none; from about 7 m/s of wind there are whitecaps, and more the harder it blows. Made on the graphics card.
OceanFoamMap -> Pixel Image
scene: Ocean Scene Description
time: Number
patch: IntegerPixelImage OceanFoamMap(
OceanSceneDescription scene,
double time,
int patch = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| time | Number | — | The time (s). |
| patch | Integer | 0 | The patch, 0 (largest) to 2. |
Returns
| result | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Height
FunctionThe sea's height (m) over a point at a time.
OceanHeight -> Number
scene: Ocean Scene Description
time: Number
position: Vector3ddouble OceanHeight(
OceanSceneDescription scene,
double time,
Vector3d position)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| time | Number | — | The time (s). |
| position | Vector3d | — | The point; its Z is not used. |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Normal Map
FunctionOne patch of the sea at a time as a normal map that tiles: per texel the direction the surface faces, red and green the lean along X and Y and blue the up, each as 0.5 + 0.5 × component, the way normal maps are stored. Made on the graphics card.
OceanNormalMap -> Pixel Image
scene: Ocean Scene Description
time: Number
patch: IntegerPixelImage OceanNormalMap(
OceanSceneDescription scene,
double time,
int patch = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| time | Number | — | The time (s). |
| patch | Integer | 0 | The patch, 0 (largest) to 2. |
Returns
| result | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Patch Size
FunctionThe side (m) of one of the sea's three patches: 0 is the largest (the swell), 2 the smallest (the ripples). Each patch's textures tile at this size.
OceanPatchSize -> Number
scene: Ocean Scene Description
patch: Integerdouble OceanPatchSize(
OceanSceneDescription scene,
int patch = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| patch | Integer | 0 | The patch, 0 to 2. |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Picture
FunctionA picture of the sea at a time, with the bodies on it where the waves have taken them by then, under the scene's sun. Made on the graphics card.
OceanPicture -> Pixel Image
scene: Ocean Scene Description
time: Number
eye: Vector3d
target: Vector3d
width: Integer
height: Integer
fieldOfView: NumberPixelImage OceanPicture(
OceanSceneDescription scene,
double time,
Vector3d eye,
Vector3d target,
int width = 640,
int height = 480,
double fieldOfView = 40)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| time | Number | — | The time (s). |
| eye | Vector3d | — | Where the camera stands (m): a few metres above the water for a view from a deck. |
| target | Vector3d | — | What it looks at (m). |
| width | Integer | 640 | The picture's width in pixels. |
| height | Integer | 480 | The picture's height in pixels. |
| fieldOfView | Number | 40 | The camera's vertical field of view in degrees. |
Returns
| result | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Surface
FunctionThe sea's surface over a rectangle at a time, as a mesh: an open sheet whose vertices move with the water, sideways as well as up, so that crests are sharp. The 3D view draws it; it is the sea a renderer wants for a still or, a mesh per frame, for a shot.
OceanSurface -> Streamed Vertex Mesh Data
scene: Ocean Scene Description
time: Number
center: Vector3d
Size X: Number
Size Y: Number
cells: IntegerStreamedVertexMeshData OceanSurface(
OceanSceneDescription scene,
double time,
Vector3d center,
double sizeX = 100,
double sizeY = 100,
int cells = 256)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| time | Number | — | The time (s). |
| center | Vector3d | — | The rectangle's middle (m); its Z is not used. |
| Size X | Number | 100 | Its extent along X (m). |
| Size Y | Number | 100 | Its extent along Y (m). |
| cells | Integer | 256 | Cells along its longer side: 256 is 65 thousand vertices. |
Returns
| result | Streamed Vertex Mesh Data |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Ocean Wave Height
FunctionThe significant wave height of the sea (m): the mean height, trough to crest, of the highest third of its waves, which is about what an observer would call the height of the waves.
OceanWaveHeight(scene: Ocean Scene Description) -> Number
double OceanWaveHeight(OceanSceneDescription scene)
Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Set Ocean Sun
FunctionThe sea under another sun.
SetOceanSun -> Ocean Scene Description
scene: Ocean Scene Description
sunDirection: Vector3dOceanSceneDescription SetOceanSun(
OceanSceneDescription scene,
Vector3d sunDirection)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | The sea. |
| sunDirection | Vector3d | — | Where the sun stands, as a direction towards it: a low sun ahead of the camera puts a path of light on the water. |
Returns
| result | Ocean Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation
Simulate Ocean
FunctionRuns the sea with the bodies on it and records their motion: a result the Results nodes read (Body Position, Body Path, Bodies Mesh) and the 3D view plays. The same sea gives the same motion bit for bit, on any machine. The sea itself needs no recording: Ocean Surface gives it at any of the run's times.
SimulateOcean -> Simulation Result
scene: Ocean Scene Description
duration: Number
framesPerSecond: NumberSimulationResult SimulateOcean(
OceanSceneDescription scene,
double duration = 5,
double framesPerSecond = 30)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Ocean Scene Description | — | A sea with bodies on it. |
| duration | Number | 5 | How long to run (s). |
| framesPerSecond | Number | 30 | Frames per second of the recording. |
Returns
| result | Simulation Result |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Ocean
- Package
- Physics Simulation