Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

220 add renderersettings parameter to control shadow filtering #230

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
186ce69
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
fb6af3c
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
6b2e575
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
45e6347
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
9b13b22
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
bc68cf5
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
9498996
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
a2cdf24
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
a7ab1b8
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
cc51bf5
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
136daca
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
031da0a
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
99cbd55
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
217f287
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
be5858a
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
e0141a2
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
ff0ea38
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
0d01372
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
71828c2
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
ae2c577
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
de7fc28
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
25b5df5
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
4e4d1fc
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
006db0e
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
4e1d7bc
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
9ee8575
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
bf23537
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
7c0f649
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
a51b626
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
9778a6b
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
842f9a2
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
7626259
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
cb5fc74
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
4d3076c
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
d696ec6
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
af9418f
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
7e83d2f
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
17d0b6e
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
b574613
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
7ff3fe4
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
6d431fd
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
e3c3b32
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
ef2c05a
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
ca91619
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
7178d21
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
b841fc3
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
5d0f34c
Implement Settings To Control Rendering (#220)
datacrystals Jun 21, 2022
0de6834
Fix Shadow Issues With Point Lights
datacrystals Jun 22, 2022
706b77d
Fix Shadow Issues With Point Lights
datacrystals Jun 22, 2022
1e5825c
Fix Shadow Issues With Point Lights
datacrystals Jun 22, 2022
5ce0e15
Fix Shadow Issues With Point Lights
datacrystals Jun 22, 2022
df4a5eb
Fix Shadow Issues With Point Lights
datacrystals Jun 22, 2022
92722a1
Fix Shadow Issues With Point Lights
datacrystals Jun 22, 2022
140ee44
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
5312092
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
8180a03
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
7d11a09
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
03d8138
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
a170a87
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
ca74d67
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
2d36ea1
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
ea5c319
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
d6b8e6a
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
bd36193
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
4715517
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
fc82804
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
5085b14
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
6571579
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
249cc14
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
7f09cac
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
7f347bb
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
481a1d0
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
fe85c25
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
a4f384f
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
2e93216
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
15b4805
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
e5b05d0
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
864385e
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
18fa686
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
9107638
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
d93404c
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
4b51b61
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
04369b8
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
e9ce3d7
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
7d5b2a8
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
9be1924
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
5f12f72
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
c50e16b
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
719d43b
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
2cd0b80
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
6358d11
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
971b3bb
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
ac529e5
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
2db44c0
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
df00d2c
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
cf6a5d0
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
e48e612
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
3a77cee
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
67a3df0
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
83d9b55
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
3c46601
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
34e10b7
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
1534459
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
23eda75
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
3a161ef
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
7ffc8a9
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
05dd9e5
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
b048893
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
24a1c36
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
ac44774
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
0657158
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
7aada43
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
f92de92
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
66bf4f9
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
47559af
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
32eca50
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
82d4c98
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
8de577d
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
12abd76
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
2d7a2da
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
f8f59a4
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
7317805
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
ad39f96
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
b7676d3
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
de341d3
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
4bd24cc
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
f5447dd
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
87536f6
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
63dee55
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
af8c3a4
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
85042c0
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
18b64f9
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
53924a5
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
e47c363
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
8d97aa4
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
ec2ba4a
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
0e6c8f8
Implement Settings To Control Rendering (#220)
datacrystals Jun 22, 2022
96e6c0a
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
865ecfd
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
4b1c713
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
3376c91
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
41913a9
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
c1f0704
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
1b7e5b9
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
dd90fc3
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
abfc94f
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
3299f9d
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
6f874b1
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
81480fe
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
1c72caf
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
016d929
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
4f35771
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
9b15acc
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
de757bf
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
a119f8b
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
58e2665
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
8fe01a1
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
f4a1e51
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
ee1ad6a
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
78f431f
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
bb9a67c
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
c247aac
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
c5e231e
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
099b0cd
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
c84b68a
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
ac3f806
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
4cc5fb5
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
621ee9a
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
bd4ed44
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
df1fdf3
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
a9a02ba
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
742ef7c
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
e209d36
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
f7ec09e
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
98e0688
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
2a5be0f
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
1c058df
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
b1b3d28
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
f42f66a
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
d30a0a4
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
de8d044
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
10110db
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
c0f4e53
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
7ba4e9d
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
4178d6f
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
4ff0104
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
d302144
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
d90f7ca
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
6dce252
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
347c5de
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
8ddad8b
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
1b02dd6
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
5189973
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
99dde32
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
fab9833
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
19c713f
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
4f536e3
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
88a43d7
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
0b856c3
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
df6209e
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
ce965ce
Implement Settings To Control Rendering (#220)
datacrystals Jun 23, 2022
3e1d09c
Implement Settings To Control Rendering (#220)
datacrystals Jun 24, 2022
564a23e
Implement Settings To Control Rendering (#220)
datacrystals Jun 24, 2022
8bce88c
Merge branch 'master' into 220-add-renderersettings-parameter-to-cont…
datacrystals Jun 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/Core/Editor/Widgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ target_link_libraries(Widgets
ERS_STRUCT_HardwareInfo
ERS_STRUCT_Scene
ERS_STRUCT_ProjectUtils
ERS_STRUCT_RendererSettings


ERS_SceneManager
Expand Down
34 changes: 33 additions & 1 deletion Source/Core/Editor/Widgets/GUI_Widget_ObjectProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ void Widget_ObjectProperties::Draw() {
ImGui::SameLine();
ImGui::HelpMarker("Sets the distance after which the scene is no longer affected by this light source.");


ImGui::Checkbox("Cast Shadows", &SceneManager_->Scenes_[SceneManager_->ActiveScene_]->PointLights[Index]->CastsShadows_);
ImGui::SameLine();
ImGui::HelpMarker("Allows or disallows this light from creating shadows on the scene.");


}
Expand All @@ -142,6 +144,9 @@ void Widget_ObjectProperties::Draw() {
ImGui::SameLine();
ImGui::HelpMarker("Sets the distance after which the scene is no longer affected by this light source.");

ImGui::Checkbox("Cast Shadows", &SceneManager_->Scenes_[SceneManager_->ActiveScene_]->DirectionalLights[Index]->CastsShadows_);
ImGui::SameLine();
ImGui::HelpMarker("Allows or disallows this light from creating shadows on the scene.");

}

Expand Down Expand Up @@ -179,6 +184,33 @@ void Widget_ObjectProperties::Draw() {
ImGui::SameLine();
ImGui::HelpMarker("Sets the angle at which the outer cone begins to roll off. This angle sets the inner cone which is unaffected by rolloff. Rolloff occurs in the area between the outer and inner cone (this angle).");

ImGui::Checkbox("Cast Shadows", &SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SpotLights[Index]->CastsShadows_);
ImGui::SameLine();
ImGui::HelpMarker("Allows or disallows this light from creating shadows on the scene.");

}

} else if (SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Type_ == std::string("Model")) {

unsigned long Index = SceneManager_->Scenes_[SceneManager_->ActiveScene_]->SceneObjects_[SelectedSceneObject].Index_;
if (ImGui::CollapsingHeader("Model Settings", ImGuiTreeNodeFlags_DefaultOpen)) {

// Get Current Model
ERS_STRUCT_Model* Model = SceneManager_->Scenes_[SceneManager_->ActiveScene_]->Models[Index].get();

ImGui::Checkbox("Casts Dynamic Shadows", &Model->CastDynamicShadows_);
ImGui::SameLine();
ImGui::HelpMarker("Indicates if this model will cast shadows in dynamic lights. Avoid using this whenever possible due to performance related issues.");

ImGui::Checkbox("Casts Static Shadows", &Model->CastStaticShadows_);
ImGui::SameLine();
ImGui::HelpMarker("Indicates if this model will cast shadows in static lights.");

ImGui::Checkbox("Receive Shadows", &Model->ReceiveShadows_);
ImGui::SameLine();
ImGui::HelpMarker("Allow this model to have shadows cast upon it by other objects as well as itself.");


}

}
Expand Down
80 changes: 75 additions & 5 deletions Source/Core/Editor/Widgets/GUI_Widget_RenderingSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,31 @@ Widget_RenderingSettings::Widget_RenderingSettings(ERS_STRUCT_SystemUtils* Syste
SystemUtils_->Logger_->Log("Setting Up Default Renderer Setting Input Fields", 3);

SystemUtils_->Logger_->Log("Copying Shadow Map Resolution", 2);
DepthMapResolution_[0] = SystemUtils_->RendererSettings_->ShadowMapX_;
DepthMapResolution_[1] = SystemUtils_->RendererSettings_->ShadowMapY_;
ERS_STRUCT_RendererSettings* Settings = SystemUtils_->RendererSettings_.get();
DepthMapResolution_[0] = Settings->ShadowMapX_;
DepthMapResolution_[1] = Settings->ShadowMapY_;

if (Settings->ShadowFilteringType_ == ERS::Renderer::ERS_SHADOW_FILTERING_DISABLED) {
SelectedShadowFiltering_ = 0;
} else if (Settings->ShadowFilteringType_ == ERS::Renderer::ERS_SHADOW_FILTERING_PCF) {
SelectedShadowFiltering_ = 1;
} else if (Settings->ShadowFilteringType_ == ERS::Renderer::ERS_SHADOW_FILTERING_POISSON_SAMPLING) {
SelectedShadowFiltering_ = 2;
} else if (Settings->ShadowFilteringType_ == ERS::Renderer::ERS_SHADOW_FILTERING_STRATIFIED_POISSON_SAMPLING) {
SelectedShadowFiltering_ = 3;
}

if (Settings->ShadowUpdateMode_ == ERS::Renderer::ERS_SHADOW_UPDATE_MODE_DISABLED) {
SelectedShadowUpdates_ = 0;
} else if (Settings->ShadowUpdateMode_ == ERS::Renderer::ERS_SHADOW_UPDATE_MODE_RANDOM) {
SelectedShadowUpdates_ = 1;
} else if (Settings->ShadowUpdateMode_ == ERS::Renderer::ERS_SHADOW_UPDATE_MODE_CONSECUTIVE) {
SelectedShadowUpdates_ = 2;
} else if (Settings->ShadowUpdateMode_ == ERS::Renderer::ERS_SHADOW_UPDATE_MODE_DISTANCE_PRIORITIZED) {
SelectedShadowUpdates_ = 3;
} else if (Settings->ShadowUpdateMode_ == ERS::Renderer::ERS_SHADOW_UPDATE_MODE_ALL) {
SelectedShadowUpdates_ = 4;
}


}
Expand Down Expand Up @@ -103,14 +125,62 @@ void Widget_RenderingSettings::Draw() {
ImGui::Separator();
ImGui::Spacing();
bool Apply = false;
ERS_STRUCT_RendererSettings* Settings = SystemUtils_->RendererSettings_.get();

const char* ShadowFilteringNames[] = {
"ERS_SHADOW_FILTERING_DISABLED",
"ERS_SHADOW_FILTERING_PCF",
"ERS_SHADOW_FILTERING_POISSON_SAMPLING",
"ERS_SHADOW_FILTERING_STRATIFIED_POISSON_SAMPLING"
};
const char* ShadowUpdateNames[] = {
"ERS_SHADOW_UPDATE_MODE_DISABLED",
"ERS_SHADOW_UPDATE_MODE_RANDOM",
"ERS_SHADOW_UPDATE_MODE_CONSECUTIVE",
"ERS_SHADOW_UPDATE_MODE_DISTANCE_PRIORITIZED",
"ERS_SHADOW_UPDATE_MODE_ALL"
};




// Draw Buttons/Input Fields
ImGui::InputInt2("Depth Map Resolution", DepthMapResolution_);
Apply = ImGui::Button("Apply");

ImGui::InputInt("Max Shadow Updates Per Frame", &Settings->MaxShadowUpdatesPerFrame_);
ImGui::InputInt("Shadow Filter Kernel Size", &Settings->ShadowFilterKernelSize_);

ImGui::Combo("Shadow Filtering", &SelectedShadowFiltering_, ShadowFilteringNames, 4);
ImGui::Combo("Shadow Update Mode", &SelectedShadowUpdates_, ShadowUpdateNames, 5);

// Handle Apply Button
Apply = ImGui::Button("Apply");
if (Apply) {
SystemUtils_->RendererSettings_->ShadowMapX_ = DepthMapResolution_[0];
SystemUtils_->RendererSettings_->ShadowMapY_ = DepthMapResolution_[1];
Settings->ShadowMapX_ = DepthMapResolution_[0];
Settings->ShadowMapY_ = DepthMapResolution_[1];

if (SelectedShadowFiltering_ == 0) {
Settings->ShadowFilteringType_ = ERS::Renderer::ERS_SHADOW_FILTERING_DISABLED;
} else if (SelectedShadowFiltering_ == 1) {
Settings->ShadowFilteringType_ = ERS::Renderer::ERS_SHADOW_FILTERING_PCF;
} else if (SelectedShadowFiltering_ == 2) {
Settings->ShadowFilteringType_ = ERS::Renderer::ERS_SHADOW_FILTERING_POISSON_SAMPLING;
} else if (SelectedShadowFiltering_ == 3) {
Settings->ShadowFilteringType_ = ERS::Renderer::ERS_SHADOW_FILTERING_STRATIFIED_POISSON_SAMPLING;
}

if (SelectedShadowUpdates_ == 0) {
Settings->ShadowUpdateMode_ = ERS::Renderer::ERS_SHADOW_UPDATE_MODE_DISABLED;
} else if (SelectedShadowUpdates_ == 1) {
Settings->ShadowUpdateMode_ = ERS::Renderer::ERS_SHADOW_UPDATE_MODE_RANDOM;
} else if (SelectedShadowUpdates_ == 2) {
Settings->ShadowUpdateMode_ = ERS::Renderer::ERS_SHADOW_UPDATE_MODE_CONSECUTIVE;
} else if (SelectedShadowUpdates_ == 3) {
Settings->ShadowUpdateMode_ = ERS::Renderer::ERS_SHADOW_UPDATE_MODE_DISTANCE_PRIORITIZED;
} else if (SelectedShadowUpdates_ == 4) {
Settings->ShadowUpdateMode_ = ERS::Renderer::ERS_SHADOW_UPDATE_MODE_ALL;
}

}


Expand Down
9 changes: 7 additions & 2 deletions Source/Core/Editor/Widgets/GUI_Widget_RenderingSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

// Internal Libraries (BG convention: use <> instead of "")
#include <ERS_STRUCT_SystemUtils.h>
#include <ERS_STRUCT_RendererSettings.h>

#include <ERS_ENUM_ShadowFilteringType.h>
#include <ERS_ENUM_ShadowUpdateMode.h>



Expand All @@ -34,11 +38,12 @@ class Widget_RenderingSettings {

// Variables To Store Input Data
int DepthMapResolution_[2]; /**>Stores the value that the user is putting into the depth map input box*/

int SelectedShadowFiltering_ = 0;
int SelectedShadowUpdates_ = 0;

public:

bool Enabled_ = false; /**<Show/Hide Widget*/
bool Enabled_ = true; /**<Show/Hide Widget*/


/**
Expand Down
8 changes: 8 additions & 0 deletions Source/Core/Loader/ERS_ModelLoader/ERS_ModelLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ void ERS_CLASS_ModelLoader::AddModelToLoadingQueue(long AssetID, std::shared_ptr

}


void ERS_CLASS_ModelLoader::ProcessGPU(std::shared_ptr<ERS_STRUCT_Model> Model) {


Expand Down Expand Up @@ -229,6 +230,13 @@ void ERS_CLASS_ModelLoader::ProcessGPU(std::shared_ptr<ERS_STRUCT_Model> Model)

// Process Texture References, Setup Meshes
for (unsigned long i = 0; i < Model->Meshes.size(); i++) {

// Set Shadow Configuration Pointers
Model->Meshes[i].CastDynamicShadows_ = &Model->CastDynamicShadows_;
Model->Meshes[i].CastStaticShadows_ = &Model->CastStaticShadows_;
Model->Meshes[i].ReceiveShadows_ = &Model->ReceiveShadows_;


for (unsigned long Index = 0; Index < Model->Meshes[i].TextureReferences_.size(); Index++) { // IF TEXTURES DONT WORK, CHECK HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

int TextureIndex = Model->Meshes[i].TextureReferences_[Index];
Expand Down
40 changes: 40 additions & 0 deletions Source/Core/Loader/ERS_SceneLoader/ERS_SceneLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ ERS_STRUCT_Scene ERS_CLASS_SceneLoader::ProcessScene(YAML::Node RawSceneData, lo
}


// Load Shadow Configuration
if (SceneDataNode[i]["CastDynamicShadows"]) {
Scene.Models[CurrentSize-1]->CastDynamicShadows_ = SceneDataNode[i]["CastDynamicShadows"].as<bool>();
}

if (SceneDataNode[i]["CastStaticShadows"]) {
Scene.Models[CurrentSize-1]->CastStaticShadows_ = SceneDataNode[i]["CastStaticShadows"].as<bool>();
}

if (SceneDataNode[i]["ReceiveShadows"]) {
Scene.Models[CurrentSize-1]->ReceiveShadows_ = SceneDataNode[i]["ReceiveShadows"].as<bool>();
}


} else if (AssetType == std::string("DirectionalLight")) {

Expand Down Expand Up @@ -149,6 +162,11 @@ ERS_STRUCT_Scene ERS_CLASS_SceneLoader::ProcessScene(YAML::Node RawSceneData, lo
SceneDataNode[i]["RotZ"].as<float>()
);


if (SceneDataNode[i]["CastShadows"]) {
Scene.DirectionalLights[LightIndex]->CastsShadows_ = SceneDataNode[i]["CastShadows"].as<bool>();
}

// Load Attached Scripts
if (SceneDataNode[i]["AttachedScripts"]) {
YAML::Node Scripts = SceneDataNode[i]["AttachedScripts"];
Expand Down Expand Up @@ -186,6 +204,10 @@ ERS_STRUCT_Scene ERS_CLASS_SceneLoader::ProcessScene(YAML::Node RawSceneData, lo
SceneDataNode[i]["PosZ"].as<float>()
);

if (SceneDataNode[i]["CastShadows"]) {
Scene.PointLights[LightIndex]->CastsShadows_ = SceneDataNode[i]["CastShadows"].as<bool>();
}

// Load Attached Scripts
if (SceneDataNode[i]["AttachedScripts"]) {
YAML::Node Scripts = SceneDataNode[i]["AttachedScripts"];
Expand Down Expand Up @@ -234,6 +256,10 @@ ERS_STRUCT_Scene ERS_CLASS_SceneLoader::ProcessScene(YAML::Node RawSceneData, lo
);


if (SceneDataNode[i]["CastShadows"]) {
Scene.SpotLights[LightIndex]->CastsShadows_ = SceneDataNode[i]["CastShadows"].as<bool>();
}

// Load Attached Scripts
if (SceneDataNode[i]["AttachedScripts"]) {
YAML::Node Scripts = SceneDataNode[i]["AttachedScripts"];
Expand Down Expand Up @@ -272,6 +298,20 @@ void ERS_CLASS_SceneLoader::AddModel(ERS_STRUCT_Scene* Scene, long AssetID) {
Scene->Models[CurrentSize-1]->Name = std::string("Loading...");
Scene->Models[CurrentSize-1]->FlipTextures = true;


// Process Texture References, Setup Meshes
ERS_STRUCT_Model* Model = Scene->Models[CurrentSize-1].get();
for (unsigned long i = 0; i < Model->Meshes.size(); i++) {

// Set Shadow Configuration Pointers
Model->Meshes[i].CastDynamicShadows_ = &Model->CastDynamicShadows_;
Model->Meshes[i].CastStaticShadows_ = &Model->CastStaticShadows_;
Model->Meshes[i].ReceiveShadows_ = &Model->ReceiveShadows_;


}


ModelLoader_->AddModelToLoadingQueue(AssetID, Scene->Models[CurrentSize-1], Scene->Models[CurrentSize-1]->FlipTextures);


Expand Down
5 changes: 5 additions & 0 deletions Source/Core/Renderer/ERS_CLASS_VisualRenderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ add_library(ERS_CLASS_VisualRenderer
"ERS_FUNCTION_DrawMeshNoTextures.cpp"
"ERS_FUNCTION_ResetMeshTexture.cpp"
"ERS_FUNCTION_ConvertRotationToFrontVector.cpp"
"ERS_FUNCTION_MeshTransparencySortNoTextures.cpp"



# Add Header Files (.h)
Expand All @@ -42,6 +44,8 @@ add_library(ERS_CLASS_VisualRenderer
"ERS_FUNCTION_DrawMeshNoTextures.h"
"ERS_FUNCTION_ResetMeshTexture.h"
"ERS_FUNCTION_ConvertRotationToFrontVector.h"
"ERS_FUNCTION_MeshTransparencySortNoTextures.h"




Expand Down Expand Up @@ -77,6 +81,7 @@ target_link_libraries(ERS_CLASS_VisualRenderer
ERS_STRUCT_Scene
ERS_STRUCT_ProjectUtils
ERS_STRUCT_OpenGLDefaults
ERS_STRUCT_RendererSettings

)

Expand Down
Loading