-
Notifications
You must be signed in to change notification settings - Fork 51
SunflaresConfig
This section describes how to configure sunflares, it is aimed at modders and advanced users.
Sunflares in Scatterer require an entry in the global planets list file, and a per-sunflare config file with the detailed configuration. Sunflare configs have two different syntaxes, the old one is kept for compatibility with older configurations.
Sunflares can be configured from the in-game UI starting from scatterer version 0.0760.
From version 0.0765 onwards, it is possible to modify the sunflares in-game from the UI. This is the recommended way to configure them as it allows having immediate feedback. The UI is accessible with Alt+F11 by default. Changes made here are not permanent, so they have to be copied manually or they will be lost when changing scenes or exiting the game (though they will be logged to the game's log file every time a new config is applied).
For versions 0.0723 and prior, the planets list file serves as a "master list" and holds the general settings for planets and sunflares. Simply list the name of the CelestialBody to add a sunflare to here, and a corresponding sunflare will be loaded from the matching sunflare config file. This is no longer needed from version 0.0765 onwards (currently unreleased), only the sunflare config.
Structure of the planetsList file:
Scatterer_planetsList
{
scattererCelestialBodies
{
...
}
sunflares
{
Item = name
}
}
A scatterer sunflare is composed of flares and ghosts. The distinction is very simple, flares are centered on the sun, while ghosts can move around on an invisible line in the direction going from the center of the sun to the center of the screen (and beyond). Flares can vary in brightness and scale, while ghosts have a fixed scale and vary only in brightness.
Example: Flares only:
Flares+ghosts:
A sunflare config file has the following structure
Scatterer_sunflare
{
name
{
syntaxVersion = value
key = value
...
}
}
Where the name is the celestial body's name, and has to match the name entered in the planets list file.
SyntaxVersion determines the version of the syntax used. SyntaxVersion 1 refers to the original syntax format that was added since sunflares were created. If no syntax version is entered in the config file, it will default to 1 to keep compatibility with older configs that existed before version 2 was added.
If you are creating a new sunflare, just use syntax version 2.
Both syntax versions take:
-
2 flare textures: each can have 1 instance, configurable separately for intensity, aspect ratio and scale.
-
3 ghost textures: each can have 8 instances, configurable separately for intensity, aspect ratio, scale and position.
A syntax version 2 sunflare config file has the following structure
Scatterer_sunflare
{
name
{
syntaxVersion = 2
flareColor = value
flares
{
Item
{
key = value
...
}
...
}
ghosts
{
Item
{
key = value
...
}
...
}
}
}
Variable | Description | Example |
---|---|---|
texture | path to flare texture, relative to GameData, can be .dds DXT1 or DXT5, .png or .jpg. Note that everything in the sunflare shader is additive, meaning alpha channel is not used, and black is the equivalent of transparent. | "texture = scatterer/config/Sunflares/Sun/sunFlare.png" |
displayAspectRatio | The aspect ratio the flare will be displayed in, regardless of the actual aspect ratio of the texture file. In height/width | "displayAspectRatio = 1" for a square aspect ratio. "displayAspectRatio = 0.5" for a horizontal rectangle. |
scaleCurve | A float curve determining the scale of the flare, over the distance to the parent body. The unit for the distance used is the parent body's radius, that way flares will port easily to differently sized bodies. Recommend using a curve editor to modify curves, example, other example | { key = 1 5 0 -0.200 key = 55 1.05 -0.007 -0.0012 key = 2500 0.2 0 0 } |
intensityCurve | A float curve determining the intensity/brightness of the flare, over the distance to the parent body. The unit for the distance used is the parent body's radius | { key = 2 0.0 0 0 key = 11 0.6 0 0 } |
Variable | Description | Example |
---|---|---|
texture | Path to ghost texture, relative to GameData, can be .dds DXT1 or DXT5, .png or .jpg. Note that everything in the sunflare shader is additive, meaning alpha channel is not used, and black is the equivalent of transparent. | "texture = scatterer/config/Sunflares/Sun/Ghost1.png" |
intensityCurve | A float curve determining the intensity/brightness of the ghost, over the distance to the parent body. The unit for the distance used is the parent body's radius | { key = 2 0 0 0 key = 11 1 0 0 key = 500 1 0 0 key = 2500 0 0 0 } |
instances | A list of different settings for 8 maximum instances of the ghost. Each ghost texture can be used up to 8 times with different settings, refer to the full example below | instances { Item {... } Item {... } } |
instances.Item.intensityMultiplier | An intensity/brightness multiplier. The final brightness for the ghost instance will be the product of the value from the curve above and the multiplier for this instance. | "intensityMultiplier = 0.5" |
instances.Item.displayAspectRatio | The aspect ratio the flare will be displayed in, regardless of the actual aspect ratio of the texture file. In height/width | "displayAspectRatio = 1" for a square aspect ratio. "displayAspectRatio = 0.5" for a horizontal rectangle. |
instances.Item.scale | The scale of this ghost | scale = 1 |
instances.Item.sunToScreenCenterPosition | Unlike flares, ghosts aren't locked to the position of the parent body on screen. They can be anywhere on a line defined by the parent body and the center of the screen. 0 is the parent star/body's position, 1 is the center of the screen, 2 is the opposite position of the body relative to the screen center. Values can be higher or lower, positive or negative | sunToScreenCenterPosition = 0.9 |
Scatterer_sunflare
{
Sun
{
syntaxVersion = 2
flareColor = 1.0,1.0,1.0
flares
{
Item
{
texture = scatterer/config/Sunflares/Sun/sunFlare.png
displayAspectRatio = 1
scaleCurve
{
key = 1 5 0 -0.200
key = 55 1.05 -0.007 -0.0012
key = 2500 0.2 0 0
}
intensityCurve
{
key = 2 0.0 0 0
key = 11 0.6 0 0
}
}
Item
{
texture = scatterer/config/Sunflares/Sun/sunSpikes.png
displayAspectRatio = 1
scaleCurve
{
key = 1 5 0 -0.200
key = 55 1.05 -0.007 -0.0012
key = 2500 0.0 0 0
}
intensityCurve
{
key = 2 0.0 0 0
key = 11 0.6 0 0
}
}
}
ghosts
{
Item
{
texture = scatterer/config/Sunflares/Sun/Ghost1.png
intensityCurve
{
key = 2 0.0 0 0
key = 11 1 0 0
key = 500 1 0 0
key = 2500 0 0 0
}
instances
{
Item
{
intensityMultiplier = 0.54
displayAspectRatio = 0.65
scale = 0.434
sunToScreenCenterPosition = 0.5
}
Item
{
intensityMultiplier = 0.54
displayAspectRatio = 1
scale = 0.166
sunToScreenCenterPosition = 0.7
}
}
}
Item
{
texture = scatterer/config/Sunflares/Sun/Ghost2.png
intensityCurve
{
key = 2 0 0 0
key = 11 1 0 0
key = 500 1 0 0
key = 2500 0 0 0
}
instances
{
Item
{
intensityMultiplier = 0.135
displayAspectRatio = 1
scale = 0.333
sunToScreenCenterPosition = 0.9
}
Item
{
intensityMultiplier = 0.054
displayAspectRatio = 1
scale = 0.125
sunToScreenCenterPosition = 1.1
}
Item
{
intensityMultiplier = 0.054
displayAspectRatio = 1
scale = 0.25
sunToScreenCenterPosition = 1.3
}
Item
{
intensityMultiplier = 0.054
displayAspectRatio = 1
scale = 0.2
sunToScreenCenterPosition = 1.5
}
}
}
}
}
}
This is the old version of the syntax and has a few limitations on how much control it offers and some hardcoded texture names.
The flare texture names are hardcoded to "sunFlare.png" and "sunSpikes.png". Despite the difference in name they both function the same way. Both textures need to be included even if not in use.
The ghost texture names are hardcoded to "Ghost1.png", "Ghost2.png" and "Ghost3.png". All 3 textures need to be included even if not in use.
Variable | Description | Example |
---|---|---|
assetPath | path to sunflare textures, relative to GameData | "assetPath = scatterer/config/Sunflares/Sun" |
flareColor | color of the sunflare | "flareColor = 1.0,1.0,1.0" for white |
flareSettings | settings for the first flare ("sunFlare.png"), the values are intensity, aspect ratio, and the inverse of scale (1/scale). The intensity is the brightness of the flare. Aspect ratio refers to the aspect ratio you want the flare to be displayed in, regardless of the aspect ratio of your texture, 1 will always display a square texture. The aspect ratio is expressed as height/width, meaning 0.5 will produce a wide texture. Inverse scale means a smaller value will produce a bigger flare, scales are passed to the shader as inverses and this was left this way as an oversight. | "flareSettings = 1.0,1.0,1.0" for a bright square flare. "flareSettings = 1.0,0.5,0.7" for a bigger and wider flare |
spikesSettings | same as above but for for the second flare ("sunSpikes.png") | "spikesSettings = 0.6,1,1"* |
sunGlareFadeDistance | ||
ghostFadeDistance | ||
ghostSettingsList |
Scatterer_sunflare
{
Sun
{
assetPath = scatterer/config/Sunflares/Sun
flareColor = 1.0,1.0,1.0
//sunFlare.png
flareSettings = 0.45,1,0.85
//sunSpikes.png
spikesSettings = 0.6,1,1
sunGlareFadeDistance = 250000
ghostFadeDistance = 13500000
//Ghost1.png
ghost1SettingsList1 //2 used slots, 2 unused
{
Item = 0.54,0.65,2.3,0.5
Item = 0.54,1,6,0.7
}
//4 more unused slots for ghost 1
ghost1SettingsList2
{
}
//Ghost2.png
ghost2SettingsList1
{
Item = 0.135,1,3,0.9
Item = 0.054,1,8,1.1
Item = 0.054,1,4,1.3
Item = 0.054,1,5,1.5
}
//4 more unused slots for ghost 2
ghost2SettingsList2
{
}
//8 unused slots for ghost 3
ghost3SettingsList1
{
}
ghost3SettingsList2
{
}
}
}