diff --git a/Editor/WeatherWindow.cpp b/Editor/WeatherWindow.cpp index 9f387ab75..d8eb1a2f5 100644 --- a/Editor/WeatherWindow.cpp +++ b/Editor/WeatherWindow.cpp @@ -11,7 +11,7 @@ using namespace wiGraphics; void WeatherWindow::Create(EditorComponent* editor) { wiWindow::Create("Weather Window"); - SetSize(XMFLOAT2(660, 520)); + SetSize(XMFLOAT2(660, 560)); float x = 180; float y = 20; @@ -107,6 +107,14 @@ void WeatherWindow::Create(EditorComponent* editor) }); AddWidget(&windRandomnessSlider); + skyExposureSlider.Create(0, 4, 1, 10000, "Sky Exposure: "); + skyExposureSlider.SetSize(XMFLOAT2(100, hei)); + skyExposureSlider.SetPos(XMFLOAT2(x, y += step)); + skyExposureSlider.OnSlide([&](wiEventArgs args) { + GetWeather().skyExposure = args.fValue; + }); + AddWidget(&skyExposureSlider); + simpleskyCheckBox.Create("Simple sky: "); simpleskyCheckBox.SetTooltip("Simple sky will simply blend horizon and zenith color from bottom to top."); simpleskyCheckBox.SetSize(XMFLOAT2(hei, hei)); diff --git a/Editor/WeatherWindow.h b/Editor/WeatherWindow.h index ebd7e1d9c..97ff50023 100644 --- a/Editor/WeatherWindow.h +++ b/Editor/WeatherWindow.h @@ -25,6 +25,7 @@ public: wiSlider windDirectionSlider; wiSlider windWaveSizeSlider; wiSlider windRandomnessSlider; + wiSlider skyExposureSlider; wiCheckBox simpleskyCheckBox; wiCheckBox realisticskyCheckBox; wiButton skyButton; diff --git a/WickedEngine/ArchiveVersionHistory.txt b/WickedEngine/ArchiveVersionHistory.txt index bca137318..b7daf080c 100644 --- a/WickedEngine/ArchiveVersionHistory.txt +++ b/WickedEngine/ArchiveVersionHistory.txt @@ -1,5 +1,6 @@ This file contains changelog of wiArchive versions +66: serialized WeatherComponent::atmosphereParameters and skyExposure 65: serialized CameraComponent focal_length, aperture_size and aperture_shape 64: serialized per-emitter gravity, velocity, drag and random_color 63: serialized wiResourceManager embedded resources diff --git a/WickedEngine/shaders/ShaderInterop_Renderer.h b/WickedEngine/shaders/ShaderInterop_Renderer.h index 4638a15f5..147854743 100644 --- a/WickedEngine/shaders/ShaderInterop_Renderer.h +++ b/WickedEngine/shaders/ShaderInterop_Renderer.h @@ -268,6 +268,88 @@ static const uint TILED_CULLING_GRANULARITY = TILED_CULLING_BLOCKSIZE / TILED_CU static const int impostorCaptureAngles = 36; +struct AtmosphereParameters +{ + float2 padding0; + // Radius of the planet (center to ground) + float bottomRadius; + // Maximum considered atmosphere height (center to atmosphere top) + float topRadius; + // Center of the planet + float3 planetCenter; + + // Rayleigh scattering exponential distribution scale in the atmosphere + float rayleighDensityExpScale; + // Rayleigh scattering coefficients + float3 rayleighScattering; + + // Mie scattering exponential distribution scale in the atmosphere + float mieDensityExpScale; + // Mie scattering coefficients + float3 mieScattering; float padding1; + // Mie extinction coefficients + float3 mieExtinction; float padding2; + // Mie absorption coefficients + float3 mieAbsorption; + // Mie phase function excentricity + float miePhaseG; + + // Another medium type in the atmosphere + float absorptionDensity0LayerWidth; + float absorptionDensity0ConstantTerm; + float absorptionDensity0LinearTerm; + float absorptionDensity1ConstantTerm; + float3 padding3; + float absorptionDensity1LinearTerm; + // This other medium only absorb light, e.g. useful to represent ozone in the earth atmosphere + float3 absorptionExtinction; float padding4; + + // The albedo of the ground. + float3 groundAlbedo; float padding5; + + // Init default values (All units in kilometers) + void init( + float earthBottomRadius = 6360.0f, + float earthTopRadius = 6460.0f, // 100km atmosphere radius, less edge visible and it contain 99.99% of the atmosphere medium https://en.wikipedia.org/wiki/K%C3%A1rm%C3%A1n_line + float earthRayleighScaleHeight = 8.0f, + float earthMieScaleHeight = 1.2f + ) + { + + // Values shown here are the result of integration over wavelength power spectrum integrated with paricular function. + // Refer to https://github.com/ebruneton/precomputed_atmospheric_scattering for details. + + // Translation from Bruneton2017 parameterisation. + rayleighDensityExpScale = -1.0f / earthRayleighScaleHeight; + mieDensityExpScale = -1.0f / earthMieScaleHeight; + absorptionDensity0LayerWidth = 25.0f; + absorptionDensity0ConstantTerm = -2.0f / 3.0f; + absorptionDensity0LinearTerm = 1.0f / 15.0f; + absorptionDensity1ConstantTerm = 8.0f / 3.0f; + absorptionDensity1LinearTerm = -1.0f / 15.0f; + + miePhaseG = 0.8f; + rayleighScattering = float3(0.005802f, 0.013558f, 0.033100f); + mieScattering = float3(0.003996f, 0.003996f, 0.003996f); + mieExtinction = float3(0.004440f, 0.004440f, 0.004440f); + mieAbsorption.x = mieExtinction.x - mieScattering.x; + mieAbsorption.y = mieExtinction.y - mieScattering.y; + mieAbsorption.z = mieExtinction.z - mieScattering.z; + + absorptionExtinction = float3(0.000650f, 0.001881f, 0.000085f); + + groundAlbedo = float3(0.3f, 0.3f, 0.3f); // 0.3 for earths ground albedo, see https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html + bottomRadius = earthBottomRadius; + topRadius = earthTopRadius; + planetCenter = float3(0.0f, -earthBottomRadius - 0.1f, 0.0f); // Spawn 100m in the air + } + + +#ifdef __cplusplus + AtmosphereParameters() { init(); } +#endif // __cplusplus +}; + // These option bits can be read from g_xFrame_Options constant buffer value: static const uint OPTION_BIT_TEMPORALAA_ENABLED = 1 << 0; static const uint OPTION_BIT_TRANSPARENTSHADOWS_ENABLED = 1 << 1; @@ -305,6 +387,9 @@ CBUFFER(FrameCB, CBSLOT_RENDERER_FRAME) float3 g_xFrame_Ambient; float g_xFrame_Cloudiness; + float3 g_xFrame_padding0; + float g_xFrame_SkyExposure; + float3 g_xFrame_Fog; // Fog Start,End,Height float g_xFrame_VoxelRadianceMaxDistance; // maximum raymarch distance for voxel GI in world-space @@ -363,6 +448,8 @@ CBUFFER(FrameCB, CBSLOT_RENDERER_FRAME) float g_xFrame_ShadowKernelCube; uint g_xFrame_RaytracedShadowsSampleCount; int g_xFrame_ObjectShaderSamplerIndex; + + AtmosphereParameters g_xFrame_Atmosphere; }; CBUFFER(CameraCB, CBSLOT_RENDERER_CAMERA) diff --git a/WickedEngine/shaders/lightingHF.hlsli b/WickedEngine/shaders/lightingHF.hlsli index 49b737267..22dff440e 100644 --- a/WickedEngine/shaders/lightingHF.hlsli +++ b/WickedEngine/shaders/lightingHF.hlsli @@ -199,8 +199,7 @@ inline void DirectionalLight(in ShaderEntity light, in Surface surface, inout Li float3 atmosphereTransmittance = 1; if (g_xFrame_Options & OPTION_BIT_REALISTIC_SKY) { - AtmosphereParameters Atmosphere = GetAtmosphereParameters(); - atmosphereTransmittance = GetAtmosphericLightTransmittance(Atmosphere, surface.P, L, texture_transmittancelut); + atmosphereTransmittance = GetAtmosphericLightTransmittance(g_xFrame_Atmosphere, surface.P, L, texture_transmittancelut); } float3 lightColor = light.GetColor().rgb * light.GetEnergy() * shadow * atmosphereTransmittance; diff --git a/WickedEngine/shaders/raytraceCS.hlsl b/WickedEngine/shaders/raytraceCS.hlsl index 55b662b40..f43d4dfd7 100644 --- a/WickedEngine/shaders/raytraceCS.hlsl +++ b/WickedEngine/shaders/raytraceCS.hlsl @@ -211,7 +211,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint groupIndex : SV_GroupIndex) float3 atmosphereTransmittance = 1; if (g_xFrame_Options & OPTION_BIT_REALISTIC_SKY) { - AtmosphereParameters Atmosphere = GetAtmosphereParameters(); + AtmosphereParameters Atmosphere = g_xFrame_Atmosphere; atmosphereTransmittance = GetAtmosphericLightTransmittance(Atmosphere, surface.P, L, texture_transmittancelut); } lightColor *= atmosphereTransmittance; diff --git a/WickedEngine/shaders/renderlightmapPS.hlsl b/WickedEngine/shaders/renderlightmapPS.hlsl index 9bfbe7a91..d3eb5eae7 100644 --- a/WickedEngine/shaders/renderlightmapPS.hlsl +++ b/WickedEngine/shaders/renderlightmapPS.hlsl @@ -65,8 +65,7 @@ float4 main(Input input) : SV_TARGET float3 atmosphereTransmittance = 1.0; if (g_xFrame_Options & OPTION_BIT_REALISTIC_SKY) { - AtmosphereParameters Atmosphere = GetAtmosphereParameters(); - atmosphereTransmittance = GetAtmosphericLightTransmittance(Atmosphere, surface.P, L, texture_transmittancelut); + atmosphereTransmittance = GetAtmosphericLightTransmittance(g_xFrame_Atmosphere, surface.P, L, texture_transmittancelut); } float3 lightColor = light.GetColor().rgb * light.GetEnergy() * atmosphereTransmittance; diff --git a/WickedEngine/shaders/skyAtmosphere.hlsli b/WickedEngine/shaders/skyAtmosphere.hlsli index d8b4f4d06..ec59bc73d 100644 --- a/WickedEngine/shaders/skyAtmosphere.hlsli +++ b/WickedEngine/shaders/skyAtmosphere.hlsli @@ -23,84 +23,6 @@ static const float2 skyViewLUTRes = float2(192.0, 104); #define PLANET_RADIUS_OFFSET 0.001f // Float accuracy offset in Sky unit (km, so this is 1m) -struct AtmosphereParameters -{ - // Radius of the planet (center to ground) - float bottomRadius; - // Maximum considered atmosphere height (center to atmosphere top) - float topRadius; - // Center of the planet - float3 planetCenter; - - // Rayleigh scattering exponential distribution scale in the atmosphere - float rayleighDensityExpScale; - // Rayleigh scattering coefficients - float3 rayleighScattering; - - // Mie scattering exponential distribution scale in the atmosphere - float mieDensityExpScale; - // Mie scattering coefficients - float3 mieScattering; - // Mie extinction coefficients - float3 mieExtinction; - // Mie absorption coefficients - float3 mieAbsorption; - // Mie phase function excentricity - float miePhaseG; - - // Another medium type in the atmosphere - float absorptionDensity0LayerWidth; - float absorptionDensity0ConstantTerm; - float absorptionDensity0LinearTerm; - float absorptionDensity1ConstantTerm; - float absorptionDensity1LinearTerm; - // This other medium only absorb light, e.g. useful to represent ozone in the earth atmosphere - float3 absorptionExtinction; - - // The albedo of the ground. - float3 groundAlbedo; -}; - -AtmosphereParameters GetAtmosphereParameters() -{ - AtmosphereParameters parameters; - - // Values shown here are the result of integration over wavelength power spectrum integrated with paricular function. - // Refer to https://github.com/ebruneton/precomputed_atmospheric_scattering for details. - - // All units in kilometers - const float earthBottomRadius = 6360.0f; - const float earthTopRadius = 6460.0f; // 100km atmosphere radius, less edge visible and it contain 99.99% of the atmosphere medium https://en.wikipedia.org/wiki/K%C3%A1rm%C3%A1n_line - const float earthRayleighScaleHeight = 8.0f; - const float earthMieScaleHeight = 1.2f; - - // Traslation from Bruneton2017 parameterisation. - parameters.rayleighDensityExpScale = -1.0 / earthRayleighScaleHeight; - parameters.mieDensityExpScale = -1.0 / earthMieScaleHeight; - parameters.absorptionDensity0LayerWidth = 25.0; - parameters.absorptionDensity0ConstantTerm = -2.0 / 3.0; - parameters.absorptionDensity0LinearTerm = 1.0 / 15.0; - parameters.absorptionDensity1ConstantTerm = 8.0 / 3.0; - parameters.absorptionDensity1LinearTerm = -1.0 / 15.0; - - parameters.miePhaseG = 0.8; - parameters.rayleighScattering = float3(0.005802f, 0.013558f, 0.033100f); - parameters.mieScattering = float3(0.003996f, 0.003996f, 0.003996f); - parameters.mieExtinction = float3(0.004440f, 0.004440f, 0.004440f); - parameters.mieAbsorption = parameters.mieExtinction - parameters.mieScattering; - - parameters.absorptionExtinction = float3(0.000650f, 0.001881f, 0.000085f); - - parameters.groundAlbedo = float3(0.3, 0.3, 0.3); // 0.3 for earths ground albedo, see https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html - parameters.bottomRadius = earthBottomRadius; - parameters.topRadius = earthTopRadius; - parameters.planetCenter = float3(0.0, -earthBottomRadius - 0.1, 0.0); // Spawn 100m in the air - - return parameters; -} - - - //////////////////////////////////////////////////////////// // LUT functions //////////////////////////////////////////////////////////// @@ -754,4 +676,4 @@ SingleScatteringResult IntegrateScatteredLuminance( } -#endif // WI_SKYATMOSPHERE_HF \ No newline at end of file +#endif // WI_SKYATMOSPHERE_HF diff --git a/WickedEngine/shaders/skyAtmosphere_multiScatteredLuminanceLutCS.hlsl b/WickedEngine/shaders/skyAtmosphere_multiScatteredLuminanceLutCS.hlsl index 6961a2e8f..721664265 100644 --- a/WickedEngine/shaders/skyAtmosphere_multiScatteredLuminanceLutCS.hlsl +++ b/WickedEngine/shaders/skyAtmosphere_multiScatteredLuminanceLutCS.hlsl @@ -19,7 +19,7 @@ void main(uint3 DTid : SV_DispatchThreadID) uv = float2(FromSubUvsToUnit(uv.x, multiScatteringLUTRes.x), FromSubUvsToUnit(uv.y, multiScatteringLUTRes.y)); - AtmosphereParameters atmosphere = GetAtmosphereParameters(); + AtmosphereParameters atmosphere = g_xFrame_Atmosphere; float cosSunZenithAngle = uv.x * 2.0 - 1.0; float3 sunDirection = float3(0.0, sqrt(saturate(1.0 - cosSunZenithAngle * cosSunZenithAngle)), cosSunZenithAngle); diff --git a/WickedEngine/shaders/skyAtmosphere_skyLuminanceLutCS.hlsl b/WickedEngine/shaders/skyAtmosphere_skyLuminanceLutCS.hlsl index ba3916a5c..de1875c52 100644 --- a/WickedEngine/shaders/skyAtmosphere_skyLuminanceLutCS.hlsl +++ b/WickedEngine/shaders/skyAtmosphere_skyLuminanceLutCS.hlsl @@ -16,7 +16,7 @@ void main(uint3 DTid : SV_DispatchThreadID) float2 uv = pixelPosition * rcp(multiScatteringLUTRes); - AtmosphereParameters atmosphere = GetAtmosphereParameters(); + AtmosphereParameters atmosphere = g_xFrame_Atmosphere; float viewHeight = atmosphere.bottomRadius + skyLuminanceSampleHeight; diff --git a/WickedEngine/shaders/skyAtmosphere_skyViewLutCS.hlsl b/WickedEngine/shaders/skyAtmosphere_skyViewLutCS.hlsl index 37fcefe97..959021ad4 100644 --- a/WickedEngine/shaders/skyAtmosphere_skyViewLutCS.hlsl +++ b/WickedEngine/shaders/skyAtmosphere_skyViewLutCS.hlsl @@ -8,7 +8,7 @@ RWTEXTURE2D(output, float4, 0); [numthreads(8, 8, 1)] void main(uint3 DTid : SV_DispatchThreadID) { - AtmosphereParameters atmosphere = GetAtmosphereParameters(); + AtmosphereParameters atmosphere = g_xFrame_Atmosphere; float2 pixelPosition = float2(DTid.xy) + 0.5; float2 uv = pixelPosition * rcp(skyViewLUTRes); diff --git a/WickedEngine/shaders/skyAtmosphere_transmittanceLutCS.hlsl b/WickedEngine/shaders/skyAtmosphere_transmittanceLutCS.hlsl index 963fcc768..67cb40196 100644 --- a/WickedEngine/shaders/skyAtmosphere_transmittanceLutCS.hlsl +++ b/WickedEngine/shaders/skyAtmosphere_transmittanceLutCS.hlsl @@ -9,7 +9,7 @@ RWTEXTURE2D(output, float4, 0); void main(uint3 DTid : SV_DispatchThreadID) { float2 pixelPosition = float2(DTid.xy) + 0.5; - AtmosphereParameters atmosphere = GetAtmosphereParameters(); + AtmosphereParameters atmosphere = g_xFrame_Atmosphere; // Compute camera position from LUT coords const float2 uv = pixelPosition * rcp(transmittanceLUTRes); diff --git a/WickedEngine/shaders/skyHF.hlsli b/WickedEngine/shaders/skyHF.hlsli index 34d76c371..9bab7f4b8 100644 --- a/WickedEngine/shaders/skyHF.hlsli +++ b/WickedEngine/shaders/skyHF.hlsli @@ -8,7 +8,7 @@ float3 AccurateAtmosphericScattering(Texture2D skyViewLutTexture, Texture2D transmittanceLUT, Texture2D multiScatteringLUT, float3 rayOrigin, float3 rayDirection, float3 sunDirection, float sunEnergy, float3 sunColor, bool enableSun, bool darkMode, bool stationary) { - AtmosphereParameters atmosphere = GetAtmosphereParameters(); + AtmosphereParameters atmosphere = g_xFrame_Atmosphere; float3 worldDirection = rayDirection; @@ -244,7 +244,7 @@ float3 GetDynamicSkyColor(in float3 V, bool sun_enabled = true, bool clouds_enab { if (g_xFrame_Options & OPTION_BIT_SIMPLE_SKY) { - return lerp(GetHorizonColor(), GetZenithColor(), saturate(V.y * 0.5f + 0.5f)); + return lerp(GetHorizonColor(), GetZenithColor(), saturate(V.y * 0.5f + 0.5f)) * g_xFrame_SkyExposure; } const float3 sunDirection = GetSunDirection(); @@ -282,6 +282,8 @@ float3 GetDynamicSkyColor(in float3 V, bool sun_enabled = true, bool clouds_enab ); } + sky *= g_xFrame_SkyExposure; + if (clouds_enabled) { CalculateClouds(sky, V, dark_enabled); diff --git a/WickedEngine/shaders/volumetricCloud_renderCS.hlsl b/WickedEngine/shaders/volumetricCloud_renderCS.hlsl index 34b1af1d1..7c23240d8 100644 --- a/WickedEngine/shaders/volumetricCloud_renderCS.hlsl +++ b/WickedEngine/shaders/volumetricCloud_renderCS.hlsl @@ -458,7 +458,7 @@ void RenderClouds(float3 rayOrigin, float3 rayDirection, float t, float steps, f float2 coverageWindOffset = g_CoverageWindSpeed * g_AnimationMultiplier * coverageWindDirection * g_xFrame_Time; - AtmosphereParameters atmosphere = GetAtmosphereParameters(); + AtmosphereParameters atmosphere = g_xFrame_Atmosphere; float3 sunIlluminance = GetSunColor() * GetSunEnergy(); float3 sunDirection = GetSunDirection(); @@ -589,7 +589,7 @@ void main(uint3 DTid : SV_DispatchThreadID) float steps; float stepSize; { - AtmosphereParameters parameters = GetAtmosphereParameters(); + AtmosphereParameters parameters = g_xFrame_Atmosphere; float planetRadius = parameters.bottomRadius * SKY_UNIT_TO_M; float3 planetCenterWorld = parameters.planetCenter * SKY_UNIT_TO_M; diff --git a/WickedEngine/wiArchive.cpp b/WickedEngine/wiArchive.cpp index 42a601752..b80ec6270 100644 --- a/WickedEngine/wiArchive.cpp +++ b/WickedEngine/wiArchive.cpp @@ -4,7 +4,7 @@ #include // this should always be only INCREMENTED and only if a new serialization is implemeted somewhere! -uint64_t __archiveVersion = 65; +uint64_t __archiveVersion = 66; // this is the version number of which below the archive is not compatible with the current version uint64_t __archiveVersionBarrier = 22; diff --git a/WickedEngine/wiRenderer.cpp b/WickedEngine/wiRenderer.cpp index 24e74bed7..7309f89ee 100644 --- a/WickedEngine/wiRenderer.cpp +++ b/WickedEngine/wiRenderer.cpp @@ -3685,6 +3685,7 @@ void UpdatePerFrameData( frameCB.g_xFrame_Fog = float3(vis.scene->weather.fogStart, vis.scene->weather.fogEnd, vis.scene->weather.fogHeight); frameCB.g_xFrame_Horizon = vis.scene->weather.horizon; frameCB.g_xFrame_Zenith = vis.scene->weather.zenith; + frameCB.g_xFrame_SkyExposure = vis.scene->weather.skyExposure; frameCB.g_xFrame_VoxelRadianceMaxDistance = voxelSceneData.maxDistance; frameCB.g_xFrame_VoxelRadianceDataSize = voxelSceneData.voxelsize; frameCB.g_xFrame_VoxelRadianceDataSize_rcp = 1.0f / (float)frameCB.g_xFrame_VoxelRadianceDataSize; @@ -3809,6 +3810,8 @@ void UpdatePerFrameData( { frameCB.g_xFrame_Options |= OPTION_BIT_SHADOW_MASK; } + + frameCB.g_xFrame_Atmosphere = vis.scene->weather.atmosphereParameters; } void UpdateRenderData( const Visibility& vis, diff --git a/WickedEngine/wiScene.h b/WickedEngine/wiScene.h index 0174de2a1..8c4000ee2 100644 --- a/WickedEngine/wiScene.h +++ b/WickedEngine/wiScene.h @@ -1118,6 +1118,7 @@ namespace wiScene XMFLOAT3 sunColor = XMFLOAT3(0, 0, 0); XMFLOAT3 sunDirection = XMFLOAT3(0, 1, 0); float sunEnergy = 0; + float skyExposure = 1; XMFLOAT3 horizon = XMFLOAT3(0.0f, 0.0f, 0.0f); XMFLOAT3 zenith = XMFLOAT3(0.0f, 0.0f, 0.0f); XMFLOAT3 ambient = XMFLOAT3(0.2f, 0.2f, 0.2f); @@ -1133,6 +1134,7 @@ namespace wiScene float windSpeed = 1; wiOcean::OceanParameters oceanParameters; + AtmosphereParameters atmosphereParameters; std::string skyMapName; std::string colorGradingMapName; diff --git a/WickedEngine/wiScene_Serializers.cpp b/WickedEngine/wiScene_Serializers.cpp index 36c61479a..0665a296c 100644 --- a/WickedEngine/wiScene_Serializers.cpp +++ b/WickedEngine/wiScene_Serializers.cpp @@ -971,6 +971,28 @@ namespace wiScene } } + if (archive.GetVersion() >= 66) + { + archive >> skyExposure; + + archive >> atmosphereParameters.bottomRadius; + archive >> atmosphereParameters.topRadius; + archive >> atmosphereParameters.planetCenter; + archive >> atmosphereParameters.rayleighDensityExpScale; + archive >> atmosphereParameters.rayleighScattering; + archive >> atmosphereParameters.mieDensityExpScale; + archive >> atmosphereParameters.mieScattering; + archive >> atmosphereParameters.mieExtinction; + archive >> atmosphereParameters.mieAbsorption; + archive >> atmosphereParameters.absorptionDensity0LayerWidth; + archive >> atmosphereParameters.absorptionDensity0ConstantTerm; + archive >> atmosphereParameters.absorptionDensity0LinearTerm; + archive >> atmosphereParameters.absorptionDensity1ConstantTerm; + archive >> atmosphereParameters.absorptionDensity1LinearTerm; + archive >> atmosphereParameters.absorptionExtinction; + archive >> atmosphereParameters.groundAlbedo; + } + } else { @@ -1019,6 +1041,28 @@ namespace wiScene archive << colorGradingMapName; } + if (archive.GetVersion() >= 66) + { + archive << skyExposure; + + archive << atmosphereParameters.bottomRadius; + archive << atmosphereParameters.topRadius; + archive << atmosphereParameters.planetCenter; + archive << atmosphereParameters.rayleighDensityExpScale; + archive << atmosphereParameters.rayleighScattering; + archive << atmosphereParameters.mieDensityExpScale; + archive << atmosphereParameters.mieScattering; + archive << atmosphereParameters.mieExtinction; + archive << atmosphereParameters.mieAbsorption; + archive << atmosphereParameters.absorptionDensity0LayerWidth; + archive << atmosphereParameters.absorptionDensity0ConstantTerm; + archive << atmosphereParameters.absorptionDensity0LinearTerm; + archive << atmosphereParameters.absorptionDensity1ConstantTerm; + archive << atmosphereParameters.absorptionDensity1LinearTerm; + archive << atmosphereParameters.absorptionExtinction; + archive << atmosphereParameters.groundAlbedo; + } + } } void SoundComponent::Serialize(wiArchive& archive, EntitySerializer& seri) diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index af22c9900..f1c2a3980 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates, breaking compatibility changes const int minor = 56; // minor bug fixes, alterations, refactors, updates - const int revision = 12; + const int revision = 13; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);