Browse Source

Nothing worth mentioning

Panagiotis Christopoulos Charitos 15 years ago
parent
commit
188a5bdcf3
2 changed files with 11 additions and 7 deletions
  1. 7 5
      src/Renderer/Smo.cpp
  2. 4 2
      src/Renderer/Smo.h

+ 7 - 5
src/Renderer/Smo.cpp

@@ -23,9 +23,11 @@ void Smo::init(const RendererInitializer& /*initializer*/)
 	sProg.loadRsrc("shaders/IsSmo.glsl");
 
 	// Geometry stuff
-	vbo = new Vbo(GL_ARRAY_BUFFER, sizeof(sMOUvSCoords), sMOUvSCoords, GL_STATIC_DRAW, this);
-	vao = new Vao(this);
-	vao->attachArrayBufferVbo(*vbo, *sProg->findAttribVar("position"), 3, GL_FLOAT, false, 0, NULL);
+	sphereVbo = new Vbo(GL_ARRAY_BUFFER, sizeof(sMOUvSCoords), sMOUvSCoords, GL_STATIC_DRAW, this);
+	sphereVao = new Vao(this);
+	sphereVao->attachArrayBufferVbo(*sphereVbo, *sProg->findAttribVar("position"), 3, GL_FLOAT, false, 0, NULL);
+
+	//cameraVbo = new Vbo(GL_ARRAY_BUFFER, sizeof(float) * 3 * 3 * 6, sMOUvSCoords, GL_STATIC_DRAW, this);
 }
 
 
@@ -50,9 +52,9 @@ void Smo::run(const PointLight& light)
 	sProg->findUniVar("modelViewProjectionMat")->setMat4(&trf);
 
 	// render sphere to the stencil buffer
-	vao->bind();
+	sphereVao->bind();
 	glDrawArrays(GL_TRIANGLES, 0, sizeof(sMOUvSCoords) / sizeof(float) / 3);
-	vao->unbind();
+	sphereVao->unbind();
 
 	// restore GL
 	glEnable(GL_CULL_FACE);

+ 4 - 2
src/Renderer/Smo.h

@@ -24,8 +24,10 @@ class Smo: public RenderingPass
 
 	private:
 		static float sMOUvSCoords[]; ///< Illumination stage stencil masking optimizations UV sphere vertex positions
-		Vbo* vbo; ///< Illumination stage stencil masking optimizations UV sphere VBO
-		Vao* vao; ///< And a VAO
+		Vbo* sphereVbo; ///< Illumination stage stencil masking optimizations UV sphere VBO
+		Vao* sphereVao; ///< And a VAO
+		Vbo* cameraVbo; ///< A camera shape
+		Vao* cameraVao; ///< And another VAO
 		RsrcPtr<ShaderProg> sProg;
 };