diff options
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index ff48e273619..1b1d52728e8 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -2311,6 +2311,8 @@ static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers) void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial, int wireframe) { + /* sets material from the first face, to solve properly face would need to + * be sorted in buckets by materials */ if (buffers->totface) { const MFace *f = &buffers->mface[buffers->face_indices[0]]; if (!setMaterial(f->mat_nr + 1, NULL)) @@ -2321,6 +2323,10 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial, if (!setMaterial(f->mat_nr + 1, NULL)) return; } + else { + if (!setMaterial(1, NULL)) + return; + } glShadeModel((buffers->smooth || buffers->totface) ? GL_SMOOTH : GL_FLAT); |