mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Drop enable_vbo setting
Consistently applying this setting requires some code work, because Irrlicht does not provide a global toggle. At the same time I don't see any reason for someone to disable this.
This commit is contained in:
parent
5280863300
commit
09d542dfe0
4 changed files with 7 additions and 17 deletions
|
@ -645,7 +645,6 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
|
|||
for (auto &m : m_mesh)
|
||||
m = new scene::SMesh();
|
||||
m_enable_shaders = data->m_use_shaders;
|
||||
m_enable_vbo = g_settings->getBool("enable_vbo");
|
||||
|
||||
auto mesh_grid = client->getMeshGrid();
|
||||
v3s16 bp = data->m_blockpos;
|
||||
|
@ -692,6 +691,8 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
|
|||
m_bounding_radius = std::sqrt(collector.m_bounding_radius_sq);
|
||||
|
||||
for (int layer = 0; layer < MAX_TILE_LAYERS; layer++) {
|
||||
scene::SMesh *mesh = (scene::SMesh *)m_mesh[layer];
|
||||
|
||||
for(u32 i = 0; i < collector.prebuffers[layer].size(); i++)
|
||||
{
|
||||
PreMeshBuffer &p = collector.prebuffers[layer][i];
|
||||
|
@ -783,8 +784,6 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
|
|||
p.layer.applyMaterialOptions(material);
|
||||
}
|
||||
|
||||
scene::SMesh *mesh = (scene::SMesh *)m_mesh[layer];
|
||||
|
||||
scene::SMeshBuffer *buf = new scene::SMeshBuffer();
|
||||
buf->Material = material;
|
||||
if (p.layer.isTransparent()) {
|
||||
|
@ -808,10 +807,9 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
|
|||
buf->drop();
|
||||
}
|
||||
|
||||
if (m_mesh[layer]) {
|
||||
if (mesh) {
|
||||
// Use VBO for mesh (this just would set this for ever buffer)
|
||||
if (m_enable_vbo)
|
||||
m_mesh[layer]->setHardwareMappingHint(scene::EHM_STATIC);
|
||||
mesh->setHardwareMappingHint(scene::EHM_STATIC);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -896,15 +894,13 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack,
|
|||
|
||||
// Day-night transition
|
||||
if (!m_enable_shaders && (daynight_ratio != m_last_daynight_ratio)) {
|
||||
// Force reload mesh to VBO
|
||||
if (m_enable_vbo)
|
||||
for (scene::IMesh *m : m_mesh)
|
||||
m->setDirty();
|
||||
video::SColorf day_color;
|
||||
get_sunlight_color(&day_color, daynight_ratio);
|
||||
|
||||
for (auto &daynight_diff : m_daynight_diffs) {
|
||||
scene::IMeshBuffer *buf = m_mesh[daynight_diff.first.first]->
|
||||
auto *mesh = m_mesh[daynight_diff.first.first];
|
||||
mesh->setDirty(scene::EBT_VERTEX); // force reload to VBO
|
||||
scene::IMeshBuffer *buf = mesh->
|
||||
getMeshBuffer(daynight_diff.first.second);
|
||||
video::S3DVertex *vertices = (video::S3DVertex *)buf->getVertices();
|
||||
for (const auto &j : daynight_diff.second)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue