# Basic Ocean File

We will now dive into the format of the ocean file and what all of the parameters mean. The first example below introduces the most basic components of the ocean file, followed by a sequence of more complicated cases. The first 4 user modifiable parameters define the size of the grid (in grid points) and the spacing between the points (in meters). Remember that the surface is periodic, so `n_points_x * dx` and `n_points_y*dy` define the length of the periodicity, which should not be too small to avoid periodicity in the image. Note that the current ascii files for version 1.1 are labelled 5 5, as opposed to the 1.0 files that were labelled 2 2. The 1.1 code will still read the old ascii files.

  `RenderWorld_data_file ocean 5 5`
  `n_points_x` `512` `1`
  `n_points_y` `512` `1`
  `dx` `1.0`
  `dy` `1.0`
  `spectrum_file` `spec1.dat`
  `generate_file` `yes`
  `random_seed` `1451`
  `end`
  `number_aux_oceans` `0`
  `number_disturbances` `0`
  `box_depth 20.`
  `reference_time` `0`
  `surface_type` `round`
  `radius` `6371230`
  `max_distance` `100`
  `double_distance` `70`
  `wind_type` `fixed`
  `wind_direction` `90`
  `wind_velocity` `8`
  `waves yes`
  `water_type` `3`
  `external_exact` `no`
  `glitter` `no`
  `whitecaps` `no`
  `textures no`
  `sunbeams no`
  `exclude_items no`
  `number_of_bands 3`
  `band_ids 1 2 3`
  `index_of_refraction` `1.34 1.34 1.34`
  `end`

The next three lines tell the computer to generate a new ocean surface and save related data in the file `spec1.dat` and provides a random number seed to base the surface on. Alternatively, if the surface file already existed from a previous job, we could have just reread it, saving time. To do this we would change the `yes` to a `no` and remove the`random_number_seed` line. More information on ocean grids is in Ocean Grids

`number_aux_oceans` relates to the concept of using a second fine scale surface, as discussed in Multiple Grids. For this first example, we aren't using a second grid, so this number is set to zero.

`number_disturbances` is the number of water surface disturbances. Disturbances are things that alter the ocean surface from simply the ambient wind waves. Disturbances include Ripples, Swell, Reflecting Walls, and Wakes. In this example we have none of these things, so the value for `number_disturbances` is zero. Each of the disturbances is discussed separately below.

Just as the air could be either flat or round, so too can the ocean. If the ocean is flat, then the following line (the radius of curvature) is omitted. It is important that the air and ocean are both flat or both round, with the same radius.

Next come the two numbers discussed in Reducing Rendering Time. Beyond `max_distance` (100 meters in this case) the ocean is totally flat. At a distance of `double_distance` (70m here) the facet size is doubled, saving on render time.

The three lines following that say that the wind is not changing with time (i.e. it is `fixed`) and that it is blowing toward the west (90 degrees) at 8 meters/second. Variable wind is discussed in subsequent sections.

The `waves yes` line allows one to specify the type of waves generated. The yes option is the basic wind wave spectrum. An alternative option is `glassy` that generates a glassy surface. This parameter is discussed in Controlling Reflection Qualities

`water_type` concerns the level of turbidity in the water. Its value ranges from 1 to 5, with 5 being most turbid. Turbidity affects both visibility underwater and water coloration.

The `glitter no` option removes glitter from the simulation. Glitter is the direct reflection of the sun off of the ocean's surface. Glitter is fully discussed in Glitter and Enhanced Glitter.

The `textures no` option concerns the addition of texture maps to the ocean surface. Textures are discussed in Texture Maps.

`sunbeams` should be left `no` because they have not yet been released.

`exclude_items no` allows selected items on the ocean surface to not be rendered in the final image as discussed in exclusions

The `index_of_refraction` line contains the index of refraction of the water for each band. Interesting rainbow-like color effects can be produced on the water surface by changing the `index_of_refraction` values with respect to each other. For underwater imaging however, the index of refraction specified in the first band is presently used for all bands.

Contents