From 4a7f37f6ed3569b12ff195081cca3f31430bef67 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 4 Jun 2013 17:10:57 +0000 Subject: Fix #35602: VBO + dynamic topology sculpt did not show specularity. --- source/blender/gpu/intern/gpu_buffers.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/gpu') 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); -- cgit v1.2.3