1
0
mirror of https://github.com/minetest/minetest.git synced 2024-11-18 00:08:22 +01: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:
sfan5 2024-02-19 15:43:33 +01:00
parent 5280863300
commit 09d542dfe0
4 changed files with 7 additions and 17 deletions

View File

@ -1816,10 +1816,6 @@ video_driver (Video driver) enum ,opengl,opengl3,ogles1,ogles2
# Use this to limit the performance impact of transparency depth sorting
transparency_sorting_distance (Transparency Sorting Distance) int 16 0 128
# Enable vertex buffer objects.
# This should greatly improve graphics performance.
enable_vbo (VBO) bool true
# Radius of cloud area stated in number of 64 node cloud squares.
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners.
cloud_radius (Cloud radius) int 12 1 62

View File

@ -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)

View File

@ -250,7 +250,6 @@ private:
v3f m_bounding_sphere_center;
bool m_enable_shaders;
bool m_enable_vbo;
// Must animate() be called before rendering?
bool m_has_animation;

View File

@ -51,7 +51,6 @@ void set_default_settings()
settings->setDefault("enable_mesh_cache", "false");
settings->setDefault("mesh_generation_interval", "0");
settings->setDefault("mesh_generation_threads", "0");
settings->setDefault("enable_vbo", "true");
settings->setDefault("free_move", "false");
settings->setDefault("pitch_move", "false");
settings->setDefault("fast_move", "false");