ソースを参照

- The stencil masking optimizations are in a new file with GL 3
- Improving the debug stage

Panagiotis Christopoulos Charitos 15 年 前
コミット
8bb2274f2f

ファイルの差分が大きいため隠しています
+ 897 - 310
.cproject


+ 2 - 2
.project

@@ -23,11 +23,11 @@
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildArguments</key>
-					<value>make -j3</value>
+					<value>-j2</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildCommand</key>
-					<value>nice</value>
+					<value>make</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildLocation</key>

+ 79 - 28
build/debug/Makefile

@@ -37,7 +37,8 @@ collision.o: ../../src/Misc//collision.cpp ../../src/Misc//collision.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Util/App.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
  ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
  ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
@@ -81,7 +82,8 @@ skybox.o: ../../src/Misc//skybox.cpp ../../src/Misc//skybox.h \
  ../../src/Math/MathFuncs.inl.h ../../src/Math/Transform.h \
  ../../src/Math/Transform.inl.h ../../src/Resources/Resource.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
- ../../src/Resources/ShaderProg.h ../../src/Scene/Camera.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Scene/Camera.h \
  ../../src/Misc/collision.h ../../src/Scene/SceneNode.h \
  ../../src/Scene/Scene.h ../../src/Misc/skybox.h \
  ../../src/Physics/PhyWorld.h ../../src/Physics/PhyCommon.h \
@@ -345,10 +347,11 @@ Main.o: ../../src//Main.cpp ../../src/Util/Common.h \
  ../../src/Misc/collision.h ../../src/Scene/SceneNode.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
- ../../src/Util/Util.h ../../src/Resources/ShaderProg.h ../../src/Ui/Ui.h \
+ ../../src/Util/Util.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Ui/Ui.h \
  ../../src/Util/App.h ../../src/Misc/particles.h \
- ../../src/Resources/Mesh.h ../../src/Renderer/BufferObjects/Vbo.h \
- ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Scene/Light.h \
+ ../../src/Resources/Mesh.h ../../src/Scene/Light.h \
  ../../src/Scene/Camera.h ../../src/Resources/Material.h \
  ../../src/Resources/ShaderProg.h ../../src/Resources/Resource.h \
  ../../src/Scene/Scene.h ../../src/Misc/skybox.h \
@@ -519,7 +522,8 @@ Ez.o: ../../src/Renderer//Ez.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Util/App.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
  ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
  ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
@@ -685,7 +689,23 @@ Ez.o: ../../src/Renderer//Ez.cpp ../../src/Renderer//Renderer.h \
 	@echo Compiling ../../src/Renderer//Ez.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer//Ez.cpp -o Ez.o
 
-Smo.o: ../../src/Renderer//Smo.cpp
+Smo.o: ../../src/Renderer//Smo.cpp ../../src/Renderer//Renderer.h \
+ ../../src/Util/Common.h ../../src/Misc/memory.h ../../src/Math/Math.h \
+ ../../src/Math/Vec2.h ../../src/Math/MathForwardDecls.h \
+ ../../src/Math/Vec2.inl.h ../../src/Math/MathDfltHeader.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/MathFuncs.h \
+ ../../src/Math/MathFuncs.inl.h ../../src/Math/Transform.h \
+ ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
+ ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
+ ../../src/Util/Util.h ../../src/Util/Common.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Renderer//Smo.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer//Smo.cpp -o Smo.o
 
@@ -704,7 +724,8 @@ Dbg.o: ../../src/Renderer//Dbg.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Util/App.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
  ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
  ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
@@ -885,7 +906,8 @@ Sm.o: ../../src/Renderer//Sm.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Util/App.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
  ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
  ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
@@ -1066,7 +1088,8 @@ Hdr.o: ../../src/Renderer//Hdr.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Renderer//Hdr.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer//Hdr.cpp -o Hdr.o
 
@@ -1085,7 +1108,8 @@ Ssao.o: ../../src/Renderer//Ssao.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Scene/Camera.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Scene/Camera.h \
  ../../src/Misc/collision.h ../../src/Scene/SceneNode.h
 	@echo Compiling ../../src/Renderer//Ssao.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer//Ssao.cpp -o Ssao.o
@@ -1105,7 +1129,8 @@ Ms.o: ../../src/Renderer//Ms.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Util/App.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
  ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
  ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
@@ -1287,7 +1312,8 @@ Pps.o: ../../src/Renderer//Pps.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Renderer//Pps.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer//Pps.cpp -o Pps.o
 
@@ -1308,7 +1334,8 @@ MainRenderer.o: ../../src/Renderer//MainRenderer.cpp \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Util/App.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
  ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
  ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
@@ -1352,7 +1379,8 @@ Is.o: ../../src/Renderer//Is.cpp ../../src/Renderer//Renderer.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Scene/Camera.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Scene/Camera.h \
  ../../src/Misc/collision.h ../../src/Scene/SceneNode.h \
  ../../src/Scene/Light.h ../../src/Scene/Camera.h \
  ../../src/Resources/LightProps.h ../../src/Util/App.h \
@@ -1535,7 +1563,8 @@ Renderer.o: ../../src/Renderer//Renderer.cpp \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Scene/Camera.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Scene/Camera.h \
  ../../src/Misc/collision.h ../../src/Scene/SceneNode.h \
  ../../src/Renderer//RendererInitializer.h ../../src/Resources/Material.h \
  ../../src/Resources/ShaderProg.h
@@ -1586,7 +1615,9 @@ SkelNode.o: ../../src/Scene//SkelNode.cpp ../../src/Scene//SkelNode.h \
  ../../../SDL-hg/include/SDL_revision.h \
  ../../../SDL-hg/include/SDL_compat.h ../../src/Renderer/MainRenderer.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
- ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h
+ ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Scene//SkelNode.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Scene//SkelNode.cpp -o SkelNode.o
 
@@ -1632,7 +1663,8 @@ Light.o: ../../src/Scene//Light.cpp ../../src/Scene//Light.h \
  ../../../SDL-hg/include/SDL_revision.h \
  ../../../SDL-hg/include/SDL_compat.h ../../src/Renderer/MainRenderer.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
- ../../src/Resources/ShaderProg.h
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Scene//Light.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Scene//Light.cpp -o Light.o
 
@@ -1891,8 +1923,10 @@ Camera.o: ../../src/Scene//Camera.cpp ../../src/Scene//Camera.h \
  ../../src/Renderer/BufferObjects/Fbo.h ../../src/Resources/Texture.h \
  ../../src/Resources/Resource.h ../../src/Util/Util.h \
  ../../src/Util/Common.h ../../src/Resources/ShaderProg.h \
- ../../src/Util/App.h ../../../SDL-hg/include/SDL.h \
- ../../../SDL-hg/include/SDL_main.h ../../../SDL-hg/include/SDL_stdinc.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
+ ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
+ ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
  ../../../SDL-hg/include/SDL_platform.h \
  ../../../SDL-hg/include/begin_code.h \
@@ -1934,6 +1968,8 @@ SceneNode.o: ../../src/Scene//SceneNode.cpp ../../src/Scene//SceneNode.h \
  ../../src/Renderer/BufferObjects/Fbo.h ../../src/Resources/Texture.h \
  ../../src/Resources/Resource.h ../../src/Util/Util.h \
  ../../src/Util/Common.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h \
  ../../src/Misc/collision.h ../../src/Scene/Controllers/Controller.h \
  ../../src/Scene//Scene.h ../../src/Misc/skybox.h \
  ../../src/Physics/PhyWorld.h ../../src/Physics/PhyCommon.h \
@@ -2254,8 +2290,10 @@ ParticleEmitter.o: ../../src/Scene//ParticleEmitter.cpp \
  ../../src/Physics/PhyWorld.h ../../src/Renderer/MainRenderer.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h \
- ../../src/Util/App.h ../../../SDL-hg/include/SDL.h \
- ../../../SDL-hg/include/SDL_main.h ../../../SDL-hg/include/SDL_stdinc.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
+ ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
+ ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
  ../../../SDL-hg/include/SDL_platform.h \
  ../../../SDL-hg/include/begin_code.h \
@@ -2298,7 +2336,8 @@ Ui.o: ../../src/Ui//Ui.cpp ../../src/Ui//Ui.h ../../src/Util/Common.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/Resource.h \
  ../../src/Util/Util.h ../../src/Util/Common.h \
- ../../src/Resources/ShaderProg.h ../../src/Util/App.h \
+ ../../src/Resources/ShaderProg.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h ../../src/Util/App.h \
  ../../../SDL-hg/include/SDL.h ../../../SDL-hg/include/SDL_main.h \
  ../../../SDL-hg/include/SDL_stdinc.h \
  ../../../SDL-hg/include/SDL_config.h \
@@ -2404,6 +2443,8 @@ ShaderProg.o: ../../src/Resources//ShaderProg.cpp \
  ../../src/Math/Transform.inl.h ../../src/Renderer/Renderer.h \
  ../../src/Renderer/BufferObjects/Fbo.h ../../src/Resources/Texture.h \
  ../../src/Resources/Resource.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h \
  ../../src/Resources/Helpers/ShaderPrePreprocessor.h \
  ../../src/Resources//Texture.h
 	@echo Compiling ../../src/Resources//ShaderProg.cpp...
@@ -2452,7 +2493,9 @@ Material.o: ../../src/Resources//Material.cpp \
  ../../../SDL-hg/include/SDL_revision.h \
  ../../../SDL-hg/include/SDL_compat.h ../../src/Renderer/MainRenderer.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
- ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h
+ ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Resources//Material.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Resources//Material.cpp -o Material.o
 
@@ -2500,7 +2543,9 @@ Texture.o: ../../src/Resources//Texture.cpp \
  ../../src/Math/MathFuncs.inl.h ../../src/Math/Transform.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/BufferObjects/Fbo.h \
  ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h \
- ../../src/Resources/Resource.h ../../src/Resources/Helpers/Image.h
+ ../../src/Resources/Resource.h ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h \
+ ../../src/Resources/Helpers/Image.h
 	@echo Compiling ../../src/Resources//Texture.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Resources//Texture.cpp -o Texture.o
 
@@ -2567,7 +2612,9 @@ Input.o: ../../src/Util//Input.cpp ../../../SDL-hg/include/SDL.h \
  ../../src/Math/Transform.inl.h ../../src/Renderer/Renderer.h \
  ../../src/Renderer/BufferObjects/Fbo.h ../../src/Resources/Texture.h \
  ../../src/Resources/Resource.h ../../src/Util/Util.h \
- ../../src/Util/Common.h ../../src/Resources/ShaderProg.h
+ ../../src/Util/Common.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Util//Input.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Util//Input.cpp -o Input.o
 
@@ -2746,7 +2793,9 @@ App.o: ../../src/Util//App.cpp ../../../SDL-hg/include/SDL.h \
  ../../src/Physics/PhyConversions.h ../../src/Physics/MotionState.h \
  ../../src/Scene/SceneNode.h ../../src/Physics/PhyWorld.h \
  ../../src/Renderer/MainRenderer.h ../../src/Renderer/Renderer.h \
- ../../src/Renderer/BufferObjects/Fbo.h ../../src/Resources/ShaderProg.h
+ ../../src/Renderer/BufferObjects/Fbo.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Util//App.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Util//App.cpp -o App.o
 
@@ -2828,7 +2877,9 @@ SkelAnimCtrl.o: ../../src/Scene/Controllers//SkelAnimCtrl.cpp \
  ../../../SDL-hg/include/SDL_revision.h \
  ../../../SDL-hg/include/SDL_compat.h ../../src/Renderer/MainRenderer.h \
  ../../src/Renderer/Renderer.h ../../src/Renderer/BufferObjects/Fbo.h \
- ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h
+ ../../src/Resources/Texture.h ../../src/Resources/ShaderProg.h \
+ ../../src/Renderer/BufferObjects/Vbo.h \
+ ../../src/Renderer/BufferObjects/BufferObject.h
 	@echo Compiling ../../src/Scene/Controllers//SkelAnimCtrl.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Scene/Controllers//SkelAnimCtrl.cpp -o SkelAnimCtrl.o
 

+ 14 - 3
shaders/Dbg.glsl

@@ -1,14 +1,25 @@
 #pragma anki vertShaderBegins
 
+#pragma anki attribute position 0
+attribute vec3 position;
+#pragma anki attribute color 1
+attribute vec3 color;
+
+uniform mat4 modelViewProjectionMat;
+
+varying vec3 colorV2f;
+
 void main()
 {
-	gl_Position = ftransform();
-	gl_FrontColor = gl_Color;
+	colorV2f = color;
+	gl_Position = modelViewProjectionMat * vec4( position, 1.0 );
 }
 
 #pragma anki fragShaderBegins
 
+varying vec3 colorV2f;
+
 void main()
 {
-	gl_FragData[0].rgb = gl_Color.rgb;
+	gl_FragData[0].rgb = colorV2f;
 }

+ 2 - 0
shaders/IsLpGeneric.glsl

@@ -292,6 +292,8 @@ void main()
 		}
 	#endif // spot light
 
+
+	//gl_FragData[0] = gl_FragData[0] - gl_FragData[0] + vec4( 1, 0, 1, 1 );
 	/*#if defined(_SPOT_LIGHT_)
 	gl_FragData[0] = gl_FragData[0] - gl_FragData[0] + vec4( texture2D( msDepthFai, texCoords ).r );
 	//gl_FragData[0] = vec4( texture2D( msDepthFai, texCoords ).rg), 1.0 );

+ 2 - 0
shaders/IsStencilPass.glsl → shaders/IsSmo.glsl

@@ -1,6 +1,8 @@
 #pragma anki vertShaderBegins
 
+#pragma anki attribute position 0
 attribute vec3 position;
+
 uniform mat4 modelViewProjectionMat;
 
 void main()

+ 1 - 1
src/Misc/collision.cpp

@@ -912,7 +912,7 @@ void bsphere_t::Render()
 
 	glColor4fv( &Vec4(1.0, 1.0, 1.0, 0.2)[0] );
 
-	app->getMainRenderer()->dbg.renderSphere( radius, 24 );
+	app->getMainRenderer()->dbg.renderSphere( radius, 24, Vec3(1.0) );
 
 	glPopMatrix();
 }

+ 38 - 10
src/Renderer/Dbg.cpp

@@ -8,6 +8,13 @@
 #include "App.h"
 #include "Scene.h"
 #include "SkelNode.h"
+#include "Camera.h"
+
+
+//======================================================================================================================
+// Statics                                                                                                             =
+//======================================================================================================================
+ShaderProg* Renderer::Dbg::sProg = NULL;
 
 
 //======================================================================================================================
@@ -18,7 +25,7 @@ Renderer::Dbg::Dbg( Renderer& r_ ):
 	showAxisEnabled( false ),
 	showLightsEnabled( false ),
 	showSkeletonsEnabled( false ),
-	showCamerasEnabled( false )
+	showCamerasEnabled( true )
 {
 }
 
@@ -69,7 +76,7 @@ void Renderer::Dbg::renderGrid()
 //======================================================================================================================
 // renderSphere                                                                                                        =
 //======================================================================================================================
-void Renderer::Dbg::renderSphere( float radius, int complexity )
+void Renderer::Dbg::renderSphere( float radius, int complexity, const Vec3& color )
 {
 	const float twopi  = M::PI*2;
 	const float pidiv2 = M::PI/2;
@@ -131,6 +138,17 @@ void Renderer::Dbg::renderSphere( float radius, int complexity )
 		}
 	}
 
+	Vec<Vec3> colors( positions.size(), color );
+
+
+	glEnableVertexAttribArray( 0 );
+	glEnableVertexAttribArray( 1 );
+	glVertexAttribPointer( 0, 3, GL_FLOAT, false, 0, &(positions[0][0]) );
+	glVertexAttribPointer( 1, 3, GL_FLOAT, false, 0, &(colors[0][0]) );
+	glDrawArrays( GL_TRIANGLES, 0, positions.size() );
+	glDisableVertexAttribArray( 0 );
+	glDisableVertexAttribArray( 1 );
+
 	glEnableClientState( GL_VERTEX_ARRAY );
 	glEnableClientState( GL_NORMAL_ARRAY );
 	glVertexPointer( 3, GL_FLOAT, 0, &positions[0][0] );
@@ -236,7 +254,12 @@ void Renderer::Dbg::init()
 	fbo.unbind();
 
 	// shader
-	sProg.customLoad( "shaders/Dbg.glsl" );
+	if( sProg == NULL )
+	{
+		sProg = new ShaderProg;
+		sProg->customLoad( "shaders/Dbg.glsl" );
+	}
+
 }
 
 
@@ -250,7 +273,7 @@ void Renderer::Dbg::run()
 	const Camera& cam = *r.cam;
 
 	fbo.bind();
-	sProg.bind();
+	sProg->bind();
 
 	// OGL stuff
 	r.setProjectionViewMatrices( cam );
@@ -262,22 +285,27 @@ void Renderer::Dbg::run()
 	//R::renderGrid();
 	for( uint i=0; i<app->getScene()->nodes.size(); i++ )
 	{
+		SceneNode* node = app->getScene()->nodes[i];
 		if
 		(
-			(app->getScene()->nodes[i]->type == SceneNode::NT_LIGHT && showLightsEnabled) ||
-			(app->getScene()->nodes[i]->type == SceneNode::NT_CAMERA && showCamerasEnabled) ||
-			app->getScene()->nodes[i]->type == SceneNode::NT_PARTICLE_EMITTER
+			/*(app->getScene()->nodes[i]->type == SceneNode::NT_LIGHT && showLightsEnabled) ||*/
+			(node->type == SceneNode::NT_CAMERA && showCamerasEnabled) /*||
+			app->getScene()->nodes[i]->type == SceneNode::NT_PARTICLE_EMITTER*/
 		)
 		{
-			app->getScene()->nodes[i]->render();
+			Mat4 modelMat = Mat4( node->getWorldTransform() );
+			Mat4 modelViewMat = Mat4::combineTransformations( cam.getViewMatrix(), modelMat );
+			Mat4 modelViewProjectionMat = cam.getProjectionMatrix() * modelViewMat;
+			sProg->findUniVar( "modelViewProjectionMat" )->setMat4( &modelViewProjectionMat );
+			node->render();
 		}
-		else if( app->getScene()->nodes[i]->type == SceneNode::NT_SKELETON && showSkeletonsEnabled )
+		/*else if( app->getScene()->nodes[i]->type == SceneNode::NT_SKELETON && showSkeletonsEnabled )
 		{
 			SkelNode* skel_node = static_cast<SkelNode*>( app->getScene()->nodes[i] );
 			glDisable( GL_DEPTH_TEST );
 			skel_node->render();
 			glEnable( GL_DEPTH_TEST );
-		}
+		}*/
 	}
 }
 

ファイルの差分が大きいため隠しています
+ 0 - 3
src/Renderer/Is.cpp


+ 1 - 1
src/Renderer/Renderer.cpp

@@ -82,8 +82,8 @@ void Renderer::render( Camera& cam_ )
 void Renderer::drawQuad( int vertCoordsUniLoc )
 {
 	DEBUG_ERR( vertCoordsUniLoc == -1 );
-	glVertexAttribPointer( vertCoordsUniLoc, 2, GL_FLOAT, false, 0, quadVertCoords );
 	glEnableVertexAttribArray( vertCoordsUniLoc );
+	glVertexAttribPointer( vertCoordsUniLoc, 2, GL_FLOAT, false, 0, quadVertCoords );
 	glDrawArrays( GL_QUADS, 0, 4 );
 	glDisableVertexAttribArray( vertCoordsUniLoc );
 }

+ 36 - 9
src/Renderer/Renderer.h

@@ -6,6 +6,7 @@
 #include "Fbo.h"
 #include "Texture.h"
 #include "ShaderProg.h"
+#include "Vbo.h"
 
 class Camera;
 class PointLight;
@@ -118,6 +119,37 @@ class Renderer
 						void run( const Camera& cam );
 				}; // end Sm
 
+				/**
+				 * Stencil masking optimizations
+				 */
+				class Smo: public RenderingStage
+				{
+					friend class Is;
+					friend class Renderer;
+
+					private:
+						class SmoShaderProg: public ShaderProg
+						{
+							public:
+								struct
+								{
+									const ShaderProg::UniVar* modelViewProjectionMat;
+								} uniVars;
+						};
+
+					public:
+						Smo( Renderer& r_ ): RenderingStage( r_ ) {}
+
+					private:
+						static float sMOUvSCoords []; ///< Illumination stage stencil masking optimizations UV sphere vertex positions
+						static Vbo sMOUvSVbo; ///< Illumination stage stencil masking optimizations UV sphere VBO
+						static SmoShaderProg sProg;
+
+						void init();
+						void run( const PointLight& light );
+						void run( const SpotLight& light );
+				}; // end Smo
+
 			private:
 				/// Illumination stage ambient pass shader program
 				class AmbientShaderProg: public ShaderProg
@@ -154,8 +186,9 @@ class Renderer
 			public:
 				Texture fai;
 				Sm sm;
+				Smo smo;
 
-				Is( Renderer& r_ ): RenderingStage( r_ ), sm(r) {}
+				Is( Renderer& r_ ): RenderingStage( r_ ), sm( r_ ), smo( r_ ) {}
 
 			private:
 				Fbo fbo; ///< This FBO writes to the Is::fai
@@ -166,15 +199,9 @@ class Renderer
 				LightShaderProg spotLightShadowSProg; ///< Illumination stage spot light w/ shadow shader program
 				Vec3 viewVectors[4];
 				Vec2 planes;
-				static float sMOUvSCoords []; ///< Illumination stage stencil masking optimizations UV sphere vertex coords
-				static uint sMOUvSVboId; ///< Illumination stage stencil masking optimizations UV sphere VBO id
 
-				static void initSMOUvS(); ///< Init the illumination stage stencil masking optimizations uv sphere (eg create the @ref sMOUvSVboId VBO)
-				void renderSMOUvS( const PointLight& light ); ///< Render the illumination stage stencil masking optimizations uv sphere
 				void calcViewVector(); ///< Calc the view vector that we will use inside the shader to calculate the frag pos in view space
 				void calcPlanes(); ///< Calc the planes that we will use inside the shader to calculate the frag pos in view space
-				void stencilOptPass( const PointLight& light );
-				void stencilOptPass( const SpotLight& light );
 				void ambientPass( const Vec3& color );
 				void pointLightPass( const PointLight& light );
 				void spotLightPass( const SpotLight& light );
@@ -331,12 +358,12 @@ class Renderer
 			public:
 				Dbg( Renderer& r_ );
 				void renderGrid();
-				void renderSphere( float radius, int complexity );
+				void renderSphere( float radius, int complexity, const Vec3& color );
 				void renderCube( bool cols = false, float size = 1.0 );
 
 			private:
 				Fbo fbo;
-				ShaderProg sProg; /// @todo move Dbg to GL 3
+				static ShaderProg* sProg;
 
 				void init();
 				void run();

ファイルの差分が大きいため隠しています
+ 7 - 0
src/Renderer/Smo.cpp


+ 3 - 3
src/Resources/Mesh.cpp

@@ -156,7 +156,7 @@ bool Mesh::load( const char* filename )
 	createAllNormals();
 	if( texCoords.size() > 0 ) createVertTangents();
 	createVertIndeces();
-	createVBOs();
+	createVbos();
 	calcBSphere();
 
 	return true;
@@ -300,9 +300,9 @@ void Mesh::createVertTangents()
 
 
 //======================================================================================================================
-// createVBOs                                                                                                          =
+// createVbos                                                                                                          =
 //======================================================================================================================
-void Mesh::createVBOs()
+void Mesh::createVbos()
 {
 	vbos.vertIndeces.create( GL_ELEMENT_ARRAY_BUFFER, vertIndeces.getSizeInBytes(), &vertIndeces[0], GL_STATIC_DRAW );
 	vbos.vertCoords.create( GL_ARRAY_BUFFER, vertCoords.getSizeInBytes(), &vertCoords[0], GL_STATIC_DRAW );

+ 1 - 1
src/Resources/Mesh.h

@@ -60,7 +60,7 @@ class Mesh: public Resource
 		void createAllNormals() { createFaceNormals(); createVertNormals(); }
 		void createVertTangents();
 		void createVertIndeces();
-		void createVBOs();
+		void createVbos();
 		void calcBSphere();
 
 	public:

+ 2 - 0
src/Resources/ShaderProg.cpp

@@ -271,6 +271,8 @@ bool ShaderProg::load( const char* filename )
 //======================================================================================================================
 bool ShaderProg::customLoad( const char* filename, const char* extraSource )
 {
+	DEBUG_ERR( glId != numeric_limits<uint>::max() );
+
 	if( getRsrcName().length() == 0 )
 	{
 		name = Util::cutPath( filename );

+ 37 - 22
src/Resources/ShaderProg.h

@@ -3,6 +3,7 @@
 
 #include <GL/glew.h>
 #include <map>
+#include <limits>
 #include "Common.h"
 #include "Resource.h"
 #include "Math.h"
@@ -17,10 +18,11 @@
  */
 class ShaderProg: public Resource
 {
-	PROPERTY_R( uint, glId, getGlId ) ///< @ref PROPERTY_R : The OpenGL ID of the shader program
-	
 	friend class Material;
 
+	//====================================================================================================================
+	// Nested                                                                                                            =
+	//====================================================================================================================
 	public:
 		/**
 		 * Shader program variable. The type is attribute or uniform
@@ -40,9 +42,6 @@ class ShaderProg: public Resource
 			PROPERTY_R( GLenum, glDataType, getGlDataType ) ///< @ref PROPERTY_R : GL_FLOAT, GL_FLOAT_VEC2 etc. See http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniform.xml
 			PROPERTY_R( Type, type, getType ) ///< @ref PROPERTY_R : @ref SVT_ATTRIBUTE or @ref SVT_UNIFORM
 
-			protected:
-				const ShaderProg* fatherSProg; ///< We need the ShaderProg of this variable mainly for sanity checks
-
 			public:
 				Var( GLint loc_, const char* name_, GLenum glDataType_, Type type_, const ShaderProg* fatherSProg_ ):
 					loc(loc_), name(name_), glDataType(glDataType_), type(type_), fatherSProg(fatherSProg_)
@@ -52,6 +51,9 @@ class ShaderProg: public Resource
 				Var( const Var& var ):
 					loc(var.loc), name(var.name), glDataType(var.glDataType), type(var.type), fatherSProg(var.fatherSProg)
 				{}
+
+			protected:
+				const ShaderProg* fatherSProg; ///< We need the ShaderProg of this variable mainly for sanity checks
 		};
 
 		/**
@@ -94,29 +96,23 @@ class ShaderProg: public Resource
 					Var( var )
 				{}
 		};
-
-	private:
-		static string stdSourceCode;
-		Vec<UniVar> uniVars; ///< All the uniform variables
-		Vec<AttribVar> attribVars; ///< All the attribute variables
-		map<string,UniVar*> uniNameToVar;  ///< A map for quick variable searching
-		map<string,AttribVar*> attribNameToVar; ///< @see uniNameToVar
-		typedef map<string,UniVar*>::const_iterator NameToUniVarIterator; ///< Uniform variable name to variable iterator
-		typedef map<string,AttribVar*>::const_iterator NameToAttribVarIterator; ///< Attribute variable name to variable iterator
-
-		void getUniAndAttribVars(); ///< After the linking of the shader prog is done gather all the vars in custom containers
-		bool bindCustomAttribLocs( const class ShaderPrePreprocessor& pars ) const; ///< Uses glBindAttribLocation for every parser attrib location
-		uint createAndCompileShader( const char* sourceCode, const char* preproc, int type ) const; ///< @return Returns zero on failure
-		bool link(); ///< Link the shader prog
 		
+	//====================================================================================================================
+	// Public                                                                                                            =
+	//====================================================================================================================
 	public:
-		ShaderProg(): glId(0) {}
+		ShaderProg(): glId( numeric_limits<uint>::max() ) {}
 		virtual ~ShaderProg() {}
 
+		/**
+		 * Accessor to glId
+		 */
+		GLuint getGlId() const { DEBUG_ERR( glId==numeric_limits<uint>::max() ); return glId; }
+
 		/**
 		 * Bind the shader program
 		 */
-		inline void bind() const { DEBUG_ERR( glId==0 ); glUseProgram(glId); }
+		inline void bind() const { DEBUG_ERR( glId==numeric_limits<uint>::max() ); glUseProgram(glId); }
 		
 		/**
 		 * Unbind all shader programs
@@ -150,7 +146,7 @@ class ShaderProg: public Resource
 		/**
 		 * Accessor to uniform vars vector
 		 */
-		const Vec<UniVar>&    getUniVars() const { return uniVars; }
+		const Vec<UniVar>& getUniVars() const { return uniVars; }
 
 		/**
 		 * Accessor to attribute vars vector
@@ -170,6 +166,25 @@ class ShaderProg: public Resource
 
 		bool uniVarExists( const char* varName ) const;
 		bool attribVarExists( const char* varName ) const;
+
+	//====================================================================================================================
+	// Private                                                                                                           =
+	//====================================================================================================================
+	private:
+		GLuint glId; ///< The OpenGL ID of the shader program
+
+		static string stdSourceCode;
+		Vec<UniVar> uniVars; ///< All the uniform variables
+		Vec<AttribVar> attribVars; ///< All the attribute variables
+		map<string,UniVar*> uniNameToVar;  ///< A map for quick variable searching
+		map<string,AttribVar*> attribNameToVar; ///< @see uniNameToVar
+		typedef map<string,UniVar*>::const_iterator NameToUniVarIterator; ///< Uniform variable name to variable iterator
+		typedef map<string,AttribVar*>::const_iterator NameToAttribVarIterator; ///< Attribute variable name to variable iterator
+
+		void getUniAndAttribVars(); ///< After the linking of the shader prog is done gather all the vars in custom containers
+		bool bindCustomAttribLocs( const class ShaderPrePreprocessor& pars ) const; ///< Uses glBindAttribLocation for every parser attrib location
+		uint createAndCompileShader( const char* sourceCode, const char* preproc, int type ) const; ///< @return Returns zero on failure
+		bool link(); ///< Link the shader prog
 }; 
 
 #endif

+ 14 - 32
src/Scene/Camera.cpp

@@ -22,11 +22,8 @@ void Camera::setAll( float fovx_, float fovy_, float znear_, float zfar_ )
 //======================================================================================================================
 void Camera::render()
 {
-	glPushMatrix();
-	app->getMainRenderer()->multMatrix( Mat4( getWorldTransform() ) );
-
 	const float camLen = 1.0;
-	float tmp0 = camLen / tan( (PI - fovX)*0.5 ) + 0.001;
+	float tmp0 = camLen / tan( (M::PI - fovX)*0.5 ) + 0.001;
 	float tmp1 = camLen * tan(fovY*0.5) + 0.001;
 
 	float points [][3] = {
@@ -37,34 +34,19 @@ void Camera::render()
 		{tmp0, tmp1, -camLen}, // 4: top right
 	};
 
-	//glLineWidth( 2.0 );
-
-	glColor3fv( &Vec3(1.0,0.0,1.0)[0] );
-	glBegin( GL_LINES );
-		glVertex3fv( &points[0][0] );
-		glVertex3fv( &points[1][0] );
-		glVertex3fv( &points[0][0] );
-		glVertex3fv( &points[2][0] );
-		glVertex3fv( &points[0][0] );
-		glVertex3fv( &points[3][0] );
-		glVertex3fv( &points[0][0] );
-		glVertex3fv( &points[4][0] );
-	glEnd();
-
-	glBegin( GL_LINE_STRIP );
-		glVertex3fv( &points[1][0] );
-		glVertex3fv( &points[2][0] );
-		glVertex3fv( &points[3][0] );
-		glVertex3fv( &points[4][0] );
-		glVertex3fv( &points[1][0] );
-	glEnd();
-
-
-	glPopMatrix();
-
-//	if( !strcmp( camera_data_user_class_t::getName(), "mainCam") ) return;
-//	//for( uint i=0; i<2; i++ )
-//		wspaceFrustumPlanes[TOP].render();
+	const float colors [][3] = { { 1.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 },
+	                             { 1.0, 0.0, 1.0 } };
+
+	const ushort indeces [] = { 0, 1, 0, 2, 0, 3, 0, 4, 1, 2, 2, 3, 3, 4, 4, 1 };
+
+
+	glEnableVertexAttribArray( 0 );
+	glEnableVertexAttribArray( 1 );
+	glVertexAttribPointer( 0, 3, GL_FLOAT, false, 0, points );
+	glVertexAttribPointer( 1, 3, GL_FLOAT, false, 0, colors );
+	glDrawElements( GL_LINES, 16, GL_UNSIGNED_SHORT, indeces );
+	glDisableVertexAttribArray( 0 );
+	glDisableVertexAttribArray( 1 );
 }
 
 

+ 4 - 5
src/Scene/Light.cpp

@@ -43,14 +43,13 @@ void Light::deinit()
 //======================================================================================================================
 // renderSphere                                                                                                        =
 //======================================================================================================================
-static void RenderSphere( const Mat4& tsl, const Vec3& col )
+static void renderSphere( const Mat4& tsl, const Vec3& col )
 {
 	glPushMatrix();
 
 	/// @todo move to GL 3.x
 	app->getMainRenderer()->multMatrix( tsl );
-	app->getMainRenderer()->color3( col );
-	app->getMainRenderer()->dbg.renderSphere( 1.0/8.0, 8 );
+	app->getMainRenderer()->dbg.renderSphere( 1.0/8.0, 8, col );
 
 	glPopMatrix();
 }
@@ -61,7 +60,7 @@ static void RenderSphere( const Mat4& tsl, const Vec3& col )
 //======================================================================================================================
 void PointLight::render()
 {
-	RenderSphere( Mat4(getWorldTransform()), lightProps->getDiffuseColor() );
+	renderSphere( Mat4(getWorldTransform()), lightProps->getDiffuseColor() );
 }
 
 
@@ -70,5 +69,5 @@ void PointLight::render()
 //======================================================================================================================
 void SpotLight::render()
 {
-	RenderSphere( Mat4(getWorldTransform()), lightProps->getDiffuseColor() );
+	renderSphere( Mat4(getWorldTransform()), lightProps->getDiffuseColor() );
 }

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません