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:
authorCampbell Barton <ideasman42@gmail.com>2018-10-19 01:07:40 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-19 01:18:22 +0300
commita30c9f710a64d0adca1597c0d0404713a26a401e (patch)
tree40fc7724b8a362dc08745ad766e6ee7e025479db /source/blender/blenkernel/intern/mask_rasterize.c
parent642b77e874e787b04e28dc68af3ac4bd7aed5b2e (diff)
Partial revert '#if 0' cleanup
Partially revert 41216d5ad4c722e2ad9f15c968af454fc7566d5e Some of this code had comments to be left as is for readability, or comment the code should be kept. Other functions were only for debugging.
Diffstat (limited to 'source/blender/blenkernel/intern/mask_rasterize.c')
-rw-r--r--source/blender/blenkernel/intern/mask_rasterize.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index fc1412c1baa..ecdd30edc36 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -1200,6 +1200,17 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
/* functions that run inside the sampling thread (keep fast!) */
/* --------------------------------------------------------------------- */
+/* 2D ray test */
+#if 0
+static float maskrasterize_layer_z_depth_tri(const float pt[2],
+ const float v1[3], const float v2[3], const float v3[3])
+{
+ float w[3];
+ barycentric_weights_v2(v1, v2, v3, pt, w);
+ return (v1[2] * w[0]) + (v2[2] * w[1]) + (v3[2] * w[2]);
+}
+#endif
+
static float maskrasterize_layer_z_depth_quad(const float pt[2],
const float v1[3], const float v2[3], const float v3[3], const float v4[3])
{
@@ -1214,10 +1225,24 @@ static float maskrasterize_layer_isect(unsigned int *face, float (*cos)[3], cons
/* we always cast from same place only need xy */
if (face[3] == TRI_VERT) {
/* --- tri --- */
+
+#if 0
+ /* not essential but avoids unneeded extra lookups */
+ if ((cos[0][2] < dist_orig) ||
+ (cos[1][2] < dist_orig) ||
+ (cos[2][2] < dist_orig))
+ {
+ if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) {
+ /* we know all tris are close for now */
+ return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]);
+ }
+ }
+#else
/* we know all tris are close for now */
if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) {
return 0.0f;
}
+#endif
}
else {
/* --- quad --- */