# Reflection and Transmission of Objects Through the Ocean Surface

Until now, the `external_exact` parameter has been set to `no`. Under this condition, the only objects which reflect and transmit light on the ocean surface are the sun and air. Clouds, boxes, pictures, or other objects are effectively invisible to the ocean surface in this choice. The choice `external_exact` `yes` makes other objects in a scene reflect or transmit through the surface, depending on additional parameters. This choice also increases the rendering time, potentially by quite a lot. In order to make the rendering efficient, additional parameters allow you to limit the conditions in which `external_exact` `yes` is exercised.

When `external_exact` `yes` has been chosen, the basic ocean input file becomes

  `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` `yes`
  max_distance `2000`
  image `above`
  `reflection_method specular`
  `shadow_air 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`

Four additional lines are located under the `external_exact` line. The `max_distance` is the range from the camera out to which exact reflection and transmission calculations are performed. Beyond that distance, the renderer reverts back to the familiar `external_exact` `no` behavior. The choice `image` `above` restricts the renderer to reflection/transmission of only those objects (or parts of objects) that are above the water surface. The other choices for `image` are `below`, `everything,` and`nothing`.

The reflections of skylight and objects from the water surface include the effects of very small waves. Additional control over the ``hardness'' of water reflections is available, via the `sharpening_factor` and the `reflection_method`. The `sharpening_factor` line is conceptually similar to the sharpening factor that can be applied to the glitter, except that here it applies to all reflections and transmissions through the surface. A value of 1.0 on this line includes the effects of the small scale waves on the reflections and transmissions, and corresponds to the default behavior in version 1.0. Other values scale the effect of the small scale waves. A value of 0.0 eliminates the effect of the small scale waves and makes the ocean a perfect mirror. Any positive value can be used, although values greater than 0.1 are recommended for best image quality.

The small scale waves also effect the value of the effective reflection coefficient. The calculation of the reflection coefficient is determined by `reflection_method`. It has two possible values, `specular` and `averaged`. The first value uses the specular value of the reflection coefficient and corresponds to that used in version 1.0, while the second value calculates the reflection and transmission coefficents averaged over small waves. This tends to darken reflections near the horizon and gives a more realistic result.

The air in RenderWorld is fully three dimensional. While the choice `external_exact` `yes` allows objects to reflect and refract off of the ocean surface, the air behind those objects is not occluded, and so the skylight reflection is still included. You can fake the effect of object shadowing the air by the `shadow_air` input. This parameters shodows the air as if it was a skydome surrounding the earth. It has two possible values, yes and no. Answering no has no shadowing of the air by objects, while answering yes enables shadowing. If shadowing is enabled then it is controlled by two additional parameters `max_shadow` and `max_distance_shadowed`. `max_shadow` controls the maximum strength of the shadow. It varies from 0 to 1. If it is set to one then the air is fully shadowed by an opague object. Setting it to a value less than 1 allows some water color to be seen even when the water is fully shadowed. `max_distance_shadowed` controls the maximum distance away from the ocean that objects will shadow the air. This allows one to have nearby objects shadow the air, but not far away objects such as the cloud.

Here is a sample ascii file that implements these two parameters,

  `RenderWorld_data_file ocean 5 5`
  `n_points_x 1024 1`
  `n_points_y 1024 1`
  `dx 0.75`
  `dy 0.75`
  `spectrum_file spec1.dat`
  `generate_file yes`
  `seed 1110`
  `end`
  `number_aux_oceans 0`
  `number_disturbances 0`
  `box_depth 20.`
  `reference_time 0`
  `surface_type flat`
  `max_distance 499`
  `double_distance 500`
  `wind_type fixed`
  `wind_direction 90`
  `wind_velocity 10.0`
  `waves yes`
  `water_type 3`
  `external_exact yes`
  `max_distance 2000`
  `sharpening_factor 1.0`
  `image everything`
  `reflection_method averaged`
  `shadow_air yes`
  `max_shadow 0.95`
  `max_distance_shadowed 100.`
  `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`

  Contents