Explorar el Código

- Fixing IS SMO pass (needs testing)
- Optimizing SMO. One combine transformation less

Panagiotis Christopoulos Charitos hace 15 años
padre
commit
18b33d21ca
Se han modificado 4 ficheros con 25 adiciones y 17 borrados
  1. 1 1
      src/Renderer/Renderer.h
  2. 2 0
      src/Renderer/Smo.cpp
  3. 4 2
      src/Renderer/Smo.h
  4. 18 14
      src/Util/Scanner.h

+ 1 - 1
src/Renderer/Renderer.h

@@ -32,6 +32,7 @@ class Renderer: public Object
 	PROPERTY_R(uint, width, getWidth) ///< Width of the rendering. Dont confuse with the window width
 	PROPERTY_R(uint, height, getHeight) ///< Height of the rendering. Dont confuse with the window width
 	PROPERTY_R(float, aspectRatio, getAspectRatio) ///< Just a precalculated value
+	PROPERTY_R(Mat4, viewProjectionMat, getViewProjectionMat) ///< Precalculated in case anyone needs it
 
 	//====================================================================================================================
 	// Public                                                                                                            =
@@ -109,7 +110,6 @@ class Renderer: public Object
 		uint framesNum; ///< Frame number
 		const Camera* cam; ///< Current camera
 		static int maxColorAtachments; ///< Max color attachments an FBO can accept
-		Mat4 viewProjectionMat; ///< Precalculated in case anyone needs it
 
 	//====================================================================================================================
 	// Protected                                                                                                         =

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2 - 0
src/Renderer/Smo.cpp


+ 4 - 2
src/Renderer/Smo.h

@@ -3,13 +3,14 @@
 
 #include "RenderingPass.h"
 #include "Fbo.h"
-#include "Vbo.h"
 #include "ShaderProg.h"
 #include "RsrcPtr.h"
 
 
 class PointLight;
 class SpotLight;
+class Vao;
+class Vbo;
 
 
 /// Stencil masking optimizations
@@ -23,7 +24,8 @@ class Smo: public RenderingPass
 
 	private:
 		static float sMOUvSCoords[]; ///< Illumination stage stencil masking optimizations UV sphere vertex positions
-		static Vbo* sMOUvSVbo; ///< Illumination stage stencil masking optimizations UV sphere VBO
+		Vbo* vbo; ///< Illumination stage stencil masking optimizations UV sphere VBO
+		Vao* vao; ///< And a VAO
 		RsrcPtr<ShaderProg> sProg;
 };
 

+ 18 - 14
src/Util/Scanner.h

@@ -139,12 +139,16 @@ class Scanner
 	//====================================================================================================================
 	public:
 		/// Constructor #1
+		/// @param newlinesAsWhitespace @see newlinesAsWhitespace
+		Scanner(bool newlinesAsWhitespace = true) {init(newlinesAsWhitespace);}
+
+		/// Constructor #2
 		/// @see loadFile
 		/// @param newlinesAsWhitespace @see newlinesAsWhitespace
 		/// @exception Exception
 		Scanner(const char* filename, bool newlinesAsWhitespace = true);
 
-		/// Constructor #2
+		/// Constructor #3
 		/// @see loadIstream
 		/// @param newlinesAsWhitespace @see newlinesAsWhitespace
 		/// @exception Exception
@@ -153,6 +157,17 @@ class Scanner
 		/// It only unloads the file if file is chosen
 		~Scanner() {unload();}
 
+		/// Load a file to extract tokens
+		/// @param filename The filename of the file to read
+		/// @exception Exception
+		void loadFile(const char* filename);
+
+		/// Load a STL istream to extract tokens
+		/// @param istream_ The stream from where to read
+		/// @param scriptName_ The name of the stream. For error reporting
+		/// @exception Exception
+		void loadIstream(std::istream& istream_, const char* scriptName_);
+
 		/// Extracts all tokens and prints them. Used for debugging
 		void getAllPrintAll();
 
@@ -196,8 +211,8 @@ class Scanner
 		bool newlinesAsWhitespace;
 
 		/// Commented lines number
-		/// Used to keep track of the newlines in multiline comments so we can then return the correct number of newlines in
-		/// case of newlinesAsWhitespace is false
+		/// Used to keep track of the newlines in multiline comments so we can then return the correct number of newlines
+		/// in case of newlinesAsWhitespace is false
 		int commentedLines;
 
 		/// @name Input
@@ -236,17 +251,6 @@ class Scanner
 		/// Common initialization code
 		void init(bool newlinesAsWhitespace_);
 
-		/// Load a file to extract tokens
-		/// @param filename The filename of the file to read
-		/// @exception Exception
-		void loadFile(const char* filename);
-
-		/// Load a STL istream to extract tokens
-		/// @param istream_ The stream from where to read
-		/// @param scriptName_ The name of the stream. For error reporting
-		/// @exception Exception
-		void loadIstream(std::istream& istream_, const char* scriptName_);
-
 		/// Unloads the file
 		void unload();
 }; // end class Scanner

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio