Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/editmesh_tangent.c
| Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | #endif | ||||
| float *pRes; | float *pRes; | ||||
| finally: | finally: | ||||
| pRes = pMesh->tangent[BM_elem_index_get(l)]; | pRes = pMesh->tangent[BM_elem_index_get(l)]; | ||||
| copy_v3_v3(pRes, fvTangent); | copy_v3_v3(pRes, fvTangent); | ||||
| pRes[3] = fSign; | pRes[3] = fSign; | ||||
| } | } | ||||
| static void emDM_calc_loop_tangents_thread(TaskPool *__restrict UNUSED(pool), | static void emDM_calc_loop_tangents_thread(TaskPool *__restrict UNUSED(pool), void *taskdata) | ||||
| void *taskdata, | |||||
| int UNUSED(threadid)) | |||||
| { | { | ||||
| struct SGLSLEditMeshToTangent *mesh2tangent = taskdata; | struct SGLSLEditMeshToTangent *mesh2tangent = taskdata; | ||||
| /* new computation method */ | /* new computation method */ | ||||
| { | { | ||||
| SMikkTSpaceContext sContext = {NULL}; | SMikkTSpaceContext sContext = {NULL}; | ||||
| SMikkTSpaceInterface sInterface = {NULL}; | SMikkTSpaceInterface sInterface = {NULL}; | ||||
| sContext.m_pUserData = mesh2tangent; | sContext.m_pUserData = mesh2tangent; | ||||
| sContext.m_pInterface = &sInterface; | sContext.m_pInterface = &sInterface; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (em->tottri != bm->totface) { | ||||
| num_face_as_quad_map = i; | num_face_as_quad_map = i; | ||||
| } | } | ||||
| else { | else { | ||||
| num_face_as_quad_map = totface; | num_face_as_quad_map = totface; | ||||
| } | } | ||||
| #endif | #endif | ||||
| /* Calculation */ | /* Calculation */ | ||||
| if (em->tottri != 0) { | if (em->tottri != 0) { | ||||
| TaskScheduler *scheduler = BLI_task_scheduler_get(); | |||||
| TaskPool *task_pool; | TaskPool *task_pool; | ||||
| task_pool = BLI_task_pool_create(scheduler, NULL, TASK_PRIORITY_LOW); | task_pool = BLI_task_pool_create(NULL, TASK_PRIORITY_LOW); | ||||
| tangent_mask_curr = 0; | tangent_mask_curr = 0; | ||||
| /* Calculate tangent layers */ | /* Calculate tangent layers */ | ||||
| SGLSLEditMeshToTangent data_array[MAX_MTFACE]; | SGLSLEditMeshToTangent data_array[MAX_MTFACE]; | ||||
| int index = 0; | int index = 0; | ||||
| int n = 0; | int n = 0; | ||||
| CustomData_update_typemap(loopdata_out); | CustomData_update_typemap(loopdata_out); | ||||
| const int tangent_layer_num = CustomData_number_of_layers(loopdata_out, CD_TANGENT); | const int tangent_layer_num = CustomData_number_of_layers(loopdata_out, CD_TANGENT); | ||||
| ▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines | |||||