Archived
1
Fork 0

Remove unnecessary includes

This commit is contained in:
redstrate 2020-09-20 23:31:03 -04:00
parent 6a5c53f596
commit 29633020c9
22 changed files with 79 additions and 70 deletions

View file

@ -1,10 +1,7 @@
#pragma once
#include <memory>
#include <unordered_map>
#include <array>
#include "file.hpp"
#include <string>
struct ReferenceBlock {
uint64_t references = 0;

View file

@ -1,7 +1,7 @@
#pragma once
#include "renderer.hpp"
#include "assetptr.hpp"
#include "render_options.hpp"
class MaterialNode;

View file

@ -1,5 +1,7 @@
#pragma once
#include <vector>
#include "assetptr.hpp"
#include "object.hpp"
#include "quaternion.hpp"

View file

@ -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;

View file

@ -21,6 +21,7 @@
#include "smaapass.hpp"
#include "gaussianhelper.hpp"
#include "common.hpp"
#include "asset_types.hpp"
class GFX;

View file

@ -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);

View file

@ -7,6 +7,7 @@
#include "uielement.hpp"
#include "file.hpp"
#include "common.hpp"
class GFXBuffer;

View file

@ -2,7 +2,7 @@
#include <string>
#include "asset.hpp"
#include "assetptr.hpp"
enum class MetricType {
Absolute,

View file

@ -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...");

View file

@ -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"];

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -1,6 +1,5 @@
#pragma once
#include <cstddef>
#include <string_view>
#include "pass.hpp"

View 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;

View file

@ -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 {

View file

@ -4,6 +4,7 @@
#include "gfx.hpp"
#include "gfx_commandbuffer.hpp"
#include "engine.hpp"
#include "asset.hpp"
AssetPtr<Texture> aperture_texture;

View file

@ -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);

View file

@ -23,6 +23,7 @@
#include "dofpass.hpp"
#include "frustum.hpp"
#include "shadercompiler.hpp"
#include "asset.hpp"
struct ElementInstance {
Vector4 color;

View file

@ -9,6 +9,7 @@
#include "shadowpass.hpp"
#include "materialcompiler.hpp"
#include "frustum.hpp"
#include "asset.hpp"
struct PushConstant {
Matrix4x4 m, v;

View file

@ -7,6 +7,7 @@
#include <engine.hpp>
#include <map>
#include <file.hpp>
#include <string_utils.hpp>
#include <@APP_INCLUDE@>

View file

@ -18,6 +18,7 @@
#include "debugpass.hpp"
#include "assertions.hpp"
#include "log.hpp"
#include "asset.hpp"
class TransformCommand : public Command {
public: