Remove unnecessary includes
This commit is contained in:
parent
6a5c53f596
commit
29633020c9
22 changed files with 79 additions and 70 deletions
|
@ -1,10 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <array>
|
||||
|
||||
#include "file.hpp"
|
||||
#include <string>
|
||||
|
||||
struct ReferenceBlock {
|
||||
uint64_t references = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "renderer.hpp"
|
||||
#include "assetptr.hpp"
|
||||
#include "render_options.hpp"
|
||||
|
||||
class MaterialNode;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "assetptr.hpp"
|
||||
#include "object.hpp"
|
||||
#include "quaternion.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;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "smaapass.hpp"
|
||||
#include "gaussianhelper.hpp"
|
||||
#include "common.hpp"
|
||||
#include "asset_types.hpp"
|
||||
|
||||
class GFX;
|
||||
|
||||
|
|
|
@ -1,22 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
#include <nlohmann/json_fwd.hpp>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#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<class Component>
|
||||
using Pool = std::unordered_map<Object, Component>;
|
||||
|
@ -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<Data, Transform, Renderable, Light, Camera, Collision, Rigidbody, UI, EnvironmentProbe> {
|
||||
|
@ -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<Transform>(cam).position = pos;
|
||||
scene.get<Transform>(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);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "uielement.hpp"
|
||||
#include "file.hpp"
|
||||
#include "common.hpp"
|
||||
|
||||
class GFXBuffer;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "asset.hpp"
|
||||
#include "assetptr.hpp"
|
||||
|
||||
enum class MetricType {
|
||||
Absolute,
|
||||
|
|
|
@ -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...");
|
||||
|
|
|
@ -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<Transform>(cam).position = pos;
|
||||
scene.get<Transform>(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"];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
#include <array>
|
||||
|
||||
#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;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <string_view>
|
||||
|
||||
#include "pass.hpp"
|
||||
|
|
43
engine/renderer/include/render_options.hpp
Executable file
43
engine/renderer/include/render_options.hpp
Executable file
|
@ -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;
|
|
@ -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 {
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "gfx.hpp"
|
||||
#include "gfx_commandbuffer.hpp"
|
||||
#include "engine.hpp"
|
||||
#include "asset.hpp"
|
||||
|
||||
AssetPtr<Texture> aperture_texture;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "dofpass.hpp"
|
||||
#include "frustum.hpp"
|
||||
#include "shadercompiler.hpp"
|
||||
#include "asset.hpp"
|
||||
|
||||
struct ElementInstance {
|
||||
Vector4 color;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "shadowpass.hpp"
|
||||
#include "materialcompiler.hpp"
|
||||
#include "frustum.hpp"
|
||||
#include "asset.hpp"
|
||||
|
||||
struct PushConstant {
|
||||
Matrix4x4 m, v;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <engine.hpp>
|
||||
#include <map>
|
||||
#include <file.hpp>
|
||||
#include <string_utils.hpp>
|
||||
|
||||
#include <@APP_INCLUDE@>
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "debugpass.hpp"
|
||||
#include "assertions.hpp"
|
||||
#include "log.hpp"
|
||||
#include "asset.hpp"
|
||||
|
||||
class TransformCommand : public Command {
|
||||
public:
|
||||
|
|
Reference in a new issue