diff --git a/engine/asset/include/assetptr.hpp b/engine/asset/include/assetptr.hpp index 8824e6e..f533055 100644 --- a/engine/asset/include/assetptr.hpp +++ b/engine/asset/include/assetptr.hpp @@ -1,10 +1,7 @@ #pragma once #include -#include -#include - -#include "file.hpp" +#include struct ReferenceBlock { uint64_t references = 0; diff --git a/engine/asset/include/material_nodes.hpp b/engine/asset/include/material_nodes.hpp index e7d58d9..a3f31c1 100644 --- a/engine/asset/include/material_nodes.hpp +++ b/engine/asset/include/material_nodes.hpp @@ -1,7 +1,7 @@ #pragma once -#include "renderer.hpp" #include "assetptr.hpp" +#include "render_options.hpp" class MaterialNode; diff --git a/engine/core/include/components.hpp b/engine/core/include/components.hpp index e49aced..385f870 100755 --- a/engine/core/include/components.hpp +++ b/engine/core/include/components.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include "assetptr.hpp" #include "object.hpp" #include "quaternion.hpp" diff --git a/engine/core/include/cutscene.hpp b/engine/core/include/cutscene.hpp index 89516ec..5ff3a89 100755 --- a/engine/core/include/cutscene.hpp +++ b/engine/core/include/cutscene.hpp @@ -4,6 +4,7 @@ #include "vector.hpp" #include "quaternion.hpp" +#include "math.hpp" struct PositionKeyFrame { float time; @@ -24,6 +25,8 @@ struct ScaleKeyFrame { Vector3 value; }; +struct Bone; + struct AnimationChannel { std::string id; diff --git a/engine/core/include/engine.hpp b/engine/core/include/engine.hpp index 11600ca..8440c91 100755 --- a/engine/core/include/engine.hpp +++ b/engine/core/include/engine.hpp @@ -21,6 +21,7 @@ #include "smaapass.hpp" #include "gaussianhelper.hpp" #include "common.hpp" +#include "asset_types.hpp" class GFX; diff --git a/engine/core/include/scene.hpp b/engine/core/include/scene.hpp index ecc002e..0350723 100755 --- a/engine/core/include/scene.hpp +++ b/engine/core/include/scene.hpp @@ -1,22 +1,11 @@ #pragma once -#include -#include -#include -#include +#include +#include -#include - -#include "vector.hpp" -#include "matrix.hpp" -#include "quaternion.hpp" -#include "utility.hpp" -#include "transform.hpp" #include "object.hpp" -#include "asset.hpp" #include "components.hpp" -#include "aabb.hpp" -#include "plane.hpp" +#include "utility.hpp" template using Pool = std::unordered_map; @@ -208,6 +197,7 @@ const int max_point_shadows = 4; const int max_environment_probes = 4; class GFXFramebuffer; +class GFXTexture; /// Represents a scene consisting of Objects with varying Components. class Scene : public ObjectComponents { @@ -259,10 +249,7 @@ public: @param target The position to be centered in the camera's view. @note Although this is a look at function, it applies no special attribute to the camera and simply changes it's position and rotation. */ -inline void camera_look_at(Scene& scene, Object cam, Vector3 pos, Vector3 target) { - scene.get(cam).position = pos; - scene.get(cam).rotation = transform::quat_look_at(pos, target, Vector3(0, 1, 0)); -} +void camera_look_at(Scene& scene, Object cam, Vector3 pos, Vector3 target); Object load_object(Scene& scene, const nlohmann::json obj); nlohmann::json save_object(Object obj); diff --git a/engine/core/include/screen.hpp b/engine/core/include/screen.hpp index 47ed384..3bf21fd 100755 --- a/engine/core/include/screen.hpp +++ b/engine/core/include/screen.hpp @@ -7,6 +7,7 @@ #include "uielement.hpp" #include "file.hpp" +#include "common.hpp" class GFXBuffer; diff --git a/engine/core/include/uielement.hpp b/engine/core/include/uielement.hpp index 4bbde25..f26c39c 100755 --- a/engine/core/include/uielement.hpp +++ b/engine/core/include/uielement.hpp @@ -2,7 +2,7 @@ #include -#include "asset.hpp" +#include "assetptr.hpp" enum class MetricType { Absolute, diff --git a/engine/core/src/engine.cpp b/engine/core/src/engine.cpp index f2c4ca1..a2023d3 100755 --- a/engine/core/src/engine.cpp +++ b/engine/core/src/engine.cpp @@ -17,6 +17,7 @@ #include "debug.hpp" #include "assertions.hpp" #include "console.hpp" +#include "asset.hpp" Engine::Engine(const int argc, char* argv[]) { console::info(System::Core, "Prism Engine loading..."); diff --git a/engine/core/src/scene.cpp b/engine/core/src/scene.cpp index 4570150..11eb7be 100755 --- a/engine/core/src/scene.cpp +++ b/engine/core/src/scene.cpp @@ -3,6 +3,13 @@ #include "json_conversions.hpp" #include "file.hpp" #include "engine.hpp" +#include "transform.hpp" +#include "asset.hpp" + +void camera_look_at(Scene& scene, Object cam, Vector3 pos, Vector3 target) { + scene.get(cam).position = pos; + scene.get(cam).rotation = transform::quat_look_at(pos, target, Vector3(0, 1, 0)); +} void load_transform_component(nlohmann::json j, Transform& t) { t.position = j["position"]; diff --git a/engine/core/src/screen.cpp b/engine/core/src/screen.cpp index ed5874f..8354805 100755 --- a/engine/core/src/screen.cpp +++ b/engine/core/src/screen.cpp @@ -10,6 +10,7 @@ #include "string_utils.hpp" #include "log.hpp" #include "assertions.hpp" +#include "uielement.hpp" void ui::Screen::calculate_sizes() { unsigned int numChildren = 0; diff --git a/engine/renderer/CMakeLists.txt b/engine/renderer/CMakeLists.txt index d320051..c978305 100755 --- a/engine/renderer/CMakeLists.txt +++ b/engine/renderer/CMakeLists.txt @@ -10,6 +10,7 @@ set(SRC include/materialcompiler.hpp include/dofpass.hpp include/frustum.hpp + include/render_options.hpp src/renderer.cpp src/gaussianhelper.cpp diff --git a/engine/renderer/include/frustum.hpp b/engine/renderer/include/frustum.hpp index 1729cbe..e11de64 100755 --- a/engine/renderer/include/frustum.hpp +++ b/engine/renderer/include/frustum.hpp @@ -2,11 +2,12 @@ #include -#include "plane.hpp" -#include "components.hpp" +#include "frustum.hpp" #include "matrix.hpp" +#include "vector.hpp" +#include "components.hpp" #include "aabb.hpp" -#include "object.hpp" +#include "plane.hpp" #include "asset_types.hpp" class Scene; diff --git a/engine/renderer/include/imguipass.hpp b/engine/renderer/include/imguipass.hpp index 4c1d351..6ccc7b4 100755 --- a/engine/renderer/include/imguipass.hpp +++ b/engine/renderer/include/imguipass.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include #include "pass.hpp" diff --git a/engine/renderer/include/render_options.hpp b/engine/renderer/include/render_options.hpp new file mode 100755 index 0000000..6572507 --- /dev/null +++ b/engine/renderer/include/render_options.hpp @@ -0,0 +1,43 @@ +#pragma once + +constexpr int brdf_resolution = 512; + +constexpr bool default_enable_aa = true; + +enum class ShadowFilter { + None, + PCF, + PCSS +}; + +#if defined(PLATFORM_TVOS) || defined(PLATFORM_IOS) +constexpr bool default_enable_ibl = false; +constexpr bool default_enable_normal_mapping = false; +constexpr bool default_enable_point_shadows = false; +constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCF; +constexpr int default_shadow_resolution = 1024; +#else +constexpr bool default_enable_ibl = true; +constexpr bool default_enable_normal_mapping = true; +constexpr bool default_enable_point_shadows = true; +constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCSS; +constexpr int default_shadow_resolution = 2048; +#endif + +struct RenderOptions { + bool dynamic_resolution = false; + double render_scale = 1.0f; + + int shadow_resolution = default_shadow_resolution; + + bool enable_aa = default_enable_aa; + bool enable_ibl = default_enable_ibl; + bool enable_normal_mapping = default_enable_normal_mapping; + bool enable_normal_shadowing = default_enable_normal_mapping; + bool enable_point_shadows = default_enable_point_shadows; + ShadowFilter shadow_filter = default_shadow_filter; + bool enable_extra_passes = true; + bool enable_frustum_culling = true; +}; + +inline RenderOptions render_options; diff --git a/engine/renderer/include/renderer.hpp b/engine/renderer/include/renderer.hpp index 4999017..5a71f40 100755 --- a/engine/renderer/include/renderer.hpp +++ b/engine/renderer/include/renderer.hpp @@ -10,6 +10,7 @@ #include "object.hpp" #include "dofpass.hpp" #include "common.hpp" +#include "render_options.hpp" namespace ui { class Screen; @@ -39,48 +40,6 @@ struct RenderScreenOptions { Matrix4x4 mvp; }; -constexpr int brdf_resolution = 512; - -constexpr bool default_enable_aa = true; - -enum class ShadowFilter { - None, - PCF, - PCSS -}; - -#if defined(PLATFORM_TVOS) || defined(PLATFORM_IOS) -constexpr bool default_enable_ibl = false; -constexpr bool default_enable_normal_mapping = false; -constexpr bool default_enable_point_shadows = false; -constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCF; -constexpr int default_shadow_resolution = 1024; -#else -constexpr bool default_enable_ibl = true; -constexpr bool default_enable_normal_mapping = true; -constexpr bool default_enable_point_shadows = true; -constexpr ShadowFilter default_shadow_filter = ShadowFilter::PCSS; -constexpr int default_shadow_resolution = 2048; -#endif - -struct RenderOptions { - bool dynamic_resolution = false; - double render_scale = 1.0f; - - int shadow_resolution = default_shadow_resolution; - - bool enable_aa = default_enable_aa; - bool enable_ibl = default_enable_ibl; - bool enable_normal_mapping = default_enable_normal_mapping; - bool enable_normal_shadowing = default_enable_normal_mapping; - bool enable_point_shadows = default_enable_point_shadows; - ShadowFilter shadow_filter = default_shadow_filter; - bool enable_extra_passes = true; - bool enable_frustum_culling = true; -}; - -inline RenderOptions render_options; - class Material; class Renderer { diff --git a/engine/renderer/src/dofpass.cpp b/engine/renderer/src/dofpass.cpp index e6e7052..250e64f 100755 --- a/engine/renderer/src/dofpass.cpp +++ b/engine/renderer/src/dofpass.cpp @@ -4,6 +4,7 @@ #include "gfx.hpp" #include "gfx_commandbuffer.hpp" #include "engine.hpp" +#include "asset.hpp" AssetPtr aperture_texture; diff --git a/engine/renderer/src/materialcompiler.cpp b/engine/renderer/src/materialcompiler.cpp index 40a4dbf..82af5dc 100755 --- a/engine/renderer/src/materialcompiler.cpp +++ b/engine/renderer/src/materialcompiler.cpp @@ -5,6 +5,7 @@ #include "engine.hpp" #include "string_utils.hpp" #include "shadercompiler.hpp" +#include "material_nodes.hpp" ShaderSource get_shader(std::string filename, bool skinned, bool cubemap) { auto shader_file = file::open(file::internal_domain / filename); diff --git a/engine/renderer/src/renderer.cpp b/engine/renderer/src/renderer.cpp index cbd5bc6..231966d 100755 --- a/engine/renderer/src/renderer.cpp +++ b/engine/renderer/src/renderer.cpp @@ -23,6 +23,7 @@ #include "dofpass.hpp" #include "frustum.hpp" #include "shadercompiler.hpp" +#include "asset.hpp" struct ElementInstance { Vector4 color; diff --git a/engine/renderer/src/scenecapture.cpp b/engine/renderer/src/scenecapture.cpp index fbde94d..51a358b 100755 --- a/engine/renderer/src/scenecapture.cpp +++ b/engine/renderer/src/scenecapture.cpp @@ -9,6 +9,7 @@ #include "shadowpass.hpp" #include "materialcompiler.hpp" #include "frustum.hpp" +#include "asset.hpp" struct PushConstant { Matrix4x4 m, v; diff --git a/platforms/mac/main.mm.in b/platforms/mac/main.mm.in index 4e342c3..238428f 100755 --- a/platforms/mac/main.mm.in +++ b/platforms/mac/main.mm.in @@ -7,6 +7,7 @@ #include #include #include +#include #include <@APP_INCLUDE@> diff --git a/tools/common/include/commoneditor.hpp b/tools/common/include/commoneditor.hpp index 7736028..7017645 100755 --- a/tools/common/include/commoneditor.hpp +++ b/tools/common/include/commoneditor.hpp @@ -18,6 +18,7 @@ #include "debugpass.hpp" #include "assertions.hpp" #include "log.hpp" +#include "asset.hpp" class TransformCommand : public Command { public: