mirror of
https://github.com/minetest/minetest.git
synced 2025-01-07 16:40:23 +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:
parent
5280863300
commit
09d542dfe0
@ -1816,10 +1816,6 @@ video_driver (Video driver) enum ,opengl,opengl3,ogles1,ogles2
|
|||||||
# Use this to limit the performance impact of transparency depth sorting
|
# Use this to limit the performance impact of transparency depth sorting
|
||||||
transparency_sorting_distance (Transparency Sorting Distance) int 16 0 128
|
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.
|
# 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.
|
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners.
|
||||||
cloud_radius (Cloud radius) int 12 1 62
|
cloud_radius (Cloud radius) int 12 1 62
|
||||||
|
@ -645,7 +645,6 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
|
|||||||
for (auto &m : m_mesh)
|
for (auto &m : m_mesh)
|
||||||
m = new scene::SMesh();
|
m = new scene::SMesh();
|
||||||
m_enable_shaders = data->m_use_shaders;
|
m_enable_shaders = data->m_use_shaders;
|
||||||
m_enable_vbo = g_settings->getBool("enable_vbo");
|
|
||||||
|
|
||||||
auto mesh_grid = client->getMeshGrid();
|
auto mesh_grid = client->getMeshGrid();
|
||||||
v3s16 bp = data->m_blockpos;
|
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);
|
m_bounding_radius = std::sqrt(collector.m_bounding_radius_sq);
|
||||||
|
|
||||||
for (int layer = 0; layer < MAX_TILE_LAYERS; layer++) {
|
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++)
|
for(u32 i = 0; i < collector.prebuffers[layer].size(); i++)
|
||||||
{
|
{
|
||||||
PreMeshBuffer &p = collector.prebuffers[layer][i];
|
PreMeshBuffer &p = collector.prebuffers[layer][i];
|
||||||
@ -783,8 +784,6 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
|
|||||||
p.layer.applyMaterialOptions(material);
|
p.layer.applyMaterialOptions(material);
|
||||||
}
|
}
|
||||||
|
|
||||||
scene::SMesh *mesh = (scene::SMesh *)m_mesh[layer];
|
|
||||||
|
|
||||||
scene::SMeshBuffer *buf = new scene::SMeshBuffer();
|
scene::SMeshBuffer *buf = new scene::SMeshBuffer();
|
||||||
buf->Material = material;
|
buf->Material = material;
|
||||||
if (p.layer.isTransparent()) {
|
if (p.layer.isTransparent()) {
|
||||||
@ -808,10 +807,9 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs
|
|||||||
buf->drop();
|
buf->drop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_mesh[layer]) {
|
if (mesh) {
|
||||||
// Use VBO for mesh (this just would set this for ever buffer)
|
// Use VBO for mesh (this just would set this for ever buffer)
|
||||||
if (m_enable_vbo)
|
mesh->setHardwareMappingHint(scene::EHM_STATIC);
|
||||||
m_mesh[layer]->setHardwareMappingHint(scene::EHM_STATIC);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,15 +894,13 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack,
|
|||||||
|
|
||||||
// Day-night transition
|
// Day-night transition
|
||||||
if (!m_enable_shaders && (daynight_ratio != m_last_daynight_ratio)) {
|
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;
|
video::SColorf day_color;
|
||||||
get_sunlight_color(&day_color, daynight_ratio);
|
get_sunlight_color(&day_color, daynight_ratio);
|
||||||
|
|
||||||
for (auto &daynight_diff : m_daynight_diffs) {
|
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);
|
getMeshBuffer(daynight_diff.first.second);
|
||||||
video::S3DVertex *vertices = (video::S3DVertex *)buf->getVertices();
|
video::S3DVertex *vertices = (video::S3DVertex *)buf->getVertices();
|
||||||
for (const auto &j : daynight_diff.second)
|
for (const auto &j : daynight_diff.second)
|
||||||
|
@ -250,7 +250,6 @@ private:
|
|||||||
v3f m_bounding_sphere_center;
|
v3f m_bounding_sphere_center;
|
||||||
|
|
||||||
bool m_enable_shaders;
|
bool m_enable_shaders;
|
||||||
bool m_enable_vbo;
|
|
||||||
|
|
||||||
// Must animate() be called before rendering?
|
// Must animate() be called before rendering?
|
||||||
bool m_has_animation;
|
bool m_has_animation;
|
||||||
|
@ -51,7 +51,6 @@ void set_default_settings()
|
|||||||
settings->setDefault("enable_mesh_cache", "false");
|
settings->setDefault("enable_mesh_cache", "false");
|
||||||
settings->setDefault("mesh_generation_interval", "0");
|
settings->setDefault("mesh_generation_interval", "0");
|
||||||
settings->setDefault("mesh_generation_threads", "0");
|
settings->setDefault("mesh_generation_threads", "0");
|
||||||
settings->setDefault("enable_vbo", "true");
|
|
||||||
settings->setDefault("free_move", "false");
|
settings->setDefault("free_move", "false");
|
||||||
settings->setDefault("pitch_move", "false");
|
settings->setDefault("pitch_move", "false");
|
||||||
settings->setDefault("fast_move", "false");
|
settings->setDefault("fast_move", "false");
|
||||||
|
Loading…
Reference in New Issue
Block a user