The planet customization continues to improve. In the next nightly, we have the terminator_threshold_vector shipdata key and the equivalent JSPlanet terminatorThresholdVector property. This gives us control over the color of the planet's terminator. By default the terminator is a reddish orange color, as you are well aware.
The way this property works is not entirely straightforward, but this is what we had in the planet and atmosphere shaders so we continue to use it in the same way, only now it is externally controlled rather than hardcoded in the shaders. This property is of type Vector, so you can pass it from shipdata as
terminator_threshold_vector = "<x> <y> <z>"
or from a scipt like
system.mainPlanet.terminatorThresholdVector = [x, y, z]
.
The x, y and z values work as follows:
The game will take the cosine of the angle between the surface normal for each pixel and the light vector and do a smooth interpolation from 0.0 to each of the x, y and z values. Any such angle cosine less than 0.0 is clamped to 0.0 and any cosine higher than the x (and y and z accordingly) will be clamped to 1.0. For any cosine values in between 0.0 and x (and y and z accordingly), a smooth step hermite function is applied in order to get the color gradient you see as the terminator. OK, I don't expect to have explained it in an understandable way (sorry for that), but what this means in broad practical terms, is that the vector described with the x, y and z values corresponds more or less (emphasis on the more and the less) to the inverse of the color you want the terminator to be. So, for the default value of [x, y, z] == [0.105, 0.18, 0.28] we have x being the smallest value, therefore it will represent the dominant terminator color. Similarly in the example, the z component is the highest value and will correspond to the weakest component of the terminator color - hence the reddish appearance. For Reorte, in this build we have applied as a demo a blue terminator and we achieve that by passing as [x, y, z] the vector [0.28, 0.18, 0.105]. Now the z component is the smallest value and the x is the biggest, therefore we end up with a blue terminator color. The higher the numbers we use, the wider the terminator becomes.
Examples of the feature in action, with the settings used for each one:
Default terminator ("0.105 0.18 0.28")
terminator_threshold_vector = "0.28 0.18 0.105"
terminator_threshold_vector = "0.33 0.05 0.105"
terminator_threshold_vector = "0.05 0.1 0.9"
terminator_threshold_vector = "0.05 0.7 0.9"
