Skip to content

Commit

Permalink
🚚 Rename csv generator tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Schneegans committed Apr 9, 2024
1 parent af78d03 commit c7ae67a
Show file tree
Hide file tree
Showing 114 changed files with 118 additions and 118 deletions.
2 changes: 1 addition & 1 deletion plugins/csp-atmospheres/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif()

# build the preprocessors --------------------------------------------------------------------------

add_subdirectory(csv-generator)
add_subdirectory(scattering-table-generator)
add_subdirectory(bruneton-preprocessor)

# build plugin -------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions plugins/csp-atmospheres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ As a consequence to the changes mentioned above, **two preprocessing steps are r

In this first preprocessing step, the scattering properties of the individual particles are precomputed.

To perform this preprocessing, the `csp-atmospheres` plugin comes with a small command-line utility: [`csv-generator`](csv-generator/README.md).
To perform this preprocessing, the `csp-atmospheres` plugin comes with a small command-line utility: [`scattering-table-generator`](scattering-table-generator/README.md).
You can use this to generate the CSV files used in the next preprocessing step.
The [README.md](csv-generator/README.md) of the command-line utility provides more information on the resulting CSV file format and some examples.
For convenience, we provide some precomputed tables for Earth and Mars in the [`csv-generator/output`](csv-generator/output) directory.
The [README.md](scattering-table-generator/README.md) of the command-line utility provides more information on the resulting CSV file format and some examples.
For convenience, we provide some precomputed tables for Earth and Mars in the [`scattering-table-generator/output`](scattering-table-generator/output) directory.

#### Preprocessing Step 2: Precompute the Atmospheric-Scattering Textures

Expand Down
48 changes: 24 additions & 24 deletions plugins/csp-atmospheres/bruneton-preprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: CC-BY-4.0
# Precomputation of Multiple-Scattering Textures

The `bruneton-preprocessor` command-line tool precomputes the multiple scattering lookup tables for the `Bruneton` atmosphere model.
It consumes the CSV files generated by the `csv-generator` tool and stores the resulting textures in the specified directory.
It consumes the CSV files generated by the `scattering-table-generator` tool and stores the resulting textures in the specified directory.

> [!IMPORTANT]
> This plugin uses code published by Eric Bruneton under the BSD-3-Clause license. Consequently, not all source files are available under the MIT license. See the individual SPDX-tags for details.
Expand Down Expand Up @@ -49,26 +49,26 @@ install/linux-Release/bin/bruneton-preprocessor <settings.json> <output director
The settings file is a JSON file that specifies the parameters for the precomputation.
You can see some example files in the [`settings`](settings) directory.

| Property | Default Value | Description |
| ------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `minAltitude` | _mandatory_ | The radius of the lower atmosphere boundary in meters. |
| `maxAltitude` | _mandatory_ | The radius of the upper atmosphere boundary in meters. |
| `sunDistance` | _mandatory_ | The average distance to the Sun in meters. |
| `molecules` | _mandatory_ | This object should contain `"phase"`, `"betaSca"`, `"betaAbs"`, and `"density"` CSV file paths to the respective files generated with the `csv-generator`. |
| `aerosols` | _mandatory_ | This object should contain `"phase"`, `"betaSca"`, `"betaAbs"`, and `"density"` CSV file paths to the respective files generated with the `csv-generator`. |
| `ozone` | _optional_ | If specified, this object should contain `"betaAbs"` and `"density"` CSV file paths to the respective files generated with the `csv-generator`. |
| `groundAlbedo` | `0.1` | The average reflectance of the ground used during multiple scattering. |
| `multiScatteringOrder` | `4` | The number of multiple scattering events to precompute. Use zero for single-scattering only. |
| `sampleCountOpticalDepth` | `500` | The number of samples to evaluate when precomputing the optical depth. |
| `sampleCountSingleScattering` | `50` | The number of samples to evaluate when precomputing the single scattering. Larger values improve the sampling of thin atmospheric layers. |
| `sampleCountMultiScattering` | `50` | The number of samples to evaluate when precomputing the multiple scattering. Larger values tend to darken the horizon for thick atmospheres. |
| `sampleCountScatteringDensity` | `16` | The number of samples to evaluate when precomputing the scattering density. Larger values spread out colors in the sky. |
| `sampleCountIndirectIrradiance` | `32` | The number of samples to evaluate when precomputing the indirect irradiance. |
| `transmittanceTextureWidth` | `256` | The horizontal resolution of the transmittance texture. Larger values can improve the sampling of thin atmospheric layers close to the horizon. |
| `transmittanceTextureHeight` | `64` | The vertical resolution of the transmittance texture. Larger values can improve the sampling of thin atmospheric layers close to the horizon. |
| `scatteringTextureRSize` | `32` | Larger values improve sampling of thick low-altitude layers. |
| `scatteringTextureMuSize` | `128` | Larger values reduce circular banding artifacts around zenith for thick atmospheres. |
| `scatteringTextureMuSSize` | `32` | Larger values reduce banding in the day-night transition when seen from space. |
| `scatteringTextureNuSize` | `8` | Larger values reduce circular banding artifacts around sun for thick atmospheres. |
| `irradianceTextureWidth` | `64` | The horizontal resolution of the irradiance texture. |
| `irradianceTextureHeight` | `16` | The vertical resolution of the irradiance texture. |
| Property | Default Value | Description |
| ------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `minAltitude` | _mandatory_ | The radius of the lower atmosphere boundary in meters. |
| `maxAltitude` | _mandatory_ | The radius of the upper atmosphere boundary in meters. |
| `sunDistance` | _mandatory_ | The average distance to the Sun in meters. |
| `molecules` | _mandatory_ | This object should contain `"phase"`, `"betaSca"`, `"betaAbs"`, and `"density"` CSV file paths to the respective files generated with the `scattering-table-generator`. |
| `aerosols` | _mandatory_ | This object should contain `"phase"`, `"betaSca"`, `"betaAbs"`, and `"density"` CSV file paths to the respective files generated with the `scattering-table-generator`. |
| `ozone` | _optional_ | If specified, this object should contain `"betaAbs"` and `"density"` CSV file paths to the respective files generated with the `scattering-table-generator`. |
| `groundAlbedo` | `0.1` | The average reflectance of the ground used during multiple scattering. |
| `multiScatteringOrder` | `4` | The number of multiple scattering events to precompute. Use zero for single-scattering only. |
| `sampleCountOpticalDepth` | `500` | The number of samples to evaluate when precomputing the optical depth. |
| `sampleCountSingleScattering` | `50` | The number of samples to evaluate when precomputing the single scattering. Larger values improve the sampling of thin atmospheric layers. |
| `sampleCountMultiScattering` | `50` | The number of samples to evaluate when precomputing the multiple scattering. Larger values tend to darken the horizon for thick atmospheres. |
| `sampleCountScatteringDensity` | `16` | The number of samples to evaluate when precomputing the scattering density. Larger values spread out colors in the sky. |
| `sampleCountIndirectIrradiance` | `32` | The number of samples to evaluate when precomputing the indirect irradiance. |
| `transmittanceTextureWidth` | `256` | The horizontal resolution of the transmittance texture. Larger values can improve the sampling of thin atmospheric layers close to the horizon. |
| `transmittanceTextureHeight` | `64` | The vertical resolution of the transmittance texture. Larger values can improve the sampling of thin atmospheric layers close to the horizon. |
| `scatteringTextureRSize` | `32` | Larger values improve sampling of thick low-altitude layers. |
| `scatteringTextureMuSize` | `128` | Larger values reduce circular banding artifacts around zenith for thick atmospheres. |
| `scatteringTextureMuSSize` | `32` | Larger values reduce banding in the day-night transition when seen from space. |
| `scatteringTextureNuSize` | `8` | Larger values reduce circular banding artifacts around sun for thick atmospheres. |
| `irradianceTextureWidth` | `64` | The horizontal resolution of the irradiance texture. |
| `irradianceTextureHeight` | `16` | The vertical resolution of the irradiance texture. |
20 changes: 10 additions & 10 deletions plugins/csp-atmospheres/bruneton-preprocessor/settings/earth.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"minAltitude": 6370900,
"maxAltitude": 6451000,
"molecules": {
"phase": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_molecules_phase.csv",
"betaSca": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_molecules_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_molecules_absorption.csv",
"density": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_molecules_density.csv"
"phase": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_molecules_phase.csv",
"betaSca": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_molecules_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_molecules_absorption.csv",
"density": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_molecules_density.csv"
},
"aerosols": {
"phase": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_aerosols_phase.csv",
"betaSca": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_aerosols_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_aerosols_absorption.csv",
"density": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_aerosols_density.csv"
"phase": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_aerosols_phase.csv",
"betaSca": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_aerosols_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_aerosols_absorption.csv",
"density": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_aerosols_density.csv"
},
"ozone": {
"betaAbs": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_ozone_absorption.csv",
"density": "plugins/csp-atmospheres/csv-generator/output/earth_cosmoscout_ozone_density.csv"
"betaAbs": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_ozone_absorption.csv",
"density": "plugins/csp-atmospheres/scattering-table-generator/output/earth_cosmoscout_ozone_density.csv"
}
}
16 changes: 8 additions & 8 deletions plugins/csp-atmospheres/bruneton-preprocessor/settings/mars.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"minAltitude": 3385000,
"maxAltitude": 3469500,
"molecules": {
"phase": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_molecules_cinematic_phase.csv",
"betaSca": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_molecules_cinematic_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_molecules_cinematic_absorption.csv",
"density": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_molecules_cinematic_density.csv"
"phase": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_molecules_cinematic_phase.csv",
"betaSca": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_molecules_cinematic_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_molecules_cinematic_absorption.csv",
"density": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_molecules_cinematic_density.csv"
},
"aerosols": {
"phase": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_aerosols_cinematic_phase.csv",
"betaSca": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_aerosols_cinematic_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_aerosols_cinematic_absorption.csv",
"density": "plugins/csp-atmospheres/csv-generator/output/mars_cosmoscout_aerosols_cinematic_density.csv"
"phase": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_aerosols_cinematic_phase.csv",
"betaSca": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_aerosols_cinematic_scattering.csv",
"betaAbs": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_aerosols_cinematic_absorption.csv",
"density": "plugins/csp-atmospheres/scattering-table-generator/output/mars_cosmoscout_aerosols_cinematic_density.csv"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# SPDX-FileCopyrightText: German Aerospace Center (DLR) <cosmoscout@dlr.de>
# SPDX-License-Identifier: MIT

option(CSP_ATMOSPHERES_CSV_GENERATOR "Enable compilation of the Atmosphere CSV Generator" OFF)
option(CSP_ATMOSPHERES_SCATTERING_TABLE_GENERATOR "Enable compilation of the Atmosphere CSV Generator" OFF)

if (NOT CSP_ATMOSPHERES_CSV_GENERATOR)
if (NOT CSP_ATMOSPHERES_SCATTERING_TABLE_GENERATOR)
return()
endif()

Expand All @@ -22,30 +22,30 @@ file(GLOB SOURCE_FILES *.cpp)
# Header files are only added in order to make them available in your IDE.
file(GLOB HEADER_FILES *.hpp)

add_executable(csv-generator
add_executable(scattering-table-generator
${SOURCE_FILES}
${HEADER_FILES}
)

target_link_libraries(csv-generator
target_link_libraries(scattering-table-generator
cs-utils
OpenMP::OpenMP_CXX
)

# Make directory structure available in your IDE.
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "csv-generator"
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "scattering-table-generator"
FILES ${SOURCE_FILES} ${HEADER_FILES}
)

# Make sure that CosmoScout VR can be directly started from within Visual Studio.
set_target_properties(csv-generator PROPERTIES
set_target_properties(scattering-table-generator PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}\\bin"
VS_DEBUGGER_ENVIRONMENT "PATH=..\\lib;%PATH%"
)

# install executable ---------------------------------------------------------------------------------

install(
TARGETS csv-generator
TARGETS scattering-table-generator
RUNTIME DESTINATION "bin"
)
Loading

0 comments on commit c7ae67a

Please sign in to comment.