simvx.core.ocean

OceanSurface3D: a large open-sea plane driven by the FFT ocean (design D11).

Where :class:~simvx.core.water.WaterSurface3D displaces its grid by a handful of analytic Gerstner waves, an :class:OceanSurface3D displaces it by a sampled FFT ocean: a Tessendorf Phillips spectrum inverse-transformed into per-cascade displacement + slope + foam maps (see the renderer’s ocean pass). It reuses the

class:

~simvx.core.water.WaterMaterial value object for shading (colour, depth fade, Fresnel, refraction, foam) exactly like the built-in water pass (design D16); the difference is entirely in how the surface is displaced and how its normal + foam are derived.

The wind that drives the spectrum comes from the scene WorldEnvironment (FrameGlobals wind), and the cascade texture size + count come from the graphics quality tier (QualitySettings.ocean_size / ocean_cascades), so an ocean scales with the same one dial as the rest of the renderer. Place the node at sea level: its world XZ plane (local +Y up) is the mean surface.

Example::

sea = OceanSurface3D(position=(0, 0, 0), size=(600, 600), subdivisions=256)
sea.material = WaterMaterial(wave_amplitude=1.4, wave_steepness=0.7)
scene.add_child(sea)

Module Contents

Classes

OceanSurface3D

A large FFT-ocean plane rendered by the built-in ocean pass.

Data

API

simvx.core.ocean.__all__

[‘OceanSurface3D’]

class simvx.core.ocean.OceanSurface3D(material: simvx.core.water.WaterMaterial | None = None, **kwargs)[source]

Bases: simvx.core.nodes_3d.node3d.Node3D

A large FFT-ocean plane rendered by the built-in ocean pass.

Properties: size: Ocean plane extent in world units (x, z). Make it large: the FFT cascades tile across it, so a big plane reads as open sea. subdivisions: Grid resolution per axis. Higher resolves the FFT displacement more finely near the camera (at more vertices). visible: Standard Node visibility; a hidden surface neither draws nor triggers the scene colour/depth copy the refraction reads.

Initialization

size

‘Property(…)’

subdivisions

‘Property(…)’

gizmo_colour

‘Property(…)’

property material: simvx.core.water.WaterMaterial[source]

The :class:WaterMaterial controlling this ocean’s shading.

get_gizmo_lines() list[tuple[simvx.core.math.types.Vec3, simvx.core.math.types.Vec3]][source]

Editor gizmo: the mean-surface rectangle at the node’s world plane.

position

‘_SpatialVecProperty(…)’

rotation

‘Property(…)’

scale

‘_SpatialVecProperty(…)’

render_layer

‘Property(…)’

property rotation_degrees: simvx.core.math.types.Vec3
property world_position: simvx.core.math.types.Vec3
property world_rotation: simvx.core.math.types.Quat
property world_scale: simvx.core.math.types.Vec3
property forward: simvx.core.math.types.Vec3
property right: simvx.core.math.types.Vec3
property up: simvx.core.math.types.Vec3
translate(offset: tuple[float, float, float] | numpy.ndarray)
translate_global(offset: tuple[float, float, float] | numpy.ndarray)
rotate(axis: tuple[float, float, float] | numpy.ndarray, angle: float)
rotate_x(angle: float)
rotate_y(angle: float)
rotate_z(angle: float)
look_at(target: tuple[float, float, float] | numpy.ndarray, up=None)
face_along(forward: tuple[float, float, float] | numpy.ndarray, up: tuple[float, float, float] | numpy.ndarray | None = None) None
set_render_layer(index: int, enabled: bool = True) None
is_on_render_layer(index: int) bool
wrap_bounds(bounds: tuple[float, float, float] | numpy.ndarray, margin: float = 1.0)
strict_errors: ClassVar[bool]

True

script_error_raised

‘Signal(…)’

dynamic: bool

False

classmethod __init_subclass__(**kwargs)
property name: str
property update_mode: simvx.core.descriptors.UpdateMode
property visible: bool
reset_error() None
add_child(node: simvx.core.node.Node) simvx.core.node.Node
remove_child(node: simvx.core.node.Node)
reparent(new_parent: simvx.core.node.Node)
get_node(path: str) simvx.core.node.Node
get_node_or_none(path: str) simvx.core.node.Node | None
find(target, *, direct: bool = False)
find_all(target, *, direct: bool = False)
walk(*, include_self: bool = True) collections.abc.Iterator[simvx.core.node.Node]
property path: str
add_to_group(group: str)
remove_from_group(group: str)
is_in_group(group: str) bool
on_ready() None
on_enter_tree() None
on_exit_tree() None
on_update(dt: float) None
on_fixed_update(dt: float) None
on_draw(renderer) None
on_picked(event: simvx.core.events.InputEvent) None
on_unhandled_input(event: simvx.core.events.TreeInputEvent) None
start_coroutine(gen: simvx.core.descriptors.Coroutine) simvx.core.descriptors.CoroutineHandle
stop_coroutine(gen_or_handle)
queue_redraw() None
property render_dirty: bool
clear_children()
destroy()
call_deferred(method: collections.abc.Callable[..., Any], *args: Any) None
property app
property tree: simvx.core.scene_tree.SceneTree
property physics
property physics_2d
__getitem__(key: str)
classmethod get_properties() dict[str, simvx.core.descriptors.Property]
__repr__()