1 #ifndef INCLUDE_ONCE_D1C5F1EB_B6E7_4260_8AC3_57C35BB9B0DF 2 #define INCLUDE_ONCE_D1C5F1EB_B6E7_4260_8AC3_57C35BB9B0DF 12 DEFINE_EXPLICIT_BOOL(ForceNoEDSTextures);
14 DEFINE_EXPLICIT_BOOL(SkipSpectra);
21 GLfloat scatteringCrossSectionAt1um = NAN;
22 GLfloat angstromExponent = NAN;
23 std::vector<glm::vec4> singleScatteringAlbedo;
24 std::vector<glm::vec4> extinctionCrossSection_;
25 std::vector<glm::vec4> scatteringCrossSection_;
26 QString numberDensity;
27 QString phaseFunction;
28 PhaseFunctionType phaseFunctionType=PhaseFunctionType::General;
29 bool needsInterpolationGuides =
false;
35 bool valid(
const SkipSpectra spectrumSkipped)
const 37 return (spectrumSkipped || scatteringCrossSection_.size()==atmo.allWavelengths.size()) &&
38 (spectrumSkipped || extinctionCrossSection_.size()==atmo.allWavelengths.size()) &&
39 (spectrumSkipped || singleScatteringAlbedo .size()==atmo.allWavelengths.size()) &&
40 !numberDensity.isEmpty() &&
41 !phaseFunction.isEmpty() &&
44 void finalizeLoading();
45 glm::vec4 scatteringCrossSection(glm::vec4
const wavelengths)
const 47 const auto i=atmo.wavelengthsIndex(wavelengths);
48 return scatteringCrossSection_[i];
50 glm::vec4 extinctionCrossSection(glm::vec4
const wavelengths)
const 52 const auto i=atmo.wavelengthsIndex(wavelengths);
53 return extinctionCrossSection_[i];
58 QString numberDensity;
60 std::vector<glm::vec4> absorptionCrossSection;
68 bool valid(
const SkipSpectra spectrumSkipped)
const 70 return !numberDensity.isEmpty() &&
71 (spectrumSkipped || absorptionCrossSection.size()==atmo.allWavelengths.size()) &&
74 glm::vec4 crossSection(glm::vec4
const wavelengths)
const 76 const auto i=atmo.wavelengthsIndex(wavelengths);
77 return absorptionCrossSection[i];
81 QString descriptionFileText;
82 std::vector<glm::vec4> allWavelengths;
83 std::vector<glm::vec4> solarIrradianceAtTOA;
84 std::vector<glm::vec4> lightPollutionRelativeRadiance;
85 std::string textureOutputDir=
".";
86 GLint transmittanceTexW, transmittanceTexH;
87 GLint irradianceTexW, irradianceTexH;
88 glm::ivec4 scatteringTextureSize;
89 glm::ivec2 eclipsedSingleScatteringTextureSize;
90 glm::ivec4 eclipsedDoubleScatteringTextureSize;
91 glm::ivec2 lightPollutionTextureSize;
92 unsigned eclipsedDoubleScatteringNumberOfAzimuthPairsToSample;
93 unsigned eclipsedDoubleScatteringNumberOfElevationPairsToSample;
94 unsigned scatteringOrdersToCompute;
95 GLint numTransmittanceIntegrationPoints;
96 GLint radialIntegrationPoints;
97 GLint angularIntegrationPoints;
98 GLint eclipseAngularIntegrationPoints;
99 GLint lightPollutionAngularIntegrationPoints;
101 GLfloat atmosphereHeight;
102 double earthSunDistance;
103 double earthMoonDistance;
104 GLfloat sunAngularRadius;
105 float lengthOfHorizRayFromGroundToBorderOfAtmo;
107 std::vector<glm::vec4> groundAlbedo;
108 std::vector<Scatterer> scatterers;
109 std::vector<Absorber> absorbers;
110 bool allTexturesAreRadiance=
false;
111 bool noEclipsedDoubleScatteringTextures=
false;
112 static constexpr
unsigned pointsPerWavelengthItem=4;
113 static constexpr
unsigned FORMAT_VERSION = 6;
114 static constexpr
char ALL_TEXTURES_ARE_RADIANCES_DIRECTIVE[]=
"all textures are radiances";
115 static constexpr
char NO_ECLIPSED_DOUBLE_SCATTERING_TEXTURES_DIRECTIVE[]=
"no eclipsed double scattering textures";
116 static constexpr
char SOLAR_IRRADIANCE_AT_TOA_KEY[]=
"solar irradiance at toa";
117 static constexpr
char WAVELENGTHS_KEY[]=
"wavelengths";
119 void parse(QString
const& atmoDescrFileName,
120 ForceNoEDSTextures forceNoEDSTextures=ForceNoEDSTextures{
false},
121 SkipSpectra skipSpectra=SkipSpectra{
false});
123 auto scatTexWidth()
const {
return GLsizei(scatteringTextureSize[0]); }
124 auto scatTexHeight()
const {
return GLsizei(scatteringTextureSize[1]*scatteringTextureSize[2]); }
125 auto scatTexDepth()
const {
return GLsizei(scatteringTextureSize[3]); }
126 unsigned wavelengthsIndex(glm::vec4
const& wavelengths)
const 128 const auto it=std::find(allWavelengths.begin(), allWavelengths.end(), wavelengths);
129 assert(it!=allWavelengths.end());
130 return it-allWavelengths.begin();
132 static QString spectrumToString(std::vector<glm::vec4>
const& spectrum);
Definition: AtmosphereParameters.hpp:10
Definition: AtmosphereParameters.hpp:16
Definition: AtmosphereParameters.hpp:56