ocean updates; editor: ocean parameters moved to weather window;

This commit is contained in:
Turanszki Janos
2020-01-28 23:30:23 +00:00
parent 07081ad27e
commit fd8d734860
12 changed files with 199 additions and 247 deletions
+1 -12
View File
@@ -15,7 +15,6 @@
#include "EmitterWindow.h"
#include "HairParticleWindow.h"
#include "ForceFieldWindow.h"
#include "OceanWindow.h"
#include "SoundWindow.h"
#include "ModelImporter.h"
@@ -146,7 +145,6 @@ void EditorComponent::ChangeRenderPath(RENDERPATH path)
emitterWnd.reset(new EmitterWindow(&GetGUI()));
hairWnd.reset(new HairParticleWindow(&GetGUI()));
forceFieldWnd.reset(new ForceFieldWindow(&GetGUI()));
oceanWnd.reset(new OceanWindow(&GetGUI()));
ResizeBuffers();
}
@@ -346,7 +344,7 @@ void EditorComponent::Load()
GetGUI().AddWidget(emitterWnd_Toggle);
wiButton* hairWnd_Toggle = new wiButton("HairParticle");
hairWnd_Toggle->SetTooltip("Emitter Particle System properties");
hairWnd_Toggle->SetTooltip("Hair Particle System properties");
hairWnd_Toggle->SetPos(XMFLOAT2(x, y += step));
hairWnd_Toggle->SetSize(option_size);
hairWnd_Toggle->OnClick([=](wiEventArgs args) {
@@ -363,15 +361,6 @@ void EditorComponent::Load()
});
GetGUI().AddWidget(forceFieldWnd_Toggle);
wiButton* oceanWnd_Toggle = new wiButton("Ocean");
oceanWnd_Toggle->SetTooltip("Ocean Simulator properties");
oceanWnd_Toggle->SetPos(XMFLOAT2(x, y += step));
oceanWnd_Toggle->SetSize(option_size);
oceanWnd_Toggle->OnClick([=](wiEventArgs args) {
oceanWnd->oceanWindow->SetVisible(!oceanWnd->oceanWindow->IsVisible());
});
GetGUI().AddWidget(oceanWnd_Toggle);
////////////////////////////////////////////////////////////////////////////////////
-2
View File
@@ -16,7 +16,6 @@ class AnimationWindow;
class EmitterWindow;
class HairParticleWindow;
class ForceFieldWindow;
class OceanWindow;
class SoundWindow;
class EditorLoadingScreen : public LoadingScreen
@@ -51,7 +50,6 @@ public:
std::unique_ptr<EmitterWindow> emitterWnd;
std::unique_ptr<HairParticleWindow> hairWnd;
std::unique_ptr<ForceFieldWindow> forceFieldWnd;
std::unique_ptr<OceanWindow> oceanWnd;
Editor* main = nullptr;
-2
View File
@@ -180,7 +180,6 @@
<ClInclude Include="MeshWindow.h" />
<ClInclude Include="ModelImporter.h" />
<ClInclude Include="ObjectWindow.h" />
<ClInclude Include="OceanWindow.h" />
<ClInclude Include="PostprocessWindow.h" />
<ClInclude Include="RendererWindow.h" />
<ClInclude Include="Resource.h" />
@@ -209,7 +208,6 @@
<ClCompile Include="ModelImporter_GLTF.cpp" />
<ClCompile Include="ModelImporter_OBJ.cpp" />
<ClCompile Include="ObjectWindow.cpp" />
<ClCompile Include="OceanWindow.cpp" />
<ClCompile Include="PostprocessWindow.cpp" />
<ClCompile Include="RendererWindow.cpp" />
<ClCompile Include="SoundWindow.cpp" />
-6
View File
@@ -64,9 +64,6 @@
<ClInclude Include="ForceFieldWindow.h">
<Filter>Code</Filter>
</ClInclude>
<ClInclude Include="OceanWindow.h">
<Filter>Code</Filter>
</ClInclude>
<ClInclude Include="ModelImporter.h">
<Filter>Code</Filter>
</ClInclude>
@@ -141,9 +138,6 @@
<ClCompile Include="ForceFieldWindow.cpp">
<Filter>Code</Filter>
</ClCompile>
<ClCompile Include="OceanWindow.cpp">
<Filter>Code</Filter>
</ClCompile>
<ClCompile Include="ModelImporter_OBJ.cpp">
<Filter>Code</Filter>
</ClCompile>
-176
View File
@@ -1,176 +0,0 @@
#include "stdafx.h"
#include "OceanWindow.h"
#include "wiScene.h"
using namespace wiScene;
OceanWindow::OceanWindow(wiGUI* gui) :GUI(gui)
{
assert(GUI && "Invalid GUI!");
float screenW = (float)wiRenderer::GetDevice()->GetScreenWidth();
float screenH = (float)wiRenderer::GetDevice()->GetScreenHeight();
oceanWindow = new wiWindow(GUI, "Ocean Window");
oceanWindow->SetSize(XMFLOAT2(700, 380));
GUI->AddWidget(oceanWindow);
float x = 200;
float y = 0;
float inc = 35;
enabledCheckBox = new wiCheckBox("Ocean simulation enabled: ");
enabledCheckBox->SetPos(XMFLOAT2(x, y += inc));
enabledCheckBox->OnClick([&](wiEventArgs args) {
wiRenderer::SetOceanEnabled(args.bValue);
});
enabledCheckBox->SetCheck(wiRenderer::GetOceanEnabled());
oceanWindow->AddWidget(enabledCheckBox);
patchSizeSlider = new wiSlider(1, 1000, 1000, 100000, "Patch size: ");
patchSizeSlider->SetSize(XMFLOAT2(100, 30));
patchSizeSlider->SetPos(XMFLOAT2(x, y += inc));
patchSizeSlider->SetValue(wiScene::GetScene().weather.oceanParameters.patch_length);
patchSizeSlider->SetTooltip("Adjust water tiling patch size");
patchSizeSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.patch_length = args.fValue;
wiRenderer::SetOceanEnabled(enabledCheckBox->GetCheck());
}
});
oceanWindow->AddWidget(patchSizeSlider);
waveAmplitudeSlider = new wiSlider(0, 1000, 1000, 100000, "Wave amplitude: ");
waveAmplitudeSlider->SetSize(XMFLOAT2(100, 30));
waveAmplitudeSlider->SetPos(XMFLOAT2(x, y += inc));
waveAmplitudeSlider->SetValue(wiScene::GetScene().weather.oceanParameters.wave_amplitude);
waveAmplitudeSlider->SetTooltip("Adjust wave size");
waveAmplitudeSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.wave_amplitude = args.fValue;
wiRenderer::SetOceanEnabled(enabledCheckBox->GetCheck());
}
});
oceanWindow->AddWidget(waveAmplitudeSlider);
choppyScaleSlider = new wiSlider(0, 10, 1000, 100000, "Choppiness: ");
choppyScaleSlider->SetSize(XMFLOAT2(100, 30));
choppyScaleSlider->SetPos(XMFLOAT2(x, y += inc));
choppyScaleSlider->SetValue(wiScene::GetScene().weather.oceanParameters.choppy_scale);
choppyScaleSlider->SetTooltip("Adjust wave choppiness");
choppyScaleSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.choppy_scale = args.fValue;
wiRenderer::SetOceanEnabled(enabledCheckBox->GetCheck());
}
});
oceanWindow->AddWidget(choppyScaleSlider);
windDependencySlider = new wiSlider(0, 1, 1000, 100000, "Wind dependency: ");
windDependencySlider->SetSize(XMFLOAT2(100, 30));
windDependencySlider->SetPos(XMFLOAT2(x, y += inc));
windDependencySlider->SetValue(wiScene::GetScene().weather.oceanParameters.wind_dependency);
windDependencySlider->SetTooltip("Adjust wind contribution");
windDependencySlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.wind_dependency = args.fValue;
wiRenderer::SetOceanEnabled(enabledCheckBox->GetCheck());
}
});
oceanWindow->AddWidget(windDependencySlider);
timeScaleSlider = new wiSlider(0, 4, 1000, 100000, "Time scale: ");
timeScaleSlider->SetSize(XMFLOAT2(100, 30));
timeScaleSlider->SetPos(XMFLOAT2(x, y += inc));
timeScaleSlider->SetValue(wiScene::GetScene().weather.oceanParameters.time_scale);
timeScaleSlider->SetTooltip("Adjust simulation speed");
timeScaleSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.time_scale = args.fValue;
wiRenderer::SetOceanEnabled(enabledCheckBox->GetCheck());
}
});
oceanWindow->AddWidget(timeScaleSlider);
heightSlider = new wiSlider(-100, 100, 0, 100000, "Water level: ");
heightSlider->SetSize(XMFLOAT2(100, 30));
heightSlider->SetPos(XMFLOAT2(x, y += inc));
heightSlider->SetValue(0);
heightSlider->SetTooltip("Adjust water level");
heightSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.waterHeight = args.fValue;
}
});
oceanWindow->AddWidget(heightSlider);
detailSlider = new wiSlider(1, 10, 0, 9, "Surface Detail: ");
detailSlider->SetSize(XMFLOAT2(100, 30));
detailSlider->SetPos(XMFLOAT2(x, y += inc));
detailSlider->SetValue(4);
detailSlider->SetTooltip("Adjust surface tessellation resolution. High values can decrease performance.");
detailSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.surfaceDetail = (uint32_t)args.iValue;
}
});
oceanWindow->AddWidget(detailSlider);
toleranceSlider = new wiSlider(1, 10, 0, 1000, "Displacement Tolerance: ");
toleranceSlider->SetSize(XMFLOAT2(100, 30));
toleranceSlider->SetPos(XMFLOAT2(x, y += inc));
toleranceSlider->SetValue(2);
toleranceSlider->SetTooltip("Big waves can introduce glitches on screen borders, this can fix that but surface detail will decrease.");
toleranceSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.surfaceDisplacementTolerance = args.fValue;
}
});
oceanWindow->AddWidget(toleranceSlider);
colorPicker = new wiColorPicker(GUI, "Water Color");
colorPicker->SetPos(XMFLOAT2(380, 30));
colorPicker->RemoveWidgets();
colorPicker->SetVisible(true);
colorPicker->SetEnabled(true);
colorPicker->OnColorChanged([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.waterColor = args.color.toFloat3();
}
});
oceanWindow->AddWidget(colorPicker);
oceanWindow->Translate(XMFLOAT3(screenW - 820, 50, 0));
oceanWindow->SetVisible(false);
}
OceanWindow::~OceanWindow()
{
oceanWindow->RemoveWidgets(true);
GUI->RemoveWidget(oceanWindow);
SAFE_DELETE(oceanWindow);
}
-30
View File
@@ -1,30 +0,0 @@
#pragma once
class wiGUI;
class wiWindow;
class wiLabel;
class wiCheckBox;
class wiSlider;
class wiColorPicker;
class OceanWindow
{
public:
OceanWindow(wiGUI* gui);
~OceanWindow();
wiGUI* GUI;
wiWindow* oceanWindow;
wiCheckBox* enabledCheckBox;
wiSlider* patchSizeSlider;
wiSlider* waveAmplitudeSlider;
wiSlider* choppyScaleSlider;
wiSlider* windDependencySlider;
wiSlider* timeScaleSlider;
wiSlider* heightSlider;
wiSlider* detailSlider;
wiSlider* toleranceSlider;
wiColorPicker* colorPicker;
};
+169 -1
View File
@@ -17,7 +17,7 @@ WeatherWindow::WeatherWindow(wiGUI* gui) : GUI(gui)
weatherWindow = new wiWindow(GUI, "Weather Window");
weatherWindow->SetSize(XMFLOAT2(760, 820));
weatherWindow->SetSize(XMFLOAT2(1000, 820));
GUI->AddWidget(weatherWindow);
float x = 200;
@@ -280,6 +280,162 @@ WeatherWindow::WeatherWindow(wiGUI* gui) : GUI(gui)
});
weatherWindow->AddWidget(zenithColorPicker);
x = 840;
y = 20;
// Ocean params:
ocean_enabledCheckBox = new wiCheckBox("Ocean simulation enabled: ");
ocean_enabledCheckBox->SetPos(XMFLOAT2(x + 100, y += step));
ocean_enabledCheckBox->OnClick([&](wiEventArgs args) {
auto& weather = GetWeather();
weather.SetOceanEnabled(args.bValue);
});
weatherWindow->AddWidget(ocean_enabledCheckBox);
ocean_patchSizeSlider = new wiSlider(1, 1000, 1000, 100000, "Patch size: ");
ocean_patchSizeSlider->SetSize(XMFLOAT2(100, 30));
ocean_patchSizeSlider->SetPos(XMFLOAT2(x, y += step));
ocean_patchSizeSlider->SetValue(wiScene::GetScene().weather.oceanParameters.patch_length);
ocean_patchSizeSlider->SetTooltip("Adjust water tiling patch size");
ocean_patchSizeSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.patch_length = args.fValue;
}
});
weatherWindow->AddWidget(ocean_patchSizeSlider);
ocean_waveAmplitudeSlider = new wiSlider(0, 1000, 1000, 100000, "Wave amplitude: ");
ocean_waveAmplitudeSlider->SetSize(XMFLOAT2(100, 30));
ocean_waveAmplitudeSlider->SetPos(XMFLOAT2(x, y += step));
ocean_waveAmplitudeSlider->SetValue(wiScene::GetScene().weather.oceanParameters.wave_amplitude);
ocean_waveAmplitudeSlider->SetTooltip("Adjust wave size");
ocean_waveAmplitudeSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.wave_amplitude = args.fValue;
}
});
weatherWindow->AddWidget(ocean_waveAmplitudeSlider);
ocean_choppyScaleSlider = new wiSlider(0, 10, 1000, 100000, "Choppiness: ");
ocean_choppyScaleSlider->SetSize(XMFLOAT2(100, 30));
ocean_choppyScaleSlider->SetPos(XMFLOAT2(x, y += step));
ocean_choppyScaleSlider->SetValue(wiScene::GetScene().weather.oceanParameters.choppy_scale);
ocean_choppyScaleSlider->SetTooltip("Adjust wave choppiness");
ocean_choppyScaleSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.choppy_scale = args.fValue;
}
});
weatherWindow->AddWidget(ocean_choppyScaleSlider);
ocean_windDependencySlider = new wiSlider(0, 1, 1000, 100000, "Wind dependency: ");
ocean_windDependencySlider->SetSize(XMFLOAT2(100, 30));
ocean_windDependencySlider->SetPos(XMFLOAT2(x, y += step));
ocean_windDependencySlider->SetValue(wiScene::GetScene().weather.oceanParameters.wind_dependency);
ocean_windDependencySlider->SetTooltip("Adjust wind contribution");
ocean_windDependencySlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.wind_dependency = args.fValue;
}
});
weatherWindow->AddWidget(ocean_windDependencySlider);
ocean_timeScaleSlider = new wiSlider(0, 4, 1000, 100000, "Time scale: ");
ocean_timeScaleSlider->SetSize(XMFLOAT2(100, 30));
ocean_timeScaleSlider->SetPos(XMFLOAT2(x, y += step));
ocean_timeScaleSlider->SetValue(wiScene::GetScene().weather.oceanParameters.time_scale);
ocean_timeScaleSlider->SetTooltip("Adjust simulation speed");
ocean_timeScaleSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.time_scale = args.fValue;
}
});
weatherWindow->AddWidget(ocean_timeScaleSlider);
ocean_heightSlider = new wiSlider(-100, 100, 0, 100000, "Water level: ");
ocean_heightSlider->SetSize(XMFLOAT2(100, 30));
ocean_heightSlider->SetPos(XMFLOAT2(x, y += step));
ocean_heightSlider->SetValue(0);
ocean_heightSlider->SetTooltip("Adjust water level");
ocean_heightSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.waterHeight = args.fValue;
}
});
weatherWindow->AddWidget(ocean_heightSlider);
ocean_detailSlider = new wiSlider(1, 10, 0, 9, "Surface Detail: ");
ocean_detailSlider->SetSize(XMFLOAT2(100, 30));
ocean_detailSlider->SetPos(XMFLOAT2(x, y += step));
ocean_detailSlider->SetValue(4);
ocean_detailSlider->SetTooltip("Adjust surface tessellation resolution. High values can decrease performance.");
ocean_detailSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.surfaceDetail = (uint32_t)args.iValue;
}
});
weatherWindow->AddWidget(ocean_detailSlider);
ocean_toleranceSlider = new wiSlider(1, 10, 0, 1000, "Displacement Tolerance: ");
ocean_toleranceSlider->SetSize(XMFLOAT2(100, 30));
ocean_toleranceSlider->SetPos(XMFLOAT2(x, y += step));
ocean_toleranceSlider->SetValue(2);
ocean_toleranceSlider->SetTooltip("Big waves can introduce glitches on screen borders, this can fix that but surface detail will decrease.");
ocean_toleranceSlider->OnSlide([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.surfaceDisplacementTolerance = args.fValue;
}
});
weatherWindow->AddWidget(ocean_toleranceSlider);
ocean_colorPicker = new wiColorPicker(GUI, "Water Color");
ocean_colorPicker->SetPos(XMFLOAT2(x - 160, y += step));
ocean_colorPicker->RemoveWidgets();
ocean_colorPicker->SetVisible(true);
ocean_colorPicker->SetEnabled(true);
ocean_colorPicker->OnColorChanged([&](wiEventArgs args) {
if (wiScene::GetScene().weathers.GetCount() > 0)
{
WeatherComponent& weather = wiScene::GetScene().weathers[0];
weather.oceanParameters.waterColor = args.color.toFloat3();
}
});
weatherWindow->AddWidget(ocean_colorPicker);
step += ocean_colorPicker->GetScale().y;
ocean_resetButton = new wiButton("Reset Ocean to default");
ocean_resetButton->SetTooltip("Reset ocean to default values.");
ocean_resetButton->SetSize(XMFLOAT2(240, 30));
ocean_resetButton->SetPos(XMFLOAT2(x - 100, y += step));
ocean_resetButton->OnClick([=](wiEventArgs args) {
auto& weather = GetWeather();
weather.oceanParameters = WeatherComponent::OceanParameters();
});
weatherWindow->AddWidget(ocean_resetButton);
weatherWindow->Translate(XMFLOAT3(130, 30, 0));
weatherWindow->SetVisible(false);
}
@@ -310,6 +466,18 @@ void WeatherWindow::Update()
ambientColorPicker->SetPickColor(wiColor::fromFloat3(weather.ambient));
horizonColorPicker->SetPickColor(wiColor::fromFloat3(weather.horizon));
zenithColorPicker->SetPickColor(wiColor::fromFloat3(weather.zenith));
ocean_enabledCheckBox->SetCheck(weather.IsOceanEnabled());
ocean_patchSizeSlider->SetValue(weather.oceanParameters.patch_length);
ocean_waveAmplitudeSlider->SetValue(weather.oceanParameters.wave_amplitude);
ocean_choppyScaleSlider->SetValue(weather.oceanParameters.choppy_scale);
ocean_windDependencySlider->SetValue(weather.oceanParameters.wind_dependency);
ocean_timeScaleSlider->SetValue(weather.oceanParameters.time_scale);
ocean_heightSlider->SetValue(weather.oceanParameters.waterHeight);
ocean_detailSlider->SetValue((float)weather.oceanParameters.surfaceDetail);
ocean_toleranceSlider->SetValue(weather.oceanParameters.surfaceDisplacementTolerance);
ocean_colorPicker->SetPickColor(wiColor::fromFloat3(weather.oceanParameters.waterColor));
}
}
+13
View File
@@ -34,5 +34,18 @@ public:
wiColorPicker* ambientColorPicker;
wiColorPicker* horizonColorPicker;
wiColorPicker* zenithColorPicker;
// ocean params:
wiCheckBox* ocean_enabledCheckBox;
wiSlider* ocean_patchSizeSlider;
wiSlider* ocean_waveAmplitudeSlider;
wiSlider* ocean_choppyScaleSlider;
wiSlider* ocean_windDependencySlider;
wiSlider* ocean_timeScaleSlider;
wiSlider* ocean_heightSlider;
wiSlider* ocean_detailSlider;
wiSlider* ocean_toleranceSlider;
wiColorPicker* ocean_colorPicker;
wiButton* ocean_resetButton;
};
+11 -15
View File
@@ -3739,11 +3739,20 @@ void UpdatePerFrameData(float dt, uint32_t layerMask)
// Ocean will override any current reflectors
waterPlane = scene.waterPlane;
if (ocean != nullptr)
if (scene.weather.IsOceanEnabled())
{
requestReflectionRendering = true;
XMVECTOR _refPlane = XMPlaneFromPointNormal(XMVectorSet(0, scene.weather.oceanParameters.waterHeight, 0, 0), XMVectorSet(0, 1, 0, 0));
XMStoreFloat4(&waterPlane, _refPlane);
if (ocean == nullptr)
{
ocean = std::make_unique<wiOcean>(scene.weather);
}
}
else if (ocean != nullptr)
{
ocean.reset();
}
if (GetTemporalAAEnabled())
@@ -4192,7 +4201,7 @@ void UpdateRenderData(CommandList cmd)
}
// Compute water simulation:
if (ocean != nullptr)
if (scene.weather.IsOceanEnabled() && ocean != nullptr)
{
ocean->UpdateDisplacementMap(scene.weather, renderTime, cmd);
}
@@ -10054,19 +10063,6 @@ bool GetAdvancedRefractionsEnabled() { return advancedRefractions; }
bool IsRequestedReflectionRendering() { return requestReflectionRendering; }
void SetGameSpeed(float value) { GameSpeed = std::max(0.0f, value); }
float GetGameSpeed() { return GameSpeed; }
void SetOceanEnabled(bool enabled)
{
if (enabled)
{
const Scene& scene = GetScene();
ocean.reset(new wiOcean(scene.weather));
}
else
{
ocean.reset();
}
}
bool GetOceanEnabled() { return ocean != nullptr; }
void InvalidateBVH() { scene_bvh_invalid = true; }
void SetRaytraceBounceCount(uint32_t bounces)
{
-2
View File
@@ -452,8 +452,6 @@ namespace wiRenderer
const XMFLOAT4& GetWaterPlane();
void SetGameSpeed(float value);
float GetGameSpeed();
void SetOceanEnabled(bool enabled);
bool GetOceanEnabled();
void InvalidateBVH(); // invalidates scene bvh so if something wants to use it, it will recompute and validate it
void SetRaytraceBounceCount(uint32_t bounces);
uint32_t GetRaytraceBounceCount();
+4
View File
@@ -904,9 +904,13 @@ namespace wiScene
enum FLAGS
{
EMPTY = 0,
OCEAN_ENABLED = 1 << 0
};
uint32_t _flags = EMPTY;
inline bool IsOceanEnabled() const { return _flags & OCEAN_ENABLED; }
inline void SetOceanEnabled(bool value = true) { if (value) { _flags |= OCEAN_ENABLED; } else { _flags &= ~OCEAN_ENABLED; } }
XMFLOAT3 sunColor = XMFLOAT3(0, 0, 0);
XMFLOAT3 sunDirection = XMFLOAT3(0, 1, 0);
XMFLOAT3 horizon = XMFLOAT3(0.0f, 0.0f, 0.0f);
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 36;
// minor bug fixes, alterations, refactors, updates
const int revision = 48;
const int revision = 49;
long GetVersion()