mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
fix bug in mesh
This commit is contained in:
parent
6a3203475a
commit
fd19c63449
2 changed files with 20 additions and 9 deletions
|
@ -97,24 +97,35 @@ void RenderablePolyVoxEntityItem::getModel() {
|
|||
mesh->setVertexBuffer(gpu::BufferView(vertexBufferPtr,
|
||||
0,
|
||||
vertexBufferPtr->getSize() - sizeof(float) * 3,
|
||||
sizeof(float) * 3,
|
||||
// sizeof(PolyVox::PositionMaterialNormal),
|
||||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)));
|
||||
sizeof(PolyVox::PositionMaterialNormal),
|
||||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)
|
||||
));
|
||||
mesh->addAttribute(gpu::Stream::NORMAL,
|
||||
gpu::BufferView(vertexBufferPtr,
|
||||
sizeof(float) * 3,
|
||||
vertexBufferPtr->getSize() - sizeof(float) * 3,
|
||||
sizeof(float) * 7,
|
||||
// sizeof(PolyVox::PositionMaterialNormal),
|
||||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)));
|
||||
sizeof(PolyVox::PositionMaterialNormal),
|
||||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)
|
||||
));
|
||||
|
||||
|
||||
qDebug() << "-------------XXXXXXXXXXXXXXXXXXXX-------------------";
|
||||
qDebug() << "---- vecIndices.size() =" << vecIndices.size();
|
||||
qDebug() << "---- sizeof(vecIndices[0]) =" << sizeof(vecIndices[0]);
|
||||
qDebug() << "---- vecVertices.size() =" << vecVertices.size();
|
||||
// [DEBUG] [05/19 20:46:38] ---- vecIndices.size() = 101556
|
||||
// [DEBUG] [05/19 20:46:38] ---- vecVertices.size() = 67704
|
||||
qDebug() << "---- sizeof(vecVertices[0]) =" << sizeof(vecVertices[0]);
|
||||
qDebug() << "---- sizeof(uint32_t) =" << sizeof(uint32_t);
|
||||
qDebug() << "---- sizeof(float) =" << sizeof(float);
|
||||
qDebug() << "---- sizeof(PolyVox::PositionMaterialNormal) =" << sizeof(PolyVox::PositionMaterialNormal);
|
||||
|
||||
// -------------XXXXXXXXXXXXXXXXXXXX-------------------
|
||||
// ---- vecIndices.size() = 25524
|
||||
// ---- sizeof(vecIndices[0]) = 4
|
||||
// ---- vecVertices.size() = 17016
|
||||
// ---- sizeof(vecVertices[0]) = 28
|
||||
// ---- sizeof(uint32_t) = 4
|
||||
// ---- sizeof(float) = 4
|
||||
// ---- sizeof(PolyVox::PositionMaterialNormal) = 28
|
||||
|
||||
_modelGeometry.setMesh(meshPtr);
|
||||
_needsModelReload = false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
void setVertexBuffer(const BufferView& buffer);
|
||||
const BufferView& getVertexBuffer() const { return _vertexBuffer; }
|
||||
uint getNumVertices() const { return _vertexBuffer.getNumElements(); }
|
||||
bool hasVertexData() const { return !_vertexBuffer._buffer; }
|
||||
bool hasVertexData() const { return _vertexBuffer._buffer.get() != nullptr; }
|
||||
|
||||
// Attribute Buffers
|
||||
int getNumAttributes() const { return _attributeBuffers.size(); }
|
||||
|
|
Loading…
Reference in a new issue