Follow-up of 1eac357739
- Fixed color of volumes after creation
This commit is contained in:
parent
b4516396fe
commit
b155d1a2c3
1 changed files with 2 additions and 4 deletions
|
@ -771,15 +771,14 @@ int GLVolumeCollection::load_object_volume(
|
||||||
const TriangleMesh &mesh = model_volume->mesh();
|
const TriangleMesh &mesh = model_volume->mesh();
|
||||||
this->volumes.emplace_back(new GLVolume());
|
this->volumes.emplace_back(new GLVolume());
|
||||||
GLVolume& v = *this->volumes.back();
|
GLVolume& v = *this->volumes.back();
|
||||||
|
v.set_color(color_from_model_volume(*model_volume));
|
||||||
#if ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
#if ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
||||||
#if ENABLE_SMOOTH_NORMALS
|
#if ENABLE_SMOOTH_NORMALS
|
||||||
v.model.init_from(mesh, true);
|
v.model.init_from(mesh, true);
|
||||||
#else
|
#else
|
||||||
v.model.init_from(mesh);
|
v.model.init_from(mesh);
|
||||||
#endif // ENABLE_SMOOTH_NORMALS
|
#endif // ENABLE_SMOOTH_NORMALS
|
||||||
v.model.set_color(color_from_model_volume(*model_volume));
|
|
||||||
#else
|
#else
|
||||||
v.set_color(color_from_model_volume(*model_volume));
|
|
||||||
#if ENABLE_SMOOTH_NORMALS
|
#if ENABLE_SMOOTH_NORMALS
|
||||||
v.indexed_vertex_array.load_mesh(mesh, true);
|
v.indexed_vertex_array.load_mesh(mesh, true);
|
||||||
#else
|
#else
|
||||||
|
@ -1113,7 +1112,6 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
|
||||||
glcheck();
|
glcheck();
|
||||||
|
|
||||||
#if ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
#if ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
||||||
if (volume.first->model.is_initialized())
|
|
||||||
volume.first->model.set_color(volume.first->render_color);
|
volume.first->model.set_color(volume.first->render_color);
|
||||||
#endif // ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
#endif // ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
||||||
volume.first->render();
|
volume.first->render();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue