Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-02 02:58:40 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-02 02:58:40 +0300
commit4932269ec3fafb011f9f6973f4d9d61e3558369f (patch)
tree1926a11b1f8bd70c5c7c26f20e180e9acf592b96 /source/blender/draw/intern/draw_cache_extract_mesh.cc
parenta75e9863fef9a3f1f9495d66a21c85a7cc73367c (diff)
Fix T94952: normals maps don't render correctly with GPU subdivision
A simple case of missing the tangent VBO. The tangents are computed from the coarse mesh, and interpolated on the GPU for the final mesh. Code for initializing the tangents, and the vertex format for the VBO was factored out of the coarse extraction routine, to be shared with the subdivision routine.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.cc')
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.cc b/source/blender/draw/intern/draw_cache_extract_mesh.cc
index 4056f31bd5e..8b4962f24b0 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.cc
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc
@@ -835,6 +835,7 @@ static void mesh_buffer_cache_create_requested_subdiv(MeshBatchCache *cache,
EXTRACT_ADD_REQUESTED(vbo, edituv_data);
/* Make sure UVs are computed before edituv stuffs. */
EXTRACT_ADD_REQUESTED(vbo, uv);
+ EXTRACT_ADD_REQUESTED(vbo, tan);
EXTRACT_ADD_REQUESTED(vbo, edituv_stretch_area);
EXTRACT_ADD_REQUESTED(vbo, edituv_stretch_angle);
EXTRACT_ADD_REQUESTED(ibo, lines_adjacency);
@@ -848,6 +849,7 @@ static void mesh_buffer_cache_create_requested_subdiv(MeshBatchCache *cache,
return;
}
+ mesh_render_data_update_looptris(mr, MR_ITER_LOOPTRI, MR_DATA_LOOPTRI);
mesh_render_data_update_loose_geom(mr, mbc, MR_ITER_LEDGE | MR_ITER_LVERT, MR_DATA_LOOSE_GEOM);
void *data_stack = MEM_mallocN(extractors.data_size_total(), __func__);