mirror of
https://github.com/bdnugget/freeminer.git
synced 2026-11-07 06:57:27 +00:00
farlights
This commit is contained in:
1 parent
38d9bb5882
commit
3843520d33
2 files changed
+7
-1
No files matched your search
@@ -1373,11 +1373,14 @@ static u32 transformBuffersToDrawOrder(
|
||||
new_buffer = true;
|
||||
else if (tmp->getVertexCount() + buf->getVertexCount() > U16_MAX)
|
||||
new_buffer = true;
|
||||
else if (tmp->getPrimitiveType() != buf->getPrimitiveType())
|
||||
new_buffer = true;
|
||||
if (new_buffer) {
|
||||
finish_buf();
|
||||
tmp = new scene::SMeshBuffer();
|
||||
tmp->setPrimitiveType(buf->getPrimitiveType());
|
||||
put_buffers.buf.push_back(tmp);
|
||||
assert(tmp->getPrimitiveType() == buf->getPrimitiveType());
|
||||
//assert(tmp->getPrimitiveType() == buf->getPrimitiveType());
|
||||
tmp->Material = buf->getMaterial();
|
||||
// preallocate approximately
|
||||
tmp->Vertices->Data.reserve(MYMIN(U16_MAX, total_vtx));
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "mapblock_mesh.h"
|
||||
#include "CMeshBuffer.h"
|
||||
#include "EPrimitiveTypes.h"
|
||||
#include "client.h"
|
||||
#include "client/clientmap.h"
|
||||
#include "mapblock.h"
|
||||
@@ -745,6 +746,7 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data):
|
||||
|
||||
if (static const auto farlights = g_settings->getBool("farlights"); farlights && far_step) {
|
||||
scene::SMeshBuffer *buffer = new scene::SMeshBuffer();
|
||||
buffer->PrimitiveType = scene::EPT_POINTS;
|
||||
buffer->Material.PointCloud = true;
|
||||
buffer->Material.BackfaceCulling = false;
|
||||
buffer->Material.FogEnable = true;
|
||||
@@ -788,6 +790,7 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data):
|
||||
}
|
||||
}
|
||||
mesh->addMeshBuffer(buffer);
|
||||
buffer->drop();
|
||||
}
|
||||
|
||||
if (mesh) {
|
||||
|
||||
Reference in new issue
Block a user