Skip to content

Commit

Permalink
Changing project includes' to be local to the project search paths wh…
Browse files Browse the repository at this point in the history
…en they are not part of the standard or external library
  • Loading branch information
rxwp5657 committed Jun 1, 2020
1 parent 846fa83 commit fe85d31
Show file tree
Hide file tree
Showing 47 changed files with 208 additions and 120 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ Without Parallax vs Parallax
To be uploaded ...

## To-Do list:
+ Dynamic Shadow Mapping:
+ Dynamic Variance Shadow Mapping:
+ Gaussian Blur.
+ Implement Percentage-Closer Filtering.
+ Cascade Shadow Mapping.
+ Shadow Bias.
Expand Down
70 changes: 66 additions & 4 deletions include/core/actor.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
//
// actor.hpp
// Nitro
//
// Created by Juan Carlos Sanchez Ruiz de Chavez on 01/06/20.
// Copyright © 2020 Juan Carlos Sanchez Ruiz. All rights reserved.
//

#ifndef ACTOR_H
#define ACTOR_H

#include <string>
#include <vector>
#include <initializer_list>
#include <model.hpp>
#include <mat4.hpp>
#include <shader.hpp>
#include <drawable.hpp>
#include <transforms.hpp>
#include "../graphics/model.hpp"
#include "../graphics/shader.hpp"
#include "../graphics/drawable.hpp"

/*
Basically, an actor is every entity that participates on a scene like a
sphere, trees, soldiers, etc.
Currently, an actor should be capable of appearing on a scene. Thus,
requiring a model that contains all vertex data (vertices, normals,
tangents, bitangents, etc.). However, the actor remains having a "reference"
to a shader as the first attempt of forward rendering was based on the idea
of effects being implemented on self-contained shaders. For example, if an
actor needed to implement parallax occlusion it would need to add the
"parallax-occlusion" reference to the list of shaders so on the rendering pass
the effect would only be applied to those objects that have the "reference" to
the shader.
However, after changing the render path to forward rendering per light the
list of references is not used anymore. On the other hand, until deferred
rendering is implemented or the structure of materials is not revised
(adding control uniforms of wheter or not a special effect should be applied)
the class will keep the list of special efects to be applied.
*/

namespace nitro
{
Expand All @@ -23,11 +52,44 @@ namespace nitro
Actor(const graphics::Model& model,
std::initializer_list<std::string> shaders = {"lighting"});

/*
"Interface" for applying common transforms to the actor's model, this set
of functions will be used when using the GUI for changing the position (Translation),
orientation (Rotation), size (Scaling) and Color of the actor's model.
However, this set of function is still not complete as the following
set of attributes need to be accessible:
+ Material Properties:
- Specular.
- Ambient.
- Shininess.
- Reflectivity.
- Refractivity.
+ Texture Properties:
- Enabling texture.
- Disabling a texture.
- Adding a texure.
- Removing a texure
*/

void Rotate(float x, float y, float z);
void Scale (float x, float y, float z);
void Translate(float x, float y, float z);
void Color(float r, float g, float b);
void Color(float r, float g, float b); // changes diffuse term value

/*
Some models have their texture coordinate systems with the origin
on the upper left corner of the texture image. However, OpenGL
expects the origin to be on the upper left corner, so if an artifact
related to texture mapping appears, you can use this function to toggle
the coordinate system.
(if the origin is on the upper left corer) FlipUV() -> (origin on the lower left corner)
(if the origin is on the lower left corer) FlipUV() -> (origin on the upper left corner)
*/

void FlipUV();

void Erase() override;
Expand Down
6 changes: 3 additions & 3 deletions include/core/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include <vec4.hpp>
#include <mat4.hpp>
#include <lookat.hpp>
#include <drawable.hpp>
#include <shader.hpp>
#include <projections.hpp>
#include <keyboard_evnt.hpp>
#include "../input/keyboard_evnt.hpp"
#include "../graphics/drawable.hpp"
#include "../graphics/shader.hpp"

namespace nitro
{
Expand Down
8 changes: 4 additions & 4 deletions include/core/cube.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

#include <math.h>
#include <vector>
#include <model.hpp>
#include <mesh.hpp>
#include <texture.hpp>
#include <actor.hpp>
#include "../graphics/model.hpp"
#include "../graphics/mesh.hpp"
#include "../graphics/texture.hpp"
#include "./actor.hpp"

namespace nitro
{
Expand Down
14 changes: 8 additions & 6 deletions include/core/directional_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
#include <memory>
#include <GL/glew.h>
#include <GLFW/glfw3.h>

#include <vec4.hpp>
#include <mat4.hpp>
#include <transforms.hpp>
#include <texture.hpp>
#include <constants.hpp>
#include <drawable.hpp>
#include <shader.hpp>
#include <lookat.hpp>
#include <projections.hpp>
#include <actor.hpp>
#include <shadows.hpp>

#include "./actor.hpp"
#include "./shadows.hpp"
#include "./constants.hpp"
#include "../graphics/shader.hpp"
#include "../graphics/drawable.hpp"
#include "../graphics/texture.hpp"

namespace nitro
{
Expand Down
9 changes: 5 additions & 4 deletions include/core/plane.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
#include <math.h>
#include <iostream>
#include <vector>
#include <model.hpp>
#include <mesh.hpp>
#include <texture.hpp>
#include <actor.hpp>

#include "../graphics/model.hpp"
#include "../graphics/mesh.hpp"
#include "../graphics/texture.hpp"
#include "./actor.hpp"

namespace nitro
{
Expand Down
17 changes: 10 additions & 7 deletions include/core/point_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
#define POINT_LIGHT

#include <memory>

#include <GL/glew.h>
#include <GLFW/glfw3.h>

#include <vec4.hpp>
#include <lookat.hpp>
#include <transforms.hpp>
#include <texture.hpp>
#include <shader.hpp>
#include <drawable.hpp>
#include <constants.hpp>
#include <shadows.hpp>
#include <projections.hpp>
#include <lookat.hpp>
#include <actor.hpp>

#include "../graphics/texture.hpp"
#include "../graphics/shader.hpp"
#include "../graphics/drawable.hpp"
#include "./actor.hpp"
#include "./constants.hpp"
#include "./shadows.hpp"


namespace nitro
Expand Down
21 changes: 9 additions & 12 deletions include/core/scene.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#include <vector>
#include <memory>
#include <map>
#include <actor.hpp>
#include <camera.hpp>
#include <skybox.hpp>
#include <shader.hpp>
#include <framebuffer.hpp>
#include <spot_light.hpp>
#include <point_light.hpp>
#include <directional_light.hpp>
#include <debugger.hpp>

#include "./actor.hpp"
#include "./camera.hpp"
#include "./skybox.hpp"
#include "./spot_light.hpp"
#include "./point_light.hpp"
#include "./directional_light.hpp"
#include "../utils/debugger.hpp"
#include "../graphics/shader.hpp"

namespace nitro
{
Expand Down Expand Up @@ -48,11 +48,8 @@ namespace nitro
std::vector<std::shared_ptr<PointLight>> point_lights_;
std::vector<std::shared_ptr<SpotLight>> spot_lights_;
std::vector<std::shared_ptr<DirectionalLight>> dir_lights_;
std::vector<graphics::Texture> gbuffer_textures_;
Camera camera_;
Skybox skybox_;
graphics::Framebuffer gbuffer_;
graphics::Framebuffer shadow_buffer_;
bool update_VBO_;

void DrawActors(const graphics::Shader& shader, bool default_framebuffer = true);
Expand Down
7 changes: 4 additions & 3 deletions include/core/shadows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#define SHADOWS_H

#include <vector>
#include <shader.hpp>
#include <texture.hpp>
#include <actor.hpp>

#include "../graphics/shader.hpp"
#include "../graphics/texture.hpp"
#include "./actor.hpp"

namespace nitro
{
Expand Down
9 changes: 6 additions & 3 deletions include/core/skybox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

#include <vector>
#include <initializer_list>

#include <GL/glew.h>
#include <GLFW/glfw3.h>

#include <vec3.hpp>
#include <actor.hpp>
#include <shader.hpp>
#include <stb_image.hpp>

#include "./actor.hpp"
#include "../graphics/shader.hpp"
#include "../graphics/stb_image.hpp"

namespace nitro
{
Expand Down
9 changes: 5 additions & 4 deletions include/core/sphere.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

#include <math.h>
#include <vector>
#include <model.hpp>
#include <mesh.hpp>
#include <texture.hpp>
#include <actor.hpp>

#include "../graphics/model.hpp"
#include "../graphics/mesh.hpp"
#include "../graphics/texture.hpp"
#include "./actor.hpp"

namespace nitro
{
Expand Down
14 changes: 8 additions & 6 deletions include/core/spot_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
#define SPOT_LIGHT

#include <memory>

#include <vec4.hpp>
#include <mat4.hpp>
#include <transforms.hpp>
#include <texture.hpp>
#include <shader.hpp>
#include <lookat.hpp>
#include <drawable.hpp>
#include <constants.hpp>
#include <projections.hpp>
#include <shadows.hpp>
#include <actor.hpp>

#include "../graphics/drawable.hpp"
#include "../graphics/texture.hpp"
#include "../graphics/shader.hpp"
#include "./constants.hpp"
#include "./shadows.hpp"
#include "./actor.hpp"

namespace nitro
{
Expand Down
5 changes: 3 additions & 2 deletions include/events/bus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#include <iostream>
#include <typeindex>
#include <typeinfo>
#include <event.hpp>
#include <command.hpp>

#include "./event.hpp"
#include "./command.hpp"

namespace nitro
{
Expand Down
2 changes: 1 addition & 1 deletion include/graphics/drawable.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef DRAWABLE_H
#define DRAWABLE_H

#include <shader.hpp>
#include "./shader.hpp"

namespace nitro
{
Expand Down
3 changes: 2 additions & 1 deletion include/graphics/framebuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <texture.hpp>

#include "./texture.hpp"

namespace nitro
{
Expand Down
11 changes: 6 additions & 5 deletions include/graphics/g_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
#include <vector>
#include <map>
#include <memory>
#include <context.hpp>
#include <window.hpp>
#include <shader.hpp>
#include <drawable.hpp>
#include <scene.hpp>

#include "../core/scene.hpp"
#include "./drawable.hpp"
#include "./context.hpp"
#include "./window.hpp"
#include "./shader.hpp"

namespace nitro
{
Expand Down
11 changes: 7 additions & 4 deletions include/graphics/mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@

#include <vector>
#include <string>

#include <GL/glew.h>
#include <GLFW/glfw3.h>

#include <vec3.hpp>
#include <vec2.hpp>
#include <shader.hpp>
#include <drawable.hpp>
#include <texture.hpp>
#include <material.hpp>

#include "./shader.hpp"
#include "./drawable.hpp"
#include "./texture.hpp"
#include "./material.hpp"

namespace nitro
{
Expand Down
Loading

0 comments on commit fe85d31

Please sign in to comment.