Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 include/core/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct Config {
float fov{glm::radians(90.0f)}; // Vertical fov in radians
float near{10.0f};
float far{100000.0f};
glm::vec3 sky_color{0.0f};

// camera
CameraController::Type camera_controller_type{CameraController::Type::UNITY};
Expand Down
2 changes: 2 additions & 0 deletions src/core/Serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ nlohmann::json Serializer::serialize(Config const& source) const
target["fov"] = source.fov;
target["near"] = source.near;
target["far"] = source.far;
target["sky_color"] = source.sky_color;
target["camera_controller_type"] = source.camera_controller_type;
target["movement_speed"] = source.movement_speed;
target["rotation_speed"] = source.rotation_speed;
Expand Down Expand Up @@ -129,6 +130,7 @@ Config Serializer::deserialize_config(nlohmann::json& source) const
.fov = source["fov"],
.near = source["near"],
.far = source["far"],
.sky_color = source["sky_color"],
.camera_controller_type = source["camera_controller_type"],
.movement_speed = source["movement_speed"],
.rotation_speed = source["rotation_speed"],
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ void Camera::draw(ViewingMode mode,
shader.use();

glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.id);

auto& sky_color = Project::get_current()->config.sky_color;
glClearColor(sky_color.r, sky_color.g, sky_color.b, 0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

glViewport(0, 0, framebuffer.width, framebuffer.height);

// view/projection transformations
Expand Down
1 change: 1 addition & 0 deletions src/ui/SettingsPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void SettingsPane::render()
ImGui::SeparatorText("Textures");

ImGui::ColorEdit3("Fallback Texture Color", &config.fallback_color[0]);
ImGui::ColorEdit3("Sky Color", &config.sky_color[0]);
}
ImGui::End();
}