Ver código fonte

*Working on light scattering: Added the sun in the scene, and changed the shader and the cpp
*The r::w and r::h are now the renderer's width and height and there is a separate pair for window width and height located in app.*

Panagiotis Christopoulos Charitos 16 anos atrás
pai
commit
bf5910d63f

+ 14 - 0
build/README

@@ -0,0 +1,14 @@
+There are 4 build targets in this folder. There is also a build system that generates GNU makefiles. If you want to generate the makefile for the debug target (for example) do the following:
+
+cd <path to anki>/build/debug
+../genmakefile.py
+
+This will generate a "Makefile". To build just type:
+
+make
+
+And the build will will begin. 
+
+Sometimes I forget to to update all the targets. The debug is allways updated though.
+
+The gen.cfg.py files contain the build options of every target. Their format is pretty straightforward and minimal.

+ 315 - 311
build/release/Makefile

@@ -2,11 +2,11 @@ CXX = gcc
 COMMONFLAGS = -fopenmp
 CFLAGS = $(COMMONFLAGS) -c -pedantic-errors -pedantic -ansi -Wall -Wextra -pipe `sdl-config --cflags` -s -msse3 -O3 -mtune=core2 -fsingle-precision-constant -ffast-math -D_TERMINAL_COLORING__ -D_PLATFORM_LINUX_
 PHFLAGS = $(CFLAGS) 
-LFLAGS = $(COMMONFLAGS) -lGL -lGLU -lGLEW -lSDL_image `sdl-config --static-libs` -ljpeg -lgomp
-EXECUTABLE = AnKi
-INCPATH = -I../../src/math/ -I../../src/tokenizer/ -I../../src/uncategorized/ -I../../src/ -I../../src/renderer/ -I../../src/scene/ -I../../src/resources/ -I../../src/utility/ -I../../src/ui/ 
-SOURCES = ../../src/tokenizer//scanner.cpp ../../src/uncategorized//input.cpp ../../src/uncategorized//skybox.cpp ../../src/uncategorized//particles.cpp ../../src/uncategorized//memory.cpp ../../src/uncategorized//engine_class.cpp ../../src/uncategorized//collision.cpp ../../src/uncategorized//map.cpp ../../src//main.cpp ../../src/renderer//r_ms.cpp ../../src/renderer//r_pps_hdr.cpp ../../src/renderer//r_pps.cpp ../../src/renderer//r_is_shadows.cpp ../../src/renderer//r_bs.cpp ../../src/renderer//r_ms_earlyz.cpp ../../src/renderer//renderer.cpp ../../src/renderer//r_pps_ssao.cpp ../../src/renderer//r_is.cpp ../../src/renderer//r_dbg.cpp ../../src/renderer//r_pps_lscatt.cpp ../../src/renderer//r_bs2.cpp ../../src/scene//mesh_node.cpp ../../src/scene//skel_node.cpp ../../src/scene//skel_anim_controller.cpp ../../src/scene//light.cpp ../../src/scene//skel_model_node.cpp ../../src/scene//controller.cpp ../../src/scene//node.cpp ../../src/scene//camera.cpp ../../src/scene//scene.cpp ../../src/resources//material.cpp ../../src/resources//texture.cpp ../../src/resources//skel_anim.cpp ../../src/resources//extension.cpp ../../src/resources//shader_parser.cpp ../../src/resources//skeleton.cpp ../../src/resources//resource.cpp ../../src/resources//light_props.cpp ../../src/resources//mesh.cpp ../../src/resources//shader_prog.cpp ../../src/utility//app.cpp ../../src/utility//common.cpp ../../src/utility//util.cpp ../../src/ui//ui.cpp 
-OBJECTS = scanner.o input.o skybox.o particles.o memory.o engine_class.o collision.o map.o main.o r_ms.o r_pps_hdr.o r_pps.o r_is_shadows.o r_bs.o r_ms_earlyz.o renderer.o r_pps_ssao.o r_is.o r_dbg.o r_pps_lscatt.o r_bs2.o mesh_node.o skel_node.o skel_anim_controller.o light.o skel_model_node.o controller.o node.o camera.o scene.o material.o texture.o skel_anim.o extension.o shader_parser.o skeleton.o resource.o light_props.o mesh.o shader_prog.o app.o common.o util.o ui.o 
+LFLAGS = $(COMMONFLAGS) -lGL -lGLU -lGLEW -lSDL_image `sdl-config --static-libs` -ljpeg -lgomp -rdynamic
+EXECUTABLE = AnKi.bin
+INCPATH = -I../../src/math/ -I../../src/tokenizer/ -I../../src/uncategorized/ -I../../src/ -I../../src/renderer/ -I../../src/scene/ -I../../src/resources/ -I../../src/utility/ -I../../src/ui/ -I../../src/controllers/ 
+SOURCES = ../../src/tokenizer//scanner.cpp ../../src/uncategorized//input.cpp ../../src/uncategorized//engine_class.cpp ../../src/uncategorized//collision.cpp ../../src/uncategorized//skybox.cpp ../../src/uncategorized//map.cpp ../../src/uncategorized//memory.cpp ../../src/uncategorized//particles.cpp ../../src//main.cpp ../../src/renderer//renderer.cpp ../../src/renderer//r_is_shadows.cpp ../../src/renderer//r_is.cpp ../../src/renderer//r_ms_earlyz.cpp ../../src/renderer//r_pps.cpp ../../src/renderer//r_bs.cpp ../../src/renderer//r_dbg.cpp ../../src/renderer//r_ms.cpp ../../src/renderer//r_pps_lscatt.cpp ../../src/renderer//r_pps_hdr.cpp ../../src/renderer//r_bs2.cpp ../../src/renderer//r_pps_ssao.cpp ../../src/scene//skel_node.cpp ../../src/scene//skel_model_node.cpp ../../src/scene//camera.cpp ../../src/scene//node.cpp ../../src/scene//mesh_node.cpp ../../src/scene//light.cpp ../../src/scene//scene.cpp ../../src/resources//extension.cpp ../../src/resources//shader_prog.cpp ../../src/resources//material.cpp ../../src/resources//mesh.cpp ../../src/resources//skel_anim.cpp ../../src/resources//texture.cpp ../../src/resources//resource.cpp ../../src/resources//skeleton.cpp ../../src/resources//light_props.cpp ../../src/resources//shader_parser.cpp ../../src/utility//app.cpp ../../src/utility//common.cpp ../../src/utility//util.cpp ../../src/ui//ui.cpp ../../src/controllers//skel_anim_ctrl.cpp ../../src/controllers//controller.cpp 
+OBJECTS = scanner.o input.o engine_class.o collision.o skybox.o map.o memory.o particles.o main.o renderer.o r_is_shadows.o r_is.o r_ms_earlyz.o r_pps.o r_bs.o r_dbg.o r_ms.o r_pps_lscatt.o r_pps_hdr.o r_bs2.o r_pps_ssao.o skel_node.o skel_model_node.o camera.o node.o mesh_node.o light.o scene.o extension.o shader_prog.o material.o mesh.o skel_anim.o texture.o resource.o skeleton.o light_props.o shader_parser.o app.o common.o util.o ui.o skel_anim_ctrl.o controller.o 
 PRECOMPILED_HEADERS = 
 
 all: $(PRECOMPILED_HEADERS) $(SOURCES) $(EXECUTABLE)
@@ -43,39 +43,6 @@ input.o: ../../src/uncategorized//input.cpp \
 	@echo Compiling ../../src/uncategorized//input.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//input.cpp -o input.o
 
-skybox.o: ../../src/uncategorized//skybox.cpp \
- ../../src/uncategorized//skybox.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/resources/texture.h \
- ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/resource.h \
- ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
- ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/scene/scene.h \
- ../../src/uncategorized/skybox.h
-	@echo Compiling ../../src/uncategorized//skybox.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//skybox.cpp -o skybox.o
-
-particles.o: ../../src/uncategorized//particles.cpp
-	@echo Compiling ../../src/uncategorized//particles.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//particles.cpp -o particles.o
-
-memory.o: ../../src/uncategorized//memory.cpp \
- ../../src/uncategorized//memory.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h
-	@echo Compiling ../../src/uncategorized//memory.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//memory.cpp -o memory.o
-
 engine_class.o: ../../src/uncategorized//engine_class.cpp \
  ../../src/uncategorized//engine_class.h ../../src/utility/common.h \
  ../../src/uncategorized/memory.h
@@ -102,6 +69,29 @@ collision.o: ../../src/uncategorized//collision.cpp \
 	@echo Compiling ../../src/uncategorized//collision.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//collision.cpp -o collision.o
 
+skybox.o: ../../src/uncategorized//skybox.cpp \
+ ../../src/uncategorized//skybox.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/resources/texture.h \
+ ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h ../../src/resources/resource.h \
+ ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
+ ../../src/scene/camera.h ../../src/uncategorized/collision.h \
+ ../../src/scene/node.h ../../src/scene/scene.h \
+ ../../src/uncategorized/skybox.h
+	@echo Compiling ../../src/uncategorized//skybox.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//skybox.cpp -o skybox.o
+
 map.o: ../../src/uncategorized//map.cpp ../../src/uncategorized//map.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/uncategorized//collision.h ../../src/math/gmath.h \
@@ -124,6 +114,16 @@ map.o: ../../src/uncategorized//map.cpp ../../src/uncategorized//map.h \
 	@echo Compiling ../../src/uncategorized//map.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//map.cpp -o map.o
 
+memory.o: ../../src/uncategorized//memory.cpp \
+ ../../src/uncategorized//memory.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h
+	@echo Compiling ../../src/uncategorized//memory.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//memory.cpp -o memory.o
+
+particles.o: ../../src/uncategorized//particles.cpp
+	@echo Compiling ../../src/uncategorized//particles.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/uncategorized//particles.cpp -o particles.o
+
 main.o: ../../src//main.cpp ../../src/utility/common.h \
  ../../src/uncategorized/memory.h ../../src/uncategorized/input.h \
  ../../src/utility/app.h ../../src/utility/common.h \
@@ -150,37 +150,14 @@ main.o: ../../src//main.cpp ../../src/utility/common.h \
  ../../src/tokenizer/scanner.h ../../src/uncategorized/map.h \
  ../../src/uncategorized/collision.h ../../src/scene/mesh_node.h \
  ../../src/scene/skel_model_node.h ../../src/scene/mesh_node.h \
- ../../src/resources/skel_anim.h ../../src/scene/skel_controller.h \
- ../../src/scene/controller.h ../../src/scene/skel_anim_controller.h \
- ../../src/scene/skel_node.h ../../src/resources/light_props.h
+ ../../src/resources/skel_anim.h ../../src/controllers/mesh_skel_ctrl.h \
+ ../../src/controllers/controller.h \
+ ../../src/controllers/skel_anim_ctrl.h ../../src/scene/skel_node.h \
+ ../../src/controllers/controller.h ../../src/resources/light_props.h
 	@echo Compiling ../../src//main.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src//main.cpp -o main.o
 
-r_ms.o: ../../src/renderer//r_ms.cpp ../../src/renderer//renderer.h \
- ../../src/utility/common.h ../../src/uncategorized/memory.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
- ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/scene/scene.h \
- ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
- ../../src/resources/mesh.h ../../src/renderer/vbo.h \
- ../../src/renderer//r_private.h ../../src/renderer//fbo.h \
- ../../src/resources/material.h ../../src/scene/mesh_node.h
-	@echo Compiling ../../src/renderer//r_ms.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_ms.cpp -o r_ms.o
-
-r_pps_hdr.o: ../../src/renderer//r_pps_hdr.cpp \
+renderer.o: ../../src/renderer//renderer.cpp \
  ../../src/renderer//renderer.h ../../src/utility/common.h \
  ../../src/uncategorized/memory.h ../../src/math/gmath.h \
  ../../src/math/vec2.h ../../src/math/forward_decls.h \
@@ -196,34 +173,11 @@ r_pps_hdr.o: ../../src/renderer//r_pps_hdr.cpp \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/resources/resource.h \
- ../../src/resources/texture.h ../../src/scene/scene.h \
- ../../src/uncategorized/skybox.h ../../src/renderer//r_private.h \
- ../../src/renderer//fbo.h
-	@echo Compiling ../../src/renderer//r_pps_hdr.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_pps_hdr.cpp -o r_pps_hdr.o
-
-r_pps.o: ../../src/renderer//r_pps.cpp ../../src/renderer//renderer.h \
- ../../src/utility/common.h ../../src/uncategorized/memory.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
- ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/resources/resource.h \
- ../../src/resources/texture.h ../../src/renderer//r_private.h \
- ../../src/renderer//fbo.h
-	@echo Compiling ../../src/renderer//r_pps.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_pps.cpp -o r_pps.o
+ ../../src/scene/node.h ../../src/resources/texture.h \
+ ../../src/scene/scene.h ../../src/uncategorized/skybox.h \
+ ../../src/renderer//r_private.h ../../src/utility/app.h
+	@echo Compiling ../../src/renderer//renderer.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//renderer.cpp -o renderer.o
 
 r_is_shadows.o: ../../src/renderer//r_is_shadows.cpp \
  ../../src/renderer//renderer.h ../../src/utility/common.h \
@@ -249,7 +203,7 @@ r_is_shadows.o: ../../src/renderer//r_is_shadows.cpp \
 	@echo Compiling ../../src/renderer//r_is_shadows.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_is_shadows.cpp -o r_is_shadows.o
 
-r_bs.o: ../../src/renderer//r_bs.cpp ../../src/renderer//renderer.h \
+r_is.o: ../../src/renderer//r_is.cpp ../../src/renderer//renderer.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/math/gmath.h ../../src/math/vec2.h \
  ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
@@ -268,11 +222,11 @@ r_bs.o: ../../src/renderer//r_bs.cpp ../../src/renderer//renderer.h \
  ../../src/scene/node.h ../../src/scene/scene.h \
  ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
  ../../src/resources/mesh.h ../../src/renderer/vbo.h \
- ../../src/renderer//r_private.h ../../src/resources/resource.h \
- ../../src/renderer//fbo.h ../../src/scene/mesh_node.h \
- ../../src/resources/material.h
-	@echo Compiling ../../src/renderer//r_bs.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_bs.cpp -o r_bs.o
+ ../../src/scene/light.h ../../src/scene/camera.h \
+ ../../src/resources/resource.h ../../src/renderer//r_private.h \
+ ../../src/renderer//fbo.h ../../src/resources/light_props.h
+	@echo Compiling ../../src/renderer//r_is.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_is.cpp -o r_is.o
 
 r_ms_earlyz.o: ../../src/renderer//r_ms_earlyz.cpp \
  ../../src/renderer//renderer.h ../../src/utility/common.h \
@@ -297,12 +251,12 @@ r_ms_earlyz.o: ../../src/renderer//r_ms_earlyz.cpp \
 	@echo Compiling ../../src/renderer//r_ms_earlyz.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_ms_earlyz.cpp -o r_ms_earlyz.o
 
-renderer.o: ../../src/renderer//renderer.cpp \
- ../../src/renderer//renderer.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/math/gmath.h \
- ../../src/math/vec2.h ../../src/math/forward_decls.h \
- ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
- ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+r_pps.o: ../../src/renderer//r_pps.cpp ../../src/renderer//renderer.h \
+ ../../src/utility/common.h ../../src/uncategorized/memory.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
  ../../src/math/vec4.inl.h ../../src/math/quat.h \
  ../../src/math/quat.inl.h ../../src/math/axisang.h \
  ../../src/math/axisang.inl.h ../../src/math/euler.h \
@@ -313,18 +267,18 @@ renderer.o: ../../src/renderer//renderer.cpp \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/resources/texture.h \
- ../../src/scene/scene.h ../../src/uncategorized/skybox.h \
- ../../src/renderer//r_private.h
-	@echo Compiling ../../src/renderer//renderer.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//renderer.cpp -o renderer.o
+ ../../src/scene/node.h ../../src/resources/resource.h \
+ ../../src/resources/texture.h ../../src/renderer//r_private.h \
+ ../../src/renderer//fbo.h
+	@echo Compiling ../../src/renderer//r_pps.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_pps.cpp -o r_pps.o
 
-r_pps_ssao.o: ../../src/renderer//r_pps_ssao.cpp \
- ../../src/renderer//renderer.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/math/gmath.h \
- ../../src/math/vec2.h ../../src/math/forward_decls.h \
- ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
- ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+r_bs.o: ../../src/renderer//r_bs.cpp ../../src/renderer//renderer.h \
+ ../../src/utility/common.h ../../src/uncategorized/memory.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
  ../../src/math/vec4.inl.h ../../src/math/quat.h \
  ../../src/math/quat.inl.h ../../src/math/axisang.h \
  ../../src/math/axisang.inl.h ../../src/math/euler.h \
@@ -335,14 +289,16 @@ r_pps_ssao.o: ../../src/renderer//r_pps_ssao.cpp \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/resources/resource.h \
- ../../src/resources/texture.h ../../src/scene/scene.h \
- ../../src/uncategorized/skybox.h ../../src/renderer//r_private.h \
- ../../src/renderer//fbo.h
-	@echo Compiling ../../src/renderer//r_pps_ssao.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_pps_ssao.cpp -o r_pps_ssao.o
+ ../../src/scene/node.h ../../src/scene/scene.h \
+ ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
+ ../../src/resources/mesh.h ../../src/renderer/vbo.h \
+ ../../src/renderer//r_private.h ../../src/resources/resource.h \
+ ../../src/renderer//fbo.h ../../src/scene/mesh_node.h \
+ ../../src/resources/material.h
+	@echo Compiling ../../src/renderer//r_bs.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_bs.cpp -o r_bs.o
 
-r_is.o: ../../src/renderer//r_is.cpp ../../src/renderer//renderer.h \
+r_dbg.o: ../../src/renderer//r_dbg.cpp ../../src/renderer//renderer.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/math/gmath.h ../../src/math/vec2.h \
  ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
@@ -358,16 +314,15 @@ r_is.o: ../../src/renderer//r_is.cpp ../../src/renderer//renderer.h \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/scene/scene.h \
+ ../../src/scene/node.h ../../src/renderer//r_private.h \
+ ../../src/renderer//fbo.h ../../src/scene/scene.h \
  ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
- ../../src/resources/mesh.h ../../src/renderer/vbo.h \
- ../../src/scene/light.h ../../src/scene/camera.h \
- ../../src/resources/resource.h ../../src/renderer//r_private.h \
- ../../src/renderer//fbo.h ../../src/resources/light_props.h
-	@echo Compiling ../../src/renderer//r_is.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_is.cpp -o r_is.o
+ ../../src/scene/node.h ../../src/scene/skel_node.h \
+ ../../src/controllers/controller.h
+	@echo Compiling ../../src/renderer//r_dbg.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_dbg.cpp -o r_dbg.o
 
-r_dbg.o: ../../src/renderer//r_dbg.cpp ../../src/renderer//renderer.h \
+r_ms.o: ../../src/renderer//r_ms.cpp ../../src/renderer//renderer.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/math/gmath.h ../../src/math/vec2.h \
  ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
@@ -383,13 +338,13 @@ r_dbg.o: ../../src/renderer//r_dbg.cpp ../../src/renderer//renderer.h \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/renderer//r_private.h \
- ../../src/renderer//fbo.h ../../src/scene/scene.h \
+ ../../src/scene/node.h ../../src/scene/scene.h \
  ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
- ../../src/scene/node.h ../../src/scene/skel_node.h \
- ../../src/scene/controller.h
-	@echo Compiling ../../src/renderer//r_dbg.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_dbg.cpp -o r_dbg.o
+ ../../src/resources/mesh.h ../../src/renderer/vbo.h \
+ ../../src/renderer//r_private.h ../../src/renderer//fbo.h \
+ ../../src/resources/material.h ../../src/scene/mesh_node.h
+	@echo Compiling ../../src/renderer//r_ms.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_ms.cpp -o r_ms.o
 
 r_pps_lscatt.o: ../../src/renderer//r_pps_lscatt.cpp \
  ../../src/renderer//renderer.h ../../src/utility/common.h \
@@ -414,6 +369,29 @@ r_pps_lscatt.o: ../../src/renderer//r_pps_lscatt.cpp \
 	@echo Compiling ../../src/renderer//r_pps_lscatt.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_pps_lscatt.cpp -o r_pps_lscatt.o
 
+r_pps_hdr.o: ../../src/renderer//r_pps_hdr.cpp \
+ ../../src/renderer//renderer.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/math/gmath.h \
+ ../../src/math/vec2.h ../../src/math/forward_decls.h \
+ ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
+ ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
+ ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/scene/camera.h ../../src/uncategorized/collision.h \
+ ../../src/scene/node.h ../../src/resources/resource.h \
+ ../../src/resources/texture.h ../../src/scene/scene.h \
+ ../../src/uncategorized/skybox.h ../../src/renderer//r_private.h \
+ ../../src/renderer//fbo.h
+	@echo Compiling ../../src/renderer//r_pps_hdr.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_pps_hdr.cpp -o r_pps_hdr.o
+
 r_bs2.o: ../../src/renderer//r_bs2.cpp ../../src/renderer//renderer.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/math/gmath.h ../../src/math/vec2.h \
@@ -439,33 +417,31 @@ r_bs2.o: ../../src/renderer//r_bs2.cpp ../../src/renderer//renderer.h \
 	@echo Compiling ../../src/renderer//r_bs2.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_bs2.cpp -o r_bs2.o
 
-mesh_node.o: ../../src/scene//mesh_node.cpp ../../src/scene//mesh_node.h \
- ../../src/utility/common.h ../../src/uncategorized/memory.h \
- ../../src/scene//node.h ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+r_pps_ssao.o: ../../src/renderer//r_pps_ssao.cpp \
+ ../../src/renderer//renderer.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/math/gmath.h \
+ ../../src/math/vec2.h ../../src/math/forward_decls.h \
+ ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
+ ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
  ../../src/math/vec4.inl.h ../../src/math/quat.h \
  ../../src/math/quat.inl.h ../../src/math/axisang.h \
  ../../src/math/axisang.inl.h ../../src/math/euler.h \
  ../../src/math/euler.inl.h ../../src/math/mat3.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/material.h \
+ ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/resources/resource.h ../../src/resources/mesh.h \
- ../../src/renderer/vbo.h ../../src/uncategorized/collision.h \
- ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
- ../../src/scene/camera.h ../../src/scene/node.h \
- ../../src/scene//skel_node.h ../../src/scene//controller.h \
- ../../src/resources/skeleton.h ../../src/scene//skel_controller.h \
- ../../src/scene//skel_anim_controller.h
-	@echo Compiling ../../src/scene//mesh_node.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//mesh_node.cpp -o mesh_node.o
-
-skel_node.o: ../../src/scene//skel_node.cpp ../../src/scene//skel_node.h \
- ../../src/utility/common.h ../../src/uncategorized/memory.h \
+ ../../src/scene/camera.h ../../src/uncategorized/collision.h \
+ ../../src/scene/node.h ../../src/resources/resource.h \
+ ../../src/resources/texture.h ../../src/scene/scene.h \
+ ../../src/uncategorized/skybox.h ../../src/renderer//r_private.h \
+ ../../src/renderer//fbo.h
+	@echo Compiling ../../src/renderer//r_pps_ssao.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_pps_ssao.cpp -o r_pps_ssao.o
+
+skel_node.o: ../../src/scene//skel_node.cpp ../../src/scene//skel_node.h \
+ ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/scene//node.h ../../src/math/gmath.h ../../src/math/vec2.h \
  ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
  ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
@@ -476,61 +452,17 @@ skel_node.o: ../../src/scene//skel_node.cpp ../../src/scene//skel_node.h \
  ../../src/math/euler.inl.h ../../src/math/mat3.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/scene//controller.h \
+ ../../src/math/m_misc.inl.h ../../src/controllers/controller.h \
  ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/scene/camera.h ../../src/uncategorized/collision.h \
  ../../src/scene/node.h ../../src/resources/skel_anim.h \
- ../../src/resources/skeleton.h ../../src/scene//skel_anim_controller.h
+ ../../src/resources/skeleton.h ../../src/controllers/skel_anim_ctrl.h \
+ ../../src/controllers/controller.h
 	@echo Compiling ../../src/scene//skel_node.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//skel_node.cpp -o skel_node.o
 
-skel_anim_controller.o: ../../src/scene//skel_anim_controller.cpp \
- ../../src/scene//skel_anim_controller.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/scene//controller.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/skel_anim.h \
- ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/scene//skel_node.h ../../src/scene//node.h \
- ../../src/resources/skeleton.h ../../src/renderer/renderer.h \
- ../../src/resources/shader_prog.h ../../src/scene/camera.h \
- ../../src/uncategorized/collision.h ../../src/scene/node.h
-	@echo Compiling ../../src/scene//skel_anim_controller.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//skel_anim_controller.cpp -o skel_anim_controller.o
-
-light.o: ../../src/scene//light.cpp ../../src/scene//light.h \
- ../../src/utility/common.h ../../src/uncategorized/memory.h \
- ../../src/resources/texture.h ../../src/resources/resource.h \
- ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
- ../../src/utility/common.h ../../src/scene//node.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/scene//camera.h \
- ../../src/uncategorized/collision.h ../../src/renderer/renderer.h \
- ../../src/resources/shader_prog.h ../../src/scene/camera.h \
- ../../src/resources/light_props.h
-	@echo Compiling ../../src/scene//light.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//light.cpp -o light.o
-
 skel_model_node.o: ../../src/scene//skel_model_node.cpp \
  ../../src/scene//skel_model_node.h ../../src/utility/common.h \
  ../../src/uncategorized/memory.h ../../src/scene//mesh_node.h \
@@ -548,30 +480,31 @@ skel_model_node.o: ../../src/scene//skel_model_node.cpp \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/tokenizer/parser.h ../../src/tokenizer/scanner.h \
- ../../src/scene//skel_node.h ../../src/scene//controller.h \
- ../../src/scene//skel_controller.h
+ ../../src/scene//skel_node.h ../../src/controllers/controller.h \
+ ../../src/controllers/mesh_skel_ctrl.h \
+ ../../src/controllers/controller.h
 	@echo Compiling ../../src/scene//skel_model_node.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//skel_model_node.cpp -o skel_model_node.o
 
-controller.o: ../../src/scene//controller.cpp \
- ../../src/scene//controller.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/scene//scene.h \
- ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
- ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+camera.o: ../../src/scene//camera.cpp ../../src/scene//camera.h \
+ ../../src/utility/common.h ../../src/uncategorized/memory.h \
+ ../../src/uncategorized/collision.h ../../src/math/gmath.h \
+ ../../src/math/vec2.h ../../src/math/forward_decls.h \
+ ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
+ ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
  ../../src/math/vec4.inl.h ../../src/math/quat.h \
  ../../src/math/quat.inl.h ../../src/math/axisang.h \
  ../../src/math/axisang.inl.h ../../src/math/euler.h \
  ../../src/math/euler.inl.h ../../src/math/mat3.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h
-	@echo Compiling ../../src/scene//controller.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//controller.cpp -o controller.o
+ ../../src/math/m_misc.inl.h ../../src/scene//node.h \
+ ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
+ ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/scene/camera.h
+	@echo Compiling ../../src/scene//camera.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//camera.cpp -o camera.o
 
 node.o: ../../src/scene//node.cpp ../../src/scene//node.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
@@ -590,29 +523,57 @@ node.o: ../../src/scene//node.cpp ../../src/scene//node.h \
  ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
  ../../src/utility/common.h ../../src/scene/camera.h \
  ../../src/uncategorized/collision.h ../../src/scene/node.h \
- ../../src/scene//controller.h
+ ../../src/controllers/controller.h
 	@echo Compiling ../../src/scene//node.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//node.cpp -o node.o
 
-camera.o: ../../src/scene//camera.cpp ../../src/scene//camera.h \
+mesh_node.o: ../../src/scene//mesh_node.cpp ../../src/scene//mesh_node.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
- ../../src/uncategorized/collision.h ../../src/math/gmath.h \
- ../../src/math/vec2.h ../../src/math/forward_decls.h \
- ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
- ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/scene//node.h ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
  ../../src/math/vec4.inl.h ../../src/math/quat.h \
  ../../src/math/quat.inl.h ../../src/math/axisang.h \
  ../../src/math/axisang.inl.h ../../src/math/euler.h \
  ../../src/math/euler.inl.h ../../src/math/mat3.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/scene//node.h \
- ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
+ ../../src/math/m_misc.inl.h ../../src/resources/material.h \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/scene/camera.h
-	@echo Compiling ../../src/scene//camera.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//camera.cpp -o camera.o
+ ../../src/resources/resource.h ../../src/resources/mesh.h \
+ ../../src/renderer/vbo.h ../../src/uncategorized/collision.h \
+ ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
+ ../../src/scene/camera.h ../../src/scene/node.h \
+ ../../src/scene//skel_node.h ../../src/controllers/controller.h \
+ ../../src/resources/skeleton.h ../../src/controllers/mesh_skel_ctrl.h \
+ ../../src/controllers/controller.h \
+ ../../src/controllers/skel_anim_ctrl.h
+	@echo Compiling ../../src/scene//mesh_node.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//mesh_node.cpp -o mesh_node.o
+
+light.o: ../../src/scene//light.cpp ../../src/scene//light.h \
+ ../../src/utility/common.h ../../src/uncategorized/memory.h \
+ ../../src/resources/texture.h ../../src/resources/resource.h \
+ ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
+ ../../src/utility/common.h ../../src/scene//node.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h ../../src/scene//camera.h \
+ ../../src/uncategorized/collision.h ../../src/renderer/renderer.h \
+ ../../src/resources/shader_prog.h ../../src/scene/camera.h \
+ ../../src/resources/light_props.h
+	@echo Compiling ../../src/scene//light.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//light.cpp -o light.o
 
 scene.o: ../../src/scene//scene.cpp ../../src/scene//scene.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
@@ -630,13 +591,43 @@ scene.o: ../../src/scene//scene.cpp ../../src/scene//scene.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
  ../../src/math/m_misc.inl.h ../../src/scene//skel_node.h \
- ../../src/scene//node.h ../../src/scene//controller.h \
+ ../../src/scene//node.h ../../src/controllers/controller.h \
  ../../src/scene//camera.h ../../src/uncategorized/collision.h \
  ../../src/scene//mesh_node.h ../../src/resources/material.h \
  ../../src/scene//light.h
 	@echo Compiling ../../src/scene//scene.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//scene.cpp -o scene.o
 
+extension.o: ../../src/resources//extension.cpp \
+ ../../src/resources//extension.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/resources//resource.h \
+ ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
+ ../../src/utility/common.h
+	@echo Compiling ../../src/resources//extension.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//extension.cpp -o extension.o
+
+shader_prog.o: ../../src/resources//shader_prog.cpp \
+ ../../src/resources//shader_prog.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/resources//resource.h \
+ ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
+ ../../src/utility/common.h ../../src/renderer/renderer.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
+ ../../src/scene/camera.h ../../src/uncategorized/collision.h \
+ ../../src/scene/node.h ../../src/resources//shader_parser.h \
+ ../../src/resources//texture.h
+	@echo Compiling ../../src/resources//shader_prog.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//shader_prog.cpp -o shader_prog.o
+
 material.o: ../../src/resources//material.cpp \
  ../../src/resources//material.h ../../src/utility/common.h \
  ../../src/uncategorized/memory.h ../../src/math/gmath.h \
@@ -660,11 +651,8 @@ material.o: ../../src/resources//material.cpp \
 	@echo Compiling ../../src/resources//material.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//material.cpp -o material.o
 
-texture.o: ../../src/resources//texture.cpp \
- ../../src/resources//texture.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/resources//resource.h \
- ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
- ../../src/utility/common.h ../../src/renderer/renderer.h \
+mesh.o: ../../src/resources//mesh.cpp ../../src/resources//mesh.h \
+ ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/math/gmath.h ../../src/math/vec2.h \
  ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
  ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
@@ -675,11 +663,16 @@ texture.o: ../../src/resources//texture.cpp \
  ../../src/math/euler.inl.h ../../src/math/mat3.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
- ../../src/resources/resource.h ../../src/scene/camera.h \
- ../../src/uncategorized/collision.h ../../src/scene/node.h
-	@echo Compiling ../../src/resources//texture.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//texture.cpp -o texture.o
+ ../../src/math/m_misc.inl.h ../../src/renderer/vbo.h \
+ ../../src/resources//resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/uncategorized/collision.h ../../src/renderer/renderer.h \
+ ../../src/resources/shader_prog.h ../../src/resources/resource.h \
+ ../../src/scene/camera.h ../../src/scene/node.h \
+ ../../src/tokenizer/scanner.h ../../src/tokenizer/parser.h \
+ ../../src/tokenizer/scanner.h
+	@echo Compiling ../../src/resources//mesh.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//mesh.cpp -o mesh.o
 
 skel_anim.o: ../../src/resources//skel_anim.cpp \
  ../../src/resources//skel_anim.h ../../src/utility/common.h \
@@ -700,40 +693,26 @@ skel_anim.o: ../../src/resources//skel_anim.cpp \
 	@echo Compiling ../../src/resources//skel_anim.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//skel_anim.cpp -o skel_anim.o
 
-extension.o: ../../src/resources//extension.cpp \
- ../../src/resources//extension.h ../../src/utility/common.h \
+texture.o: ../../src/resources//texture.cpp \
+ ../../src/resources//texture.h ../../src/utility/common.h \
  ../../src/uncategorized/memory.h ../../src/resources//resource.h \
  ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
- ../../src/utility/common.h
-	@echo Compiling ../../src/resources//extension.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//extension.cpp -o extension.o
-
-shader_parser.o: ../../src/resources//shader_parser.cpp \
- ../../src/resources//shader_parser.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/tokenizer/scanner.h \
- ../../src/tokenizer/parser.h ../../src/tokenizer/scanner.h \
- ../../src/utility/util.h ../../src/utility/common.h
-	@echo Compiling ../../src/resources//shader_parser.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//shader_parser.cpp -o shader_parser.o
-
-skeleton.o: ../../src/resources//skeleton.cpp \
- ../../src/resources//skeleton.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/math/gmath.h \
- ../../src/math/vec2.h ../../src/math/forward_decls.h \
- ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
- ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/utility/common.h ../../src/renderer/renderer.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
  ../../src/math/vec4.inl.h ../../src/math/quat.h \
  ../../src/math/quat.inl.h ../../src/math/axisang.h \
  ../../src/math/axisang.inl.h ../../src/math/euler.h \
  ../../src/math/euler.inl.h ../../src/math/mat3.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources//resource.h \
- ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
- ../../src/utility/common.h ../../src/tokenizer/scanner.h \
- ../../src/tokenizer/parser.h ../../src/tokenizer/scanner.h
-	@echo Compiling ../../src/resources//skeleton.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//skeleton.cpp -o skeleton.o
+ ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
+ ../../src/resources/resource.h ../../src/scene/camera.h \
+ ../../src/uncategorized/collision.h ../../src/scene/node.h
+	@echo Compiling ../../src/resources//texture.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//texture.cpp -o texture.o
 
 resource.o: ../../src/resources//resource.cpp \
  ../../src/resources//resource.h ../../src/utility/common.h \
@@ -757,6 +736,25 @@ resource.o: ../../src/resources//resource.cpp \
 	@echo Compiling ../../src/resources//resource.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//resource.cpp -o resource.o
 
+skeleton.o: ../../src/resources//skeleton.cpp \
+ ../../src/resources//skeleton.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/math/gmath.h \
+ ../../src/math/vec2.h ../../src/math/forward_decls.h \
+ ../../src/math/vec2.inl.h ../../src/math/m_dflt_header.h \
+ ../../src/math/vec3.h ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h ../../src/resources//resource.h \
+ ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
+ ../../src/utility/common.h ../../src/tokenizer/scanner.h \
+ ../../src/tokenizer/parser.h ../../src/tokenizer/scanner.h
+	@echo Compiling ../../src/resources//skeleton.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//skeleton.cpp -o skeleton.o
+
 light_props.o: ../../src/resources//light_props.cpp \
  ../../src/resources//light_props.h ../../src/utility/common.h \
  ../../src/uncategorized/memory.h ../../src/resources//resource.h \
@@ -776,50 +774,13 @@ light_props.o: ../../src/resources//light_props.cpp \
 	@echo Compiling ../../src/resources//light_props.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//light_props.cpp -o light_props.o
 
-mesh.o: ../../src/resources//mesh.cpp ../../src/resources//mesh.h \
- ../../src/utility/common.h ../../src/uncategorized/memory.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/renderer/vbo.h \
- ../../src/resources//resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/uncategorized/collision.h ../../src/renderer/renderer.h \
- ../../src/resources/shader_prog.h ../../src/resources/resource.h \
- ../../src/scene/camera.h ../../src/scene/node.h \
- ../../src/tokenizer/scanner.h ../../src/tokenizer/parser.h \
- ../../src/tokenizer/scanner.h
-	@echo Compiling ../../src/resources//mesh.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//mesh.cpp -o mesh.o
-
-shader_prog.o: ../../src/resources//shader_prog.cpp \
- ../../src/resources//shader_prog.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/resources//resource.h \
- ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
- ../../src/utility/common.h ../../src/renderer/renderer.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/shader_prog.h \
- ../../src/scene/camera.h ../../src/uncategorized/collision.h \
- ../../src/scene/node.h ../../src/resources//shader_parser.h \
- ../../src/resources//texture.h
-	@echo Compiling ../../src/resources//shader_prog.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//shader_prog.cpp -o shader_prog.o
+shader_parser.o: ../../src/resources//shader_parser.cpp \
+ ../../src/resources//shader_parser.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/tokenizer/scanner.h \
+ ../../src/tokenizer/parser.h ../../src/tokenizer/scanner.h \
+ ../../src/utility/util.h ../../src/utility/common.h
+	@echo Compiling ../../src/resources//shader_parser.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/resources//shader_parser.cpp -o shader_parser.o
 
 app.o: ../../src/utility//app.cpp ../../src/utility//app.h \
  ../../src/utility//common.h ../../src/uncategorized/memory.h \
@@ -859,6 +820,49 @@ ui.o: ../../src/ui//ui.cpp ../../src/ui//ui.h ../../src/utility/common.h \
 	@echo Compiling ../../src/ui//ui.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/ui//ui.cpp -o ui.o
 
+skel_anim_ctrl.o: ../../src/controllers//skel_anim_ctrl.cpp \
+ ../../src/controllers//skel_anim_ctrl.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/controllers//controller.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h ../../src/resources/skel_anim.h \
+ ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/scene/skel_node.h ../../src/scene/node.h \
+ ../../src/controllers/controller.h ../../src/resources/skeleton.h \
+ ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
+ ../../src/scene/camera.h ../../src/uncategorized/collision.h
+	@echo Compiling ../../src/controllers//skel_anim_ctrl.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/controllers//skel_anim_ctrl.cpp -o skel_anim_ctrl.o
+
+controller.o: ../../src/controllers//controller.cpp \
+ ../../src/controllers//controller.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/scene/scene.h \
+ ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
+ ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h
+	@echo Compiling ../../src/controllers//controller.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/controllers//controller.cpp -o controller.o
+
 clean:
 	rm -f *.o
 	rm -f *.gch

+ 1 - 1
build/release/gen.cfg.py

@@ -1,4 +1,4 @@
-include_paths = [ "../../src/math/", "../../src/tokenizer/", "../../src/uncategorized/", "../../src/", "../../src/renderer/", "../../src/scene/", "../../src/resources/", "../../src/utility/", "../../src/ui/" ]
+include_paths = [ "../../src/math/", "../../src/tokenizer/", "../../src/uncategorized/", "../../src/", "../../src/renderer/", "../../src/scene/", "../../src/resources/", "../../src/utility/", "../../src/ui/", "../../src/controllers/" ]
 executable_name = "AnKi.bin"
 precompiled_headers = []
 compiler = "gcc"

+ 1 - 1
shaders/pps_lscatt.glsl

@@ -10,7 +10,7 @@ float exposure = 2.0;
 float decay = 0.8;
 float density = 1.0;
 float weight = 0.3;
-vec2 light_pos_screen_space = vec2(0.5, 0.5);
+uniform vec2 light_pos_screen_space = vec2(0.5, 0.5);
 
 #pragma anki uniform ms_depth_fai 0
 uniform sampler2D ms_depth_fai;

+ 5 - 2
src/main.cpp

@@ -49,7 +49,7 @@ void Init()
 	srand( unsigned(time(NULL)) );
 	MathSanityChecks();
 
-	app::InitWindow( r::w, r::h, "AnKi Engine" );
+	app::InitWindow();
 	uint ticks = app::GetTicks();
 
 	r::Init();
@@ -193,7 +193,10 @@ int main( int /*argc*/, char* /*argv*/[] )
 		if( i::keys[SDLK_F12] == 1 ) r::TakeScreenshot("gfx/screenshot.jpg");
 
 		/*char str[128];
-		sprintf( str, "capt/%06d.jpg", r::frames_num );
+		if( r::frames_num < 1000 )
+			sprintf( str, "capt/%06d.jpg", r::frames_num );
+		else
+			sprintf( str, "capt2/%06d.jpg", r::frames_num );
 		r::TakeScreenshot(str);*/
 
 		// std stuff follow

+ 1 - 1
src/renderer/r_bs.cpp

@@ -55,7 +55,7 @@ void RunStage( const camera_t& cam )
 {
 	// OGL stuff
 	r::SetProjectionViewMatrices( cam );
-	r::SetViewport( 0, 0, r::w*r::rendering_quality, r::h*r::rendering_quality );
+	r::SetViewport( 0, 0, r::w, r::h );
 
 	glEnable( GL_DEPTH_TEST );
 	glDepthMask( false );

+ 2 - 2
src/renderer/r_bs2.cpp

@@ -57,7 +57,7 @@ void Init2()
 
 	// texture
 	intermid_fbo.SetNumOfColorAttachements(1);
-	fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, GL_RGBA8, GL_RGBA );
+	fai.CreateEmpty2D( r::w, r::h, GL_RGBA8, GL_RGBA );
 	glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fai.GetGLID(), 0 );
 
 	// attach the texes
@@ -80,7 +80,7 @@ void Init2()
 void RunStage2( const camera_t& cam )
 {
 	r::SetProjectionViewMatrices( cam );
-	r::SetViewport( 0, 0, r::w*r::rendering_quality, r::h*r::rendering_quality );
+	r::SetViewport( 0, 0, r::w, r::h );
 
 
 	glDepthMask( false );

+ 51 - 6
src/renderer/r_dbg.cpp

@@ -12,11 +12,11 @@ namespace r {
 namespace dbg {
 
 
-/*
-=======================================================================================================================================
-DATA VARS                                                                                                                             =
-=======================================================================================================================================
-*/
+static void RenderSun();
+
+//=====================================================================================================================================
+// DATA VARS                                                                                                                          =
+//=====================================================================================================================================
 bool show_axis = true;
 bool show_fnormals = false;
 bool show_vnormals = false;
@@ -74,7 +74,7 @@ void RunStage( const camera_t& cam )
 
 	// OGL stuff
 	SetProjectionViewMatrices( cam );
-	SetViewport( 0, 0, r::w*r::rendering_quality, r::h*r::rendering_quality );
+	SetViewport( 0, 0, r::w, r::h );
 
 	glEnable( GL_DEPTH_TEST );
 	glDisable( GL_BLEND );
@@ -99,6 +99,9 @@ void RunStage( const camera_t& cam )
 		}
 	}
 
+	// the sun
+	//RenderSun();
+
 
 	// unbind
 	fbo.Unbind();
@@ -300,4 +303,46 @@ void RenderCube( bool cols, float size )
 }
 
 
+//=====================================================================================================================================
+// RenderSun                                                                                                                          =
+//=====================================================================================================================================
+static void RenderSun()
+{
+	glPushMatrix();
+
+	r::MultMatrix( mat4_t( scene::SunPos(), mat3_t::GetIdentity(), 50.0 ) );
+
+	r::Color3( vec3_t(1.0, 1.0, 0.0) );
+	r::dbg::RenderSphere( 1.0/8.0, 8 );
+
+	glPopMatrix();
+
+
+/*	/////////////////////////////////////////////////////
+	glMatrixMode( GL_PROJECTION );
+	glPushMatrix();
+	glLoadIdentity();
+	glOrtho( 0, 1, 0, 1, -1, 1 );
+	glMatrixMode( GL_MODELVIEW );
+	glPushMatrix();
+	glLoadIdentity();
+
+
+	vec4_t p = vec4_t( scene::SunPos(), 1.0 );
+	p = main_cam->GetProjectionMatrix() * (main_cam->GetViewMatrix() * p);
+	p /= p.w;
+	p = p/2 + 0.5;
+
+	glPointSize( 10 );
+	glBegin( GL_POINTS );
+		r::Color3( vec3_t(0.0,1.0,0.0) );
+		glVertex3fv( &p[0] );
+	glEnd();
+
+	glPopMatrix();
+	glMatrixMode( GL_PROJECTION );
+	glPopMatrix();*/
+}
+
+
 } } // end namespaces

+ 5 - 5
src/renderer/r_is.cpp

@@ -82,8 +82,8 @@ static void DrawSMOUVS( const point_light_t& light )
 /// Calc the view vector that we will use inside the shader to calculate the frag pos in view space
 static void CalcViewVector( const camera_t& cam )
 {
-	int _w = r::w * r::rendering_quality;
-	int _h = r::h * r::rendering_quality;
+	int _w = r::w;
+	int _h = r::h;
 	int pixels[4][2]={ {_w,_h}, {0,_h}, { 0,0 }, {_w,0} }; // from righ up and CC wise to right down, Just like we render the quad
 	int viewport[4]={ 0, 0, _w, _h };
 
@@ -131,14 +131,14 @@ static void InitStageFBO()
 	// init the stencil render buffer
 	glGenRenderbuffers( 1, &stencil_rb );
 	glBindRenderbuffer( GL_RENDERBUFFER, stencil_rb );
-	glRenderbufferStorage( GL_RENDERBUFFER, GL_STENCIL_INDEX, r::w * r::rendering_quality, r::h * r::rendering_quality );
+	glRenderbufferStorage( GL_RENDERBUFFER, GL_STENCIL_INDEX, r::w, r::h );
 	glFramebufferRenderbufferEXT( GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, stencil_rb );
 
 	// inform in what buffers we draw
 	fbo.SetNumOfColorAttachements(1);
 
 	// create the txtrs
-	fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, GL_RGB, GL_RGB );
+	fai.CreateEmpty2D( r::w, r::h, GL_RGB, GL_RGB );
 
 	// attach
 	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, fai.GetGLID(), 0 );
@@ -475,7 +475,7 @@ void RunStage( const camera_t& cam )
 	fbo.Bind();
 
 	// OGL stuff
-	r::SetViewport( 0, 0, r::w*r::rendering_quality, r::h*r::rendering_quality );
+	r::SetViewport( 0, 0, r::w, r::h );
 
 	glMatrixMode( GL_MODELVIEW );
 	glLoadIdentity();

+ 2 - 2
src/renderer/r_is_shadows.cpp

@@ -40,7 +40,7 @@ void Init()
 	fbo.Bind();
 
 	// texture
-	shadow_map.CreateEmpty2D( shadow_resolution * r::rendering_quality, shadow_resolution * r::rendering_quality, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT );
+	shadow_map.CreateEmpty2D( shadow_resolution, shadow_resolution, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT );
 	shadow_map.TexParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 	if( bilinear ) shadow_map.TexParameter( GL_TEXTURE_MAG_FILTER, GL_LINEAR );
 	else           shadow_map.TexParameter( GL_TEXTURE_MAG_FILTER, GL_NEAREST );
@@ -90,7 +90,7 @@ void RunPass( const camera_t& cam )
 
 	glClear( GL_DEPTH_BUFFER_BIT );
 	r::SetProjectionViewMatrices( cam );
-	r::SetViewport( 0, 0, shadow_resolution * r::rendering_quality, shadow_resolution * r::rendering_quality );
+	r::SetViewport( 0, 0, shadow_resolution, shadow_resolution );
 
 	// disable color & blend & enable depth test
 	glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE );

+ 5 - 5
src/renderer/r_ms.cpp

@@ -41,12 +41,12 @@ void Init()
 
 	// create buffers
 	const int internal_format = GL_RGBA16F_ARB;
-	normal_fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, internal_format, GL_RGBA );
-	diffuse_fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, internal_format, GL_RGBA );
-	specular_fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, internal_format, GL_RGBA );
+	normal_fai.CreateEmpty2D( r::w, r::h, internal_format, GL_RGBA );
+	diffuse_fai.CreateEmpty2D( r::w, r::h, internal_format, GL_RGBA );
+	specular_fai.CreateEmpty2D( r::w, r::h, internal_format, GL_RGBA );
 
 	//depth_fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT );
-	depth_fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT );
+	depth_fai.CreateEmpty2D( r::w, r::h, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT );
 	// you could use the above for SSAO but the difference is very little.
 	//depth_fai.TexParameter( GL_TEXTURE_MAG_FILTER, GL_LINEAR );
 	//depth_fai.TexParameter( GL_TEXTURE_MIN_FILTER, GL_LINEAR );
@@ -88,7 +88,7 @@ void RunStage( const camera_t& cam )
 		glClear( GL_DEPTH_BUFFER_BIT );
 	#endif
 	r::SetProjectionViewMatrices( cam );
-	r::SetViewport( 0, 0, r::w * r::rendering_quality, r::h * r::rendering_quality );
+	r::SetViewport( 0, 0, r::w, r::h );
 
 	//glEnable( GL_DEPTH_TEST );
 	scene::skybox.Render( cam.GetViewMatrix().GetRotationPart() );

+ 2 - 2
src/renderer/r_pps.cpp

@@ -49,7 +49,7 @@ void Init()
 	fbo.SetNumOfColorAttachements(1);
 
 	// create the texes
-	fai.CreateEmpty2D( r::w * r::rendering_quality, r::h * r::rendering_quality, GL_RGB, GL_RGB );
+	fai.CreateEmpty2D( r::w, r::h, GL_RGB, GL_RGB );
 
 	// attach
 	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, fai.GetGLID(), 0 );
@@ -113,7 +113,7 @@ void RunStage( const camera_t& cam )
 	glDisable( GL_DEPTH_TEST );
 	glDisable( GL_BLEND );
 
-	r::SetViewport( 0, 0, r::w*r::rendering_quality, r::h*r::rendering_quality );
+	r::SetViewport( 0, 0, r::w, r::h );
 
 	// set shader
 	shdr_post_proc_stage->Bind();

+ 2 - 2
src/renderer/r_pps_hdr.cpp

@@ -72,8 +72,8 @@ Init
 */
 void Init()
 {
-	wwidth = r::rendering_quality * r::pps::hdr::rendering_quality * r::w;
-	wheight = r::rendering_quality * r::pps::hdr::rendering_quality * r::h;
+	wwidth = r::pps::hdr::rendering_quality * r::w;
+	wheight = r::pps::hdr::rendering_quality * r::h;
 
 	InitFBOs( pass0_fbo, pass0_fai, GL_RGB );
 	InitFBOs( pass1_fbo, pass1_fai, GL_RGB );

+ 12 - 5
src/renderer/r_pps_lscatt.cpp

@@ -18,7 +18,7 @@ VARS
 static fbo_t fbo; // yet another FBO
 
 float rendering_quality = 1.0;
-bool enabled = false;
+bool enabled = true;
 
 texture_t fai;
 
@@ -35,8 +35,8 @@ Init
 void Init()
 {
 	if( rendering_quality<0.0 || rendering_quality>1.0 ) ERROR("Incorect r::pps:lscatt::rendering_quality");
-	float wwidth = r::rendering_quality * r::pps::lscatt::rendering_quality * r::w;
-	float wheight = r::rendering_quality * r::pps::lscatt::rendering_quality * r::h;
+	float wwidth = r::pps::lscatt::rendering_quality * r::w;
+	float wheight = r::pps::lscatt::rendering_quality * r::h;
 
 	// create FBO
 	fbo.Create();
@@ -73,11 +73,11 @@ void Init()
 RunPass                                                                                                                               =
 =======================================================================================================================================
 */
-void RunPass( const camera_t& /*cam*/ )
+void RunPass( const camera_t& cam )
 {
 	fbo.Bind();
 
-	r::SetViewport( 0, 0, r::w * r::rendering_quality * rendering_quality, r::h * r::rendering_quality * rendering_quality );
+	r::SetViewport( 0, 0, r::w * rendering_quality, r::h * rendering_quality );
 
 	glDisable( GL_BLEND );
 	glDisable( GL_DEPTH_TEST );
@@ -88,6 +88,13 @@ void RunPass( const camera_t& /*cam*/ )
 	shdr->LocTexUnit( ms_depth_fai_uni_loc, r::ms::depth_fai, 0 );
 	shdr->LocTexUnit( is_fai_uni_loc, r::is::fai, 1 );
 
+	// pass the light
+	vec4_t p = vec4_t( scene::SunPos(), 1.0 );
+	p = cam.GetProjectionMatrix() * (cam.GetViewMatrix() * p);
+	p /= p.w;
+	p = p/2 + 0.5;
+	glUniform2fv( shdr->GetUniformLocation("light_pos_screen_space"), 1, &p[0] );
+
 	// Draw quad
 	r::DrawQuad( shdr->GetAttributeLocation(0) );
 

+ 2 - 2
src/renderer/r_pps_ssao.cpp

@@ -71,8 +71,8 @@ Init
 void Init()
 {
 	if( rendering_quality<0.0 || rendering_quality>1.0 ) ERROR("Incorect r::pps:ssao::rendering_quality");
-	wwidth = r::rendering_quality * r::pps::ssao::rendering_quality * r::w;
-	wheight = r::rendering_quality * r::pps::ssao::rendering_quality * r::h;
+	wwidth = r::pps::ssao::rendering_quality * r::w;
+	wheight = r::pps::ssao::rendering_quality * r::h;
 
 	// create FBO
 	fbo.Create();

+ 13 - 7
src/renderer/renderer.cpp

@@ -6,6 +6,7 @@
 #include "scene.h"
 #include "r_private.h"
 #include "camera.h"
+#include "app.h"
 
 namespace r {
 
@@ -17,14 +18,12 @@ data vars
 */
 
 // misc
-//uint w = 1280, h = 800;
-//uint w = 480, h = 360;
-uint w = 720, h = 480;
+uint w, h;
 uint frames_num = 0;
-float aspect_ratio = (float)w/(float)h;
+float aspect_ratio;
 
 int max_color_atachments = 0;
-float rendering_quality = 1.;
+//float rendering_quality = 1.0;
 int screenshot_jpeg_quality = 90;
 
 static shader_prog_t* shdr_final;
@@ -78,7 +77,7 @@ static void BuildStdShaderPreProcStr()
 	tmp += "#pragma debug(off)\n";
 	tmp += "#define R_W " + FloatToStr(r::w) + "\n";
 	tmp += "#define R_H " + FloatToStr(r::h) + "\n";
-	tmp += "#define R_Q " + FloatToStr(r::rendering_quality) + "\n";
+	//tmp += "#define R_Q " + FloatToStr(r::rendering_quality) + "\n";
 	tmp += "#define SHADOWMAP_SIZE " + IntToStr(r::is::shadows::shadow_resolution) + "\n";
 	if( r::is::shadows::pcf )
 		tmp += "#define _SHADOW_MAPPING_PCF_\n";
@@ -110,6 +109,7 @@ Init
 void Init()
 {
 	PRINT( "Renderer initializing..." );
+
 	glewInit();
 	if( !glewIsSupported("GL_VERSION_2_1") )
 		WARNING( "OpenGL ver 2.1 not supported. The application may crash (and burn)" );
@@ -129,6 +129,10 @@ void Init()
 	if( !glewIsSupported("GL_ARB_vertex_buffer_object") )
 		WARNING( "Vertex Buffer Objects not supported. The application may crash (and burn)" );
 
+	w = app::window_w /* * rendering_quality*/;
+	h = app::window_h /* * rendering_quality*/;
+	aspect_ratio = float(w)/h;
+
 	glClearColor( 0.1, 0.1, 0.1, 0.0 );
 	glClearDepth( 1.0 );
 	glClearStencil( 0 );
@@ -191,7 +195,8 @@ void Render( const camera_t& cam )
 	r::bs::RunStage2( cam );
 	r::dbg::RunStage( cam );
 
-	r::SetViewport( 0, 0, r::w, r::h );
+	//r::SetViewport( 0, 0, app::window_w, app::window_h );
+	r::SetViewport( 0, 0, app::window_w, app::window_h );
 
 	glDisable( GL_DEPTH_TEST );
 	glDisable( GL_BLEND );
@@ -436,6 +441,7 @@ static bool TakeScreenshotJPEG( const char* filename )
 
 	// done
 	free( buffer );
+	fclose( outfile );
 	return true;
 }
 

+ 1 - 1
src/renderer/renderer.h

@@ -19,7 +19,7 @@ namespace r { // begin namespace
 
 extern uint  w; ///< width of the rendering window
 extern uint  h; ///< height of the rendering window
-extern float rendering_quality; ///< The global rendering quality of the raster image. From 0.0(low) to 1.0(high)
+//extern float rendering_quality; ///< The global rendering quality of the raster image. From 0.0(low) to 1.0(high)
 extern uint  frames_num;
 extern float aspect_ratio;
 extern int   screenshot_jpeg_quality; ///< The quality of the JPEG screenshots. From 0 to 100

+ 1 - 0
src/scene/scene.h

@@ -18,6 +18,7 @@ namespace scene {
 // misc
 extern skybox_t skybox;
 inline vec3_t GetAmbientColor() { return vec3_t( 0.1, 0.05, 0.05 )*1; }
+inline vec3_t SunPos() { return vec3_t( 0.0, 1.0, -1.0 ) * 50.0; }
 
 // funcs
 extern void RegisterNode( node_t* node );

+ 3 - 3
src/uncategorized/input.cpp

@@ -86,8 +86,8 @@ void HandleEvents()
 				mouse_pos.x = event_.button.x;
 				mouse_pos.y = event_.button.y;
 
-				mouse_pos_ndc.x = (2.0f * mouse_pos.x) / (float)r::w - 1.0f;
-				mouse_pos_ndc.y = 1.0f - (2.0f * mouse_pos.y) / (float)r::h;
+				mouse_pos_ndc.x = (2.0f * mouse_pos.x) / (float)app::window_w - 1.0f;
+				mouse_pos_ndc.y = 1.0f - (2.0f * mouse_pos.y) / (float)app::window_h;
 
 				if( warp_mouse )
 				{
@@ -95,7 +95,7 @@ void HandleEvents()
 					// ...SDL_WarpMouse function
 					if( mouse_pos_ndc == vec2_t::GetZero() ) break;
 
-					SDL_WarpMouse( r::w/2, r::h/2);
+					SDL_WarpMouse( app::window_w/2, app::window_h/2);
 				}
 
 				mouse_velocity = mouse_pos_ndc - prev_mouse_pos_ndc;

+ 9 - 5
src/utility/app.cpp

@@ -7,6 +7,9 @@ namespace app { // begin of namespace
 static SDL_Surface* main_surf;
 static SDL_Surface* icon_image;
 
+uint window_w = 1280;
+uint window_h = 800;
+
 uint timer_tick = 1000/40; // in ms. 1000/Hz
 static uint time = 0;
 
@@ -19,12 +22,12 @@ uint desktop_h;
 InitWindow                                                                                                                            =
 =======================================================================================================================================
 */
-void InitWindow( int w, int h, const char* window_caption )
+void InitWindow()
 {
 	PRINT( "SDL window initializing..." );
 	SDL_Init( SDL_INIT_VIDEO );
 
-	// get desctop size
+	// get desktop size
 	const SDL_VideoInfo* info = SDL_GetVideoInfo();
 	desktop_w = info->current_w;
 	desktop_h = info->current_h;
@@ -43,12 +46,12 @@ void InitWindow( int w, int h, const char* window_caption )
 	}
 
 	// set GL attribs
-	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 8 ); // WARNING: Set this only in deffered shading
+	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 8 ); // WARNING: Set this only in deferred shading
 	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
 	SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
 
 	// set the surface
-	main_surf = SDL_SetVideoMode( w, h, 24, SDL_HWSURFACE | SDL_OPENGL );
+	main_surf = SDL_SetVideoMode( window_w, window_h, 24, SDL_HWSURFACE | SDL_OPENGL );
 
 	// move the window
 #ifdef WIN32
@@ -61,7 +64,8 @@ void InitWindow( int w, int h, const char* window_caption )
 	}
 #endif
 
-	SDL_WM_SetCaption( window_caption, NULL );
+	SDL_WM_SetCaption( "AnKi Engine", NULL );
+
 
 	PRINT( "SDL window initialization ends" );
 }

+ 4 - 1
src/utility/app.h

@@ -12,7 +12,10 @@ extern uint timer_tick;
 extern uint desktop_w;
 extern uint desktop_h;
 
-extern void InitWindow( int w, int h, const char* window_caption  );
+extern uint window_w;
+extern uint window_h;
+
+extern void InitWindow();
 extern void QuitApp( int code );
 extern void WaitForNextFrame();
 extern void TogleFullScreen();