Bladeren bron

see prev log

Panagiotis Christopoulos Charitos 15 jaren geleden
bovenliggende
commit
25eca0554a
3 gewijzigde bestanden met toevoegingen van 16 en 3 verwijderingen
  1. BIN
      docs/resources.odg
  2. 12 0
      src/Scene/ModelNodePatch.cpp
  3. 4 3
      src/Scene/ModelNodePatch.h

BIN
docs/resources.odg


+ 12 - 0
src/Scene/ModelNodePatch.cpp

@@ -53,6 +53,18 @@ ModelNodePatch::ModelNodePatch(const ModelPatch& modelPatch_, bool isSkinPatch):
 		vbos[Mesh::VBO_VERT_POSITIONS] = &tfVbos[TF_VBO_POSITIONS];
 		vbos[Mesh::VBO_VERT_NORMALS] = &tfVbos[TF_VBO_NORMALS];
 		vbos[Mesh::VBO_VERT_TANGENTS] = &tfVbos[TF_VBO_TANGENTS];
+
+		//
+		// Create the TF VAO
+		//
+		/// @todo check what are the needed VBOs
+		tfVao.create();
+		const Vbo& tmpVbo = modelPatchRsrc.getMesh().getVbo(Mesh::VBO_VERT_POSITIONS);
+		tfVao.attachArrayBufferVbo(tmpVbo, 0, 3, GL_FLOAT, GL_FALSE, 0, NULL);
+		const Vbo& tmpVbo = modelPatchRsrc.getMesh().getVbo(Mesh::VBO_VERT_NORMALS);
+		tfVao.attachArrayBufferVbo(tmpVbo, 1, 3, GL_FLOAT, GL_FALSE, 0, NULL);
+		const Vbo& tmpVbo = modelPatchRsrc.getMesh().getVbo(Mesh::VBO_VERT_TANGENTS);
+		tfVao.attachArrayBufferVbo(tmpVbo, 2, 4, GL_FLOAT, GL_FALSE, 0, NULL);
 	}
 
 	createVao(modelPatchRsrc.getCpMtl(), vbos, cpVao);

+ 4 - 3
src/Scene/ModelNodePatch.h

@@ -36,9 +36,10 @@ class ModelNodePatch
 		const ModelPatch& modelPatchRsrc;
 		boost::array<Vbo, TF_VBOS_NUM> tfVbos;
 		boost::array<const Vbo*, Mesh::VBOS_NUM> vbos;
-		Vao cpVao; ///< VAO for MS and BS
-		Vao dpVao; ///< VAO for depth passes
-		Vao tfVao; ///< VAO for transform feedback
+		Vao cpVao; ///< VAO for MS and BS. All VBOs could be attached except for the vert weights
+		Vao dpVao; ///< VAO for depth passes. All VBOs could be attached except for the vert weights
+		/// VAO for transform feedback pass. We attach only the positions, normals (optional) and tangents (optional) VBOs
+		Vao tfVao;
 
 		static void createVao(const Material& material, const boost::array<const Vbo*, Mesh::VBOS_NUM>& vbos, Vao& vao);
 };