Skip to content

Commit

Permalink
add offset note
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDizzy committed May 20, 2024
1 parent 6367eb9 commit 419bc3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions content/Ocean.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: default
title: Ocean
---

The `Ocean { }` subnode contains all of the information needed to produce an ocean for the specified body. Note that the ocean is one of the two Procedural Quad Spheres on the body it is applied to. This means that some PQS Settings can be applied to Oceans.
The `Ocean { }` subnode contains all of the information needed to produce an ocean for the specified body. Note that the ocean is one of the two Procedural Quad Spheres on the body it is applied to. This means that some PQS Settings can be applied to Oceans. If you want to set a certain ocean height, see [the note regarding Height Map offsets]({{ site.baseurl }}{% link content/PQSMods/VertexHeightMap.md %}).

**Subnodes**
* Material { }
Expand All @@ -22,7 +22,7 @@ Body
density = 1.25
minLevel = 1
maxLevel = 6
minDetailDistance = 8
minDetailDistance = 6
maxQuadLengthsPerFrame = 0.03
Material
{
Expand Down
10 changes: 8 additions & 2 deletions content/PQSMods/VertexHeightMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ title: VertexHeightMap

The `VertexHeightMap` PQSMod is a mod that *adds* a given height map to the terrain. This means that height mods are additive, i.e. heightmaps don't set a fixed height.

**Notes on Heightmaps**
A common desire for planets with oceans is to set the ocean to a certain height relative to the terrain to make spots like shorelines be in the correct places. This is simple to do in 2 main steps:

1. Make sure your heghtmap is normalized (darkest value is 0 and highest is 255).
2. Set `offset` in VertexHeightMap to `-1 * (deformity * travel)`, where `travel` is the percentage of the deformity up from the lowest point of the height map that you want the sea surface to be at. For example, a `travel` of 0.5 would mean the ocean surface is at 50% grey on the height map.

**Example**
```
PQS
Expand Down Expand Up @@ -36,6 +42,6 @@ PQS
|Property|Format|Description|
|--------|------|-----------|
|map|File Path|The texture containing the height map in greyscale. Black is the `offset` height, and White is the `deformity + offset` height.|
|offset|Decimal|The offset of the height map from the body's radius.|
|offset|Decimal|The offset of the height map.|
|deformity|Decimal|The deformity of the height map (difference between lowest and highest point).|
|scaleDeformityByRadius|Boolean|Whether to multiply the deformity by the planet's radius (in case the deformity is in radii or something).|
|scaleDeformityByRadius|Boolean|Unknown|

0 comments on commit 419bc3f

Please sign in to comment.