History

Merge pull request #4780 from samcake/blue

Add support for Skybox and rendering path of background according to Zones

Brad Hefta-Gaub committed 11 years ago

Commit 55519972 parents 719747e 8fd77f936 files · +1048 −604Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 36 files). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+55−55
@@ -69,7 +69,7 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm · 68 unmodified lines
6969 || (!registered && !_sphereVertices.contains(radiusKey))) {
7070
7171 if (registered && _registeredSphereVertices.contains(id)) {
72− _registeredSphereVertices[id].clear();
72+ _registeredSphereVertices[id].reset();
7373 #ifdef WANT_DEBUG
7474 qCDebug(renderutils) << "renderSphere()... RELEASING REGISTERED VERTICES BUFFER";
7575 #endif
@@ -111,7 +111,7 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm · 35 unmodified lines
111111 *(vertex++) = 0.0f;
112112 *(vertex++) = 1.0f * radius;
113113
114− verticesBuffer->append(sizeof(GLfloat) * vertices * NUM_COORDS_PER_VERTEX, (gpu::Buffer::Byte*) vertexData);
114+ verticesBuffer->append(sizeof(GLfloat) * vertices * NUM_COORDS_PER_VERTEX, (gpu::Byte*) vertexData);
115115 delete[] vertexData;
116116
117117 #ifdef WANT_DEBUG
@@ -133,7 +133,7 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm · 15 unmodified lines
133133 || (!registered && !_sphereIndices.contains(slicesStacksKey))) {
134134
135135 if (registered && _registeredSphereIndices.contains(id)) {
136− _registeredSphereIndices[id].clear();
136+ _registeredSphereIndices[id].reset();
137137 #ifdef WANT_DEBUG
138138 qCDebug(renderutils) << "renderSphere()... RELEASING REGISTERED INDICES BUFFER";
139139 #endif
@@ -196,7 +196,7 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm · 56 unmodified lines
196196 indexCount += 3;
197197
198198 }
199− indicesBuffer->append(sizeof(GLushort) * indices, (gpu::Buffer::Byte*) indexData);
199+ indicesBuffer->append(sizeof(GLushort) * indices, (gpu::Byte*) indexData);
200200 delete[] indexData;
201201
202202 #ifdef WANT_DEBUG
@@ -219,7 +219,7 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm · 16 unmodified lines
219219 || (!registered && !_sphereColors.contains(colorKey))) {
220220
221221 if (registered && _registeredSphereColors.contains(id)) {
222− _registeredSphereColors[id].clear();
222+ _registeredSphereColors[id].reset();
223223 #ifdef WANT_DEBUG
224224 qCDebug(renderutils) << "renderSphere()... RELEASING REGISTERED COLORS BUFFER";
225225 #endif
@@ -245,7 +245,7 @@ void GeometryCache::renderSphere(float radius, int slices, int stacks, const glm · 19 unmodified lines
245245 *(colorDataAt++) = compactColor;
246246 }
247247
248− colorBuffer->append(sizeof(int) * vertices, (gpu::Buffer::Byte*) colorData);
248+ colorBuffer->append(sizeof(int) * vertices, (gpu::Byte*) colorData);
249249 delete[] colorData;
250250
251251 #ifdef WANT_DEBUG
@@ -432,7 +432,7 @@ void GeometryCache::renderGrid(int xDivisions, int yDivisions, const glm::vec4& · 180 unmodified lines
432432 *(vertex++) = y;
433433 }
434434
435− verticesBuffer->append(sizeof(GLfloat) * vertices * 2, (gpu::Buffer::Byte*) vertexData);
435+ verticesBuffer->append(sizeof(GLfloat) * vertices * 2, (gpu::Byte*) vertexData);
436436 delete[] vertexData;
437437
438438 _gridBuffers[key] = verticesBuffer;
@@ -454,7 +454,7 @@ void GeometryCache::renderGrid(int xDivisions, int yDivisions, const glm::vec4& · 15 unmodified lines
454454 *(colorDataAt++) = compactColor;
455455 }
456456
457− colorBuffer->append(sizeof(int) * vertices, (gpu::Buffer::Byte*) colorData);
457+ colorBuffer->append(sizeof(int) * vertices, (gpu::Byte*) colorData);
458458 delete[] colorData;
459459 }
460460 gpu::BufferPointer verticesBuffer = _gridBuffers[key];
@@ -537,7 +537,7 @@ void GeometryCache::renderGrid(int x, int y, int width, int height, int rows, in · 76 unmodified lines
537537 tx += dx;
538538 }
539539
540− verticesBuffer->append(sizeof(GLfloat) * vertices * 2, (gpu::Buffer::Byte*) vertexData);
540+ verticesBuffer->append(sizeof(GLfloat) * vertices * 2, (gpu::Byte*) vertexData);
541541 delete[] vertexData;
542542
543543 if (registered) {
@@ -564,7 +564,7 @@ void GeometryCache::renderGrid(int x, int y, int width, int height, int rows, in · 20 unmodified lines
564564 *(colorDataAt++) = compactColor;
565565 }
566566
567− colorBuffer->append(sizeof(int) * vertices, (gpu::Buffer::Byte*) colorData);
567+ colorBuffer->append(sizeof(int) * vertices, (gpu::Byte*) colorData);
568568 delete[] colorData;
569569 }
570570 gpu::BufferPointer verticesBuffer = registered ? _registeredAlternateGridBuffers[id] : _alternateGridBuffers[key];
@@ -648,8 +648,8 @@ void GeometryCache::updateVertices(int id, const QVector<glm::vec2>& points, con · 77 unmodified lines
648648 *(colorDataAt++) = compactColor;
649649 }
650650
651− details.verticesBuffer->append(sizeof(GLfloat) * FLOATS_PER_VERTEX * details.vertices, (gpu::Buffer::Byte*) vertexData);
652− details.colorBuffer->append(sizeof(int) * details.vertices, (gpu::Buffer::Byte*) colorData);
651+ details.verticesBuffer->append(sizeof(GLfloat) * FLOATS_PER_VERTEX * details.vertices, (gpu::Byte*) vertexData);
652+ details.colorBuffer->append(sizeof(int) * details.vertices, (gpu::Byte*) colorData);
653653 delete[] vertexData;
654654 delete[] colorData;
655655
@@ -711,8 +711,8 @@ void GeometryCache::updateVertices(int id, const QVector<glm::vec3>& points, con · 55 unmodified lines
711711 *(colorDataAt++) = compactColor;
712712 }
713713
714− details.verticesBuffer->append(sizeof(GLfloat) * FLOATS_PER_VERTEX * details.vertices, (gpu::Buffer::Byte*) vertexData);
715− details.colorBuffer->append(sizeof(int) * details.vertices, (gpu::Buffer::Byte*) colorData);
714+ details.verticesBuffer->append(sizeof(GLfloat) * FLOATS_PER_VERTEX * details.vertices, (gpu::Byte*) vertexData);
715+ details.colorBuffer->append(sizeof(int) * details.vertices, (gpu::Byte*) colorData);
716716 delete[] vertexData;
717717 delete[] colorData;
718718
@@ -793,7 +793,7 @@ void GeometryCache::renderSolidCube(float size, const glm::vec4& color) { · 74 unmodified lines
793793 *(vertex++) = *cannonicalNormal++;
794794 }
795795
796− verticesBuffer->append(sizeof(GLfloat) * vertexPoints * 2, (gpu::Buffer::Byte*) vertexData);
796+ verticesBuffer->append(sizeof(GLfloat) * vertexPoints * 2, (gpu::Byte*) vertexData);
797797 }
798798
799799 if (!_solidCubeIndexBuffer) {
@@ -808,7 +808,7 @@ void GeometryCache::renderSolidCube(float size, const glm::vec4& color) { · 8 unmodified lines
808808 gpu::BufferPointer indexBuffer(new gpu::Buffer());
809809 _solidCubeIndexBuffer = indexBuffer;
810810
811− _solidCubeIndexBuffer->append(sizeof(cannonicalIndices), (gpu::Buffer::Byte*) cannonicalIndices);
811+ _solidCubeIndexBuffer->append(sizeof(cannonicalIndices), (gpu::Byte*) cannonicalIndices);
812812 }
813813
814814 if (!_solidCubeColors.contains(colorKey)) {
@@ -827,7 +827,7 @@ void GeometryCache::renderSolidCube(float size, const glm::vec4& color) { · 12 unmodified lines
827827 compactColor, compactColor, compactColor, compactColor,
828828 compactColor, compactColor, compactColor, compactColor };
829829
830− colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
830+ colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
831831 }
832832 gpu::BufferPointer verticesBuffer = _solidCubeVerticies[size];
833833 gpu::BufferPointer colorBuffer = _solidCubeColors[colorKey];
@@ -891,7 +891,7 @@ void GeometryCache::renderWireCube(float size, const glm::vec4& color) { · 57 unmodified lines
891891 vertex[i] = cannonicalVertices[i] * halfSize;
892892 }
893893
894− verticesBuffer->append(sizeof(GLfloat) * vertexPoints, (gpu::Buffer::Byte*) vertexData); // I'm skeptical that this is right
894+ verticesBuffer->append(sizeof(GLfloat) * vertexPoints, (gpu::Byte*) vertexData); // I'm skeptical that this is right
895895 }
896896
897897 if (!_wireCubeIndexBuffer) {
@@ -904,7 +904,7 @@ void GeometryCache::renderWireCube(float size, const glm::vec4& color) { · 6 unmodified lines
904904 gpu::BufferPointer indexBuffer(new gpu::Buffer());
905905 _wireCubeIndexBuffer = indexBuffer;
906906
907− _wireCubeIndexBuffer->append(sizeof(cannonicalIndices), (gpu::Buffer::Byte*) cannonicalIndices);
907+ _wireCubeIndexBuffer->append(sizeof(cannonicalIndices), (gpu::Byte*) cannonicalIndices);
908908 }
909909
910910 if (!_cubeColors.contains(colorKey)) {
@@ -919,7 +919,7 @@ void GeometryCache::renderWireCube(float size, const glm::vec4& color) { · 8 unmodified lines
919919 int colors[NUM_COLOR_SCALARS_PER_CUBE] = { compactColor, compactColor, compactColor, compactColor,
920920 compactColor, compactColor, compactColor, compactColor };
921921
922− colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
922+ colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
923923 }
924924 gpu::BufferPointer verticesBuffer = _cubeVerticies[size];
925925 gpu::BufferPointer colorBuffer = _cubeColors[colorKey];
@@ -1037,8 +1037,8 @@ void GeometryCache::renderBevelCornersRect(int x, int y, int width, int height, · 111 unmodified lines
10371037 compactColor, compactColor, compactColor, compactColor };
10381038
10391039
1040− details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
1041− details.colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
1040+ details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer);
1041+ details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
10421042
10431043 delete[] vertexBuffer;
10441044 }
@@ -1119,8 +1119,8 @@ void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxC · 74 unmodified lines
11191119 int colors[NUM_COLOR_SCALARS_PER_QUAD] = { compactColor, compactColor, compactColor, compactColor };
11201120
11211121
1122− details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
1123− details.colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
1122+ details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer);
1123+ details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
11241124 }
11251125
11261126 gpu::Batch batch;
@@ -1208,8 +1208,8 @@ void GeometryCache::renderQuad(const glm::vec2& minCorner, const glm::vec2& maxC · 81 unmodified lines
12081208 int colors[NUM_COLOR_SCALARS_PER_QUAD] = { compactColor, compactColor, compactColor, compactColor };
12091209
12101210
1211− details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
1212− details.colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
1211+ details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer);
1212+ details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
12131213 }
12141214
12151215 gpu::Batch batch;
@@ -1294,8 +1294,8 @@ void GeometryCache::renderQuad(const glm::vec3& minCorner, const glm::vec3& maxC · 78 unmodified lines
12941294 int colors[NUM_COLOR_SCALARS_PER_QUAD] = { compactColor, compactColor, compactColor, compactColor };
12951295
12961296
1297− details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
1298− details.colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
1297+ details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer);
1298+ details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
12991299 }
13001300
13011301 gpu::Batch batch;
@@ -1396,8 +1396,8 @@ void GeometryCache::renderQuad(const glm::vec3& topLeft, const glm::vec3& bottom · 94 unmodified lines
13961396 ((int(color.w * 255.0f) & 0xFF) << 24);
13971397 int colors[NUM_COLOR_SCALARS_PER_QUAD] = { compactColor, compactColor, compactColor, compactColor };
13981398
1399− details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
1400− details.colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
1399+ details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer);
1400+ details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
14011401 }
14021402
14031403 gpu::Batch batch;
@@ -1510,8 +1510,8 @@ void GeometryCache::renderDashedLine(const glm::vec3& start, const glm::vec3& en · 106 unmodified lines
15101510 *(vertex++) = end.z;
15111511 *(colorDataAt++) = compactColor;
15121512
1513− details.verticesBuffer->append(sizeof(GLfloat) * FLOATS_PER_VERTEX * details.vertices, (gpu::Buffer::Byte*) vertexData);
1514− details.colorBuffer->append(sizeof(int) * details.vertices, (gpu::Buffer::Byte*) colorData);
1513+ details.verticesBuffer->append(sizeof(GLfloat) * FLOATS_PER_VERTEX * details.vertices, (gpu::Byte*) vertexData);
1514+ details.colorBuffer->append(sizeof(int) * details.vertices, (gpu::Byte*) colorData);
15151515 delete[] vertexData;
15161516 delete[] colorData;
15171517
@@ -1581,10 +1581,10 @@ GeometryCache::BatchItemDetails::~BatchItemDetails() { · 63 unmodified lines
15811581
15821582 void GeometryCache::BatchItemDetails::clear() {
15831583 isCreated = false;
1584− verticesBuffer.clear();
1585− colorBuffer.clear();
1586− streamFormat.clear();
1587− stream.clear();
1584+ verticesBuffer.reset();
1585+ colorBuffer.reset();
1586+ streamFormat.reset();
1587+ stream.reset();
15881588 }
15891589
15901590 void GeometryCache::renderLine(const glm::vec3& p1, const glm::vec3& p2,
@@ -1653,8 +1653,8 @@ void GeometryCache::renderLine(const glm::vec3& p1, const glm::vec3& p2, · 62 unmodified lines
16531653 const int NUM_COLOR_SCALARS = 2;
16541654 int colors[NUM_COLOR_SCALARS] = { compactColor1, compactColor2 };
16551655
1656− details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
1657− details.colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
1656+ details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer);
1657+ details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
16581658
16591659 #ifdef WANT_DEBUG
16601660 if (id == UNKNOWN_ID) {
@@ -1745,8 +1745,8 @@ void GeometryCache::renderLine(const glm::vec2& p1, const glm::vec2& p2, · 84 unmodified lines
17451745 const int NUM_COLOR_SCALARS = 2;
17461746 int colors[NUM_COLOR_SCALARS] = { compactColor1, compactColor2 };
17471747
1748− details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Buffer::Byte*) vertexBuffer);
1749− details.colorBuffer->append(sizeof(colors), (gpu::Buffer::Byte*) colors);
1748+ details.verticesBuffer->append(sizeof(vertexBuffer), (gpu::Byte*) vertexBuffer);
1749+ details.colorBuffer->append(sizeof(colors), (gpu::Byte*) colors);
17501750
17511751 #ifdef WANT_DEBUG
17521752 if (id == UNKNOWN_ID) {
@@ -2234,10 +2234,10 @@ void NetworkGeometry::setGeometry(const FBXGeometry& geometry) { · 481 unmodified lines
22342234 int offset = 0;
22352235 foreach(const FBXMeshPart& part, mesh.parts) {
22362236 networkMesh._indexBuffer->setSubData(offset, part.quadIndices.size() * sizeof(int),
2237− (gpu::Resource::Byte*) part.quadIndices.constData());
2237+ (gpu::Byte*) part.quadIndices.constData());
22382238 offset += part.quadIndices.size() * sizeof(int);
22392239 networkMesh._indexBuffer->setSubData(offset, part.triangleIndices.size() * sizeof(int),
2240− (gpu::Resource::Byte*) part.triangleIndices.constData());
2240+ (gpu::Byte*) part.triangleIndices.constData());
22412241 offset += part.triangleIndices.size() * sizeof(int);
22422242 }
22432243 }
@@ -2256,19 +2256,19 @@ void NetworkGeometry::setGeometry(const FBXGeometry& geometry) { · 12 unmodified lines
22562256
22572257 networkMesh._vertexBuffer->resize(clusterWeightsOffset + mesh.clusterWeights.size() * sizeof(glm::vec4));
22582258
2259− networkMesh._vertexBuffer->setSubData(0, mesh.vertices.size() * sizeof(glm::vec3), (gpu::Resource::Byte*) mesh.vertices.constData());
2260− networkMesh._vertexBuffer->setSubData(normalsOffset, mesh.normals.size() * sizeof(glm::vec3), (gpu::Resource::Byte*) mesh.normals.constData());
2259+ networkMesh._vertexBuffer->setSubData(0, mesh.vertices.size() * sizeof(glm::vec3), (gpu::Byte*) mesh.vertices.constData());
2260+ networkMesh._vertexBuffer->setSubData(normalsOffset, mesh.normals.size() * sizeof(glm::vec3), (gpu::Byte*) mesh.normals.constData());
22612261 networkMesh._vertexBuffer->setSubData(tangentsOffset,
2262− mesh.tangents.size() * sizeof(glm::vec3), (gpu::Resource::Byte*) mesh.tangents.constData());
2263− networkMesh._vertexBuffer->setSubData(colorsOffset, mesh.colors.size() * sizeof(glm::vec3), (gpu::Resource::Byte*) mesh.colors.constData());
2262+ mesh.tangents.size() * sizeof(glm::vec3), (gpu::Byte*) mesh.tangents.constData());
2263+ networkMesh._vertexBuffer->setSubData(colorsOffset, mesh.colors.size() * sizeof(glm::vec3), (gpu::Byte*) mesh.colors.constData());
22642264 networkMesh._vertexBuffer->setSubData(texCoordsOffset,
2265− mesh.texCoords.size() * sizeof(glm::vec2), (gpu::Resource::Byte*) mesh.texCoords.constData());
2265+ mesh.texCoords.size() * sizeof(glm::vec2), (gpu::Byte*) mesh.texCoords.constData());
22662266 networkMesh._vertexBuffer->setSubData(texCoords1Offset,
2267− mesh.texCoords1.size() * sizeof(glm::vec2), (gpu::Resource::Byte*) mesh.texCoords1.constData());
2267+ mesh.texCoords1.size() * sizeof(glm::vec2), (gpu::Byte*) mesh.texCoords1.constData());
22682268 networkMesh._vertexBuffer->setSubData(clusterIndicesOffset,
2269− mesh.clusterIndices.size() * sizeof(glm::vec4), (gpu::Resource::Byte*) mesh.clusterIndices.constData());
2269+ mesh.clusterIndices.size() * sizeof(glm::vec4), (gpu::Byte*) mesh.clusterIndices.constData());
22702270 networkMesh._vertexBuffer->setSubData(clusterWeightsOffset,
2271− mesh.clusterWeights.size() * sizeof(glm::vec4), (gpu::Resource::Byte*) mesh.clusterWeights.constData());
2271+ mesh.clusterWeights.size() * sizeof(glm::vec4), (gpu::Byte*) mesh.clusterWeights.constData());
22722272
22732273 // otherwise, at least the cluster indices/weights can be static
22742274 networkMesh._vertexStream = gpu::BufferStreamPointer(new gpu::BufferStream());
@@ -2304,14 +2304,14 @@ void NetworkGeometry::setGeometry(const FBXGeometry& geometry) { · 29 unmodified lines
23042304 int clusterWeightsOffset = clusterIndicesOffset + mesh.clusterIndices.size() * sizeof(glm::vec4);
23052305
23062306 networkMesh._vertexBuffer->resize(clusterWeightsOffset + mesh.clusterWeights.size() * sizeof(glm::vec4));
2307− networkMesh._vertexBuffer->setSubData(0, mesh.tangents.size() * sizeof(glm::vec3), (gpu::Resource::Byte*) mesh.tangents.constData());
2308− networkMesh._vertexBuffer->setSubData(colorsOffset, mesh.colors.size() * sizeof(glm::vec3), (gpu::Resource::Byte*) mesh.colors.constData());
2307+ networkMesh._vertexBuffer->setSubData(0, mesh.tangents.size() * sizeof(glm::vec3), (gpu::Byte*) mesh.tangents.constData());
2308+ networkMesh._vertexBuffer->setSubData(colorsOffset, mesh.colors.size() * sizeof(glm::vec3), (gpu::Byte*) mesh.colors.constData());
23092309 networkMesh._vertexBuffer->setSubData(texCoordsOffset,
2310− mesh.texCoords.size() * sizeof(glm::vec2), (gpu::Resource::Byte*) mesh.texCoords.constData());
2310+ mesh.texCoords.size() * sizeof(glm::vec2), (gpu::Byte*) mesh.texCoords.constData());
23112311 networkMesh._vertexBuffer->setSubData(clusterIndicesOffset,
2312− mesh.clusterIndices.size() * sizeof(glm::vec4), (gpu::Resource::Byte*) mesh.clusterIndices.constData());
2312+ mesh.clusterIndices.size() * sizeof(glm::vec4), (gpu::Byte*) mesh.clusterIndices.constData());
23132313 networkMesh._vertexBuffer->setSubData(clusterWeightsOffset,
2314− mesh.clusterWeights.size() * sizeof(glm::vec4), (gpu::Resource::Byte*) mesh.clusterWeights.constData());
2314+ mesh.clusterWeights.size() * sizeof(glm::vec4), (gpu::Byte*) mesh.clusterWeights.constData());
23152315
23162316 networkMesh._vertexStream = gpu::BufferStreamPointer(new gpu::BufferStream());
23172317 if (mesh.tangents.size()) networkMesh._vertexStream->addBuffer(networkMesh._vertexBuffer, 0, sizeof(glm::vec3));