FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Scalar field plane

Draws a scalar field on a plane from a texture baked once at startup.

+ Collaboration diagram for Scalar field plane:

Visualization SimObject showing one flat slice through a scalar field.

The field is evaluated onto a regular grid covering the plane once, in RenderInit, and uploaded as a texture the GPU reads per fragment. Nothing is evaluated per frame, so the resolution can be raised far beyond what VisualFlowPlane affords, and the colour ramp is applied per fragment rather than per vertex.

The plane may be tilted freely through LocalX and LocalY; the baked region follows the plane frame, so a tilted plane shows the region it actually covers. Only the directions of those two axes are used: LocalX is normalised and LocalY is re-orthogonalised against it, so Size alone sets the extent and the sampling grid is never sheared.

Only a time-invariant scalar field can be baked. A field that varies with time is refused unless VisualiseAsConstant is set; use VisualFlowPlane for a field that must be re-evaluated every frame.

Example Configuration (XML)

<Lib LibName="fhsim_environment" SimObject="VisualScalarPlane" Name="TemperatureSlice">
<Parameter name="FieldName">Temperature</Parameter>
<Parameter name="Position">0, 0, 25</Parameter>
<Parameter name="Size">200, 200</Parameter>
<Parameter name="Resolution">512, 512</Parameter>
</Lib>

Input ports

None.

Output ports

None.

Configuration Parameters

Name Width Description
FieldName 1 Name of the scalar field to show, as registered by the Environment. (Required)
Position 3 Plane centre in the NED frame [x, y, z] [m]. (Default: 0, 0, 0)
LocalX 3 Plane local X axis. Normalised on input, so only its direction matters; the zero vector is an error. (Default: 1, 0, 0)
LocalY 3 Plane local Y axis. Normalised and re-orthogonalised against LocalX on input, so only the direction it adds matters; the zero vector and a direction parallel to LocalX are errors. (Default: 0, 1, 0)
Size 2 Plane dimensions [u, v] [m]. (Default: 50, 50)
Spacing 2 Grid spacing of the bake [u, v] [m], along the plane's own axes set by LocalX and LocalY - not the NED axes VisualScalarVolume uses for the same parameter. Mutually exclusive with Resolution; configuring both is an error. (Default: absent, a spacing near 512 x 512 cells is derived)
Resolution 2 Samples of the bake along [u, v], the plane's own axes set by LocalX and LocalY - not the NED axes VisualScalarVolume uses for the same parameter. Mutually exclusive with Spacing; configuring both is an error. (Default: absent, a spacing near 512 x 512 cells is derived)
VisibleRange 2 Value span drawn at all [min, max]; values outside it are fully transparent. (Default: probed from the field and widened by one encoding code)
ColorRange 2 Value span mapped across the full colour ramp [min, max]. (Default: probed from the field)
AlphaRange 2 Opacity span applied across the visible range [min, max], clamped to [0, 1]: the lowest visible value is drawn at min and the highest at max. It means the same thing on VisualScalarVolume, where it is instead stated over a path of ReferenceLength. (Default: 0.3, 0.6)
ShowExtrapolated 1 Draw values the field flagged as inaccurate instead of masking them. Leaving it false has two surprising consequences. A DepthLayeredScalarField reports OUT_OF_RANGE_INACCURATE at every depth outside its profile, so a plane below the deepest layer renders nothing. A ParametricScalarField returns the same status both for a position below the seabed when maskBelowSeabed is set and for a DepthProfile background clamped outside its layers, and the two cannot be told apart, so such a field masks everything outside that profile and not only what is below the seabed. (Default: false)
VisualiseAsConstant 1 Bake a field that is not time-invariant anyway, showing it as it is at time zero. (Default: false)

This SimObject is referred to as VisualScalarPlane