Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/cdderivedmesh.c
| Show First 20 Lines • Show All 747 Lines • ▼ Show 20 Lines | static void cdDM_drawMappedFaces( | ||||
| tot_tri_elem = dm->drawObject->tot_triangle_point; | tot_tri_elem = dm->drawObject->tot_triangle_point; | ||||
| if (tot_tri_elem == 0) { | if (tot_tri_elem == 0) { | ||||
| /* avoid buffer problems in following code */ | /* avoid buffer problems in following code */ | ||||
| } | } | ||||
| else if (setDrawOptions == NULL) { | else if (setDrawOptions == NULL) { | ||||
| /* just draw the entire face array */ | /* just draw the entire face array */ | ||||
| glEnable(GL_BLEND); | |||||
| glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | |||||
| GPU_buffer_draw_elements(dm->drawObject->triangles, GL_TRIANGLES, 0, tot_tri_elem); | GPU_buffer_draw_elements(dm->drawObject->triangles, GL_TRIANGLES, 0, tot_tri_elem); | ||||
| glDisable(GL_BLEND); | |||||
| } | } | ||||
| else { | else { | ||||
| for (mat_index = 0; mat_index < dm->drawObject->totmaterial; mat_index++) { | for (mat_index = 0; mat_index < dm->drawObject->totmaterial; mat_index++) { | ||||
| GPUBufferMaterial *bufmat = dm->drawObject->materials + mat_index; | GPUBufferMaterial *bufmat = dm->drawObject->materials + mat_index; | ||||
| DMDrawOption draw_option = DM_DRAW_OPTION_NORMAL; | DMDrawOption draw_option = DM_DRAW_OPTION_NORMAL; | ||||
| int next_actualFace = bufmat->polys[0]; | int next_actualFace = bufmat->polys[0]; | ||||
| totpoly = use_hide ? bufmat->totvisiblepolys : bufmat->totpolys; | totpoly = use_hide ? bufmat->totvisiblepolys : bufmat->totpolys; | ||||
| ▲ Show 20 Lines • Show All 755 Lines • ▼ Show 20 Lines | static void cdDM_buffer_copy_mcol( | ||||
| const MPoly *mpoly = dm->getPolyArray(dm); | const MPoly *mpoly = dm->getPolyArray(dm); | ||||
| totpoly = dm->getNumPolys(dm); | totpoly = dm->getNumPolys(dm); | ||||
| start = 0; | start = 0; | ||||
| for (i = 0; i < totpoly; i++, mpoly++) { | for (i = 0; i < totpoly; i++, mpoly++) { | ||||
| for (j = 0; j < mpoly->totloop; j++) { | for (j = 0; j < mpoly->totloop; j++) { | ||||
| copy_v3_v3_uchar(&varray[start], &mloopcol[mpoly->loopstart + j].r); | copy_v4_v4_uchar(&varray[start], &mloopcol[mpoly->loopstart + j].r); | ||||
| start += 3; | start += 4; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void cdDM_buffer_copy_edge( | static void cdDM_buffer_copy_edge( | ||||
| DerivedMesh *dm, unsigned int *varray) | DerivedMesh *dm, unsigned int *varray) | ||||
| { | { | ||||
| MEdge *medge, *medge_base; | MEdge *medge, *medge_base; | ||||
| ▲ Show 20 Lines • Show All 2,180 Lines • Show Last 20 Lines | |||||