Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_image_proj.c
| Show First 20 Lines • Show All 881 Lines • ▼ Show 20 Lines | |||||
| * and doesn't need to be correct in relation to X and Y coords | * and doesn't need to be correct in relation to X and Y coords | ||||
| * (this is the case in perspective view) */ | * (this is the case in perspective view) */ | ||||
| static bool project_bucket_point_occluded(const ProjPaintState *ps, | static bool project_bucket_point_occluded(const ProjPaintState *ps, | ||||
| LinkNode *bucketFace, | LinkNode *bucketFace, | ||||
| const int orig_face, | const int orig_face, | ||||
| const float pixelScreenCo[4]) | const float pixelScreenCo[4]) | ||||
| { | { | ||||
| int isect_ret; | int isect_ret; | ||||
| const bool do_clip = ps->rv3d ? (ps->rv3d->rflag & RV3D_CLIPPING) != 0 : 0; | const bool do_clip = RV3D_CLIPPING_ENABLED(ps->v3d, ps->rv3d); | ||||
| /* we could return 0 for 1 face buckets, as long as this function assumes | /* we could return 0 for 1 face buckets, as long as this function assumes | ||||
| * that the point its testing is only every originated from an existing face */ | * that the point its testing is only every originated from an existing face */ | ||||
| for (; bucketFace; bucketFace = bucketFace->next) { | for (; bucketFace; bucketFace = bucketFace->next) { | ||||
| const int tri_index = POINTER_AS_INT(bucketFace->link); | const int tri_index = POINTER_AS_INT(bucketFace->link); | ||||
| if (orig_face != tri_index) { | if (orig_face != tri_index) { | ||||
| ▲ Show 20 Lines • Show All 2,120 Lines • ▼ Show 20 Lines | static void project_paint_face_init(const ProjPaintState *ps, | ||||
| /* for early loop exit */ | /* for early loop exit */ | ||||
| int has_x_isect = 0, has_isect = 0; | int has_x_isect = 0, has_isect = 0; | ||||
| float uv_clip[8][2]; | float uv_clip[8][2]; | ||||
| int uv_clip_tot; | int uv_clip_tot; | ||||
| const bool is_ortho = ps->is_ortho; | const bool is_ortho = ps->is_ortho; | ||||
| const bool is_flip_object = ps->is_flip_object; | const bool is_flip_object = ps->is_flip_object; | ||||
| const bool do_backfacecull = ps->do_backfacecull; | const bool do_backfacecull = ps->do_backfacecull; | ||||
| const bool do_clip = ps->rv3d ? ps->rv3d->rflag & RV3D_CLIPPING : 0; | const bool do_clip = RV3D_CLIPPING_ENABLED(ps->v3d, ps->rv3d); | ||||
| vCo[0] = ps->mvert_eval[lt_vtri[0]].co; | vCo[0] = ps->mvert_eval[lt_vtri[0]].co; | ||||
| vCo[1] = ps->mvert_eval[lt_vtri[1]].co; | vCo[1] = ps->mvert_eval[lt_vtri[1]].co; | ||||
| vCo[2] = ps->mvert_eval[lt_vtri[2]].co; | vCo[2] = ps->mvert_eval[lt_vtri[2]].co; | ||||
| /* Use lt_uv_pxoffset instead of lt_tri_uv so we can offset the UV half a pixel | /* Use lt_uv_pxoffset instead of lt_tri_uv so we can offset the UV half a pixel | ||||
| * this is done so we can avoid offsetting all the pixels by 0.5 which causes | * this is done so we can avoid offsetting all the pixels by 0.5 which causes | ||||
| * problems when wrapping negative coords */ | * problems when wrapping negative coords */ | ||||
| ▲ Show 20 Lines • Show All 3,725 Lines • Show Last 20 Lines | |||||