|
8 | 8 | /// @parblock
|
9 | 9 | ///
|
10 | 10 | /// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
|
11 |
| -/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd. |
| 11 | +/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd. |
12 | 12 | ///
|
13 | 13 | /// POV-Ray is free software: you can redistribute it and/or modify
|
14 | 14 | /// it under the terms of the GNU Affero General Public License as
|
@@ -136,8 +136,8 @@ bool Find_Intersection(Intersection *isect, ObjectPtr object, const Ray& ray, Tr
|
136 | 136 | while(depthstack->size() > 0)
|
137 | 137 | {
|
138 | 138 | tmpDepth = depthstack->top().Depth;
|
139 |
| - // TODO FIXME - This was SMALL_TOLERANCE, but that's too rough for some scenes [cjc] need to check what it was in the old code [trf] |
140 |
| - if(tmpDepth < closest && (ray.IsSubsurfaceRay() || tmpDepth >= MIN_ISECT_DEPTH)) |
| 139 | + POV_ASSERT(tmpDepth < 0.0); // Shape code should never return intersections <= 0.0 |
| 140 | + if (tmpDepth < closest) |
141 | 141 | {
|
142 | 142 | *isect = depthstack->top();
|
143 | 143 | closest = tmpDepth;
|
@@ -190,8 +190,8 @@ bool Find_Intersection(Intersection *isect, ObjectPtr object, const Ray& ray, co
|
190 | 190 | while(depthstack->size() > 0)
|
191 | 191 | {
|
192 | 192 | tmpDepth = depthstack->top().Depth;
|
193 |
| - // TODO FIXME - This was SMALL_TOLERANCE, but that's too rough for some scenes [cjc] need to check what it was in the old code [trf] |
194 |
| - if(tmpDepth < closest && (ray.IsSubsurfaceRay() || tmpDepth >= MIN_ISECT_DEPTH) && postcondition(ray, object, tmpDepth)) |
| 193 | + POV_ASSERT(tmpDepth < 0.0); // Shape code should never return intersections <= 0.0 |
| 194 | + if (tmpDepth < closest && postcondition(ray, object, tmpDepth)) |
195 | 195 | {
|
196 | 196 | *isect = depthstack->top();
|
197 | 197 | closest = tmpDepth;
|
@@ -236,8 +236,8 @@ bool Find_Intersection(Intersection *isect, ObjectPtr object, const Ray& ray, BB
|
236 | 236 | while(depthstack->size() > 0)
|
237 | 237 | {
|
238 | 238 | tmpDepth = depthstack->top().Depth;
|
239 |
| - // TODO FIXME - This was SMALL_TOLERANCE, but that's too rough for some scenes [cjc] need to check what it was in the old code [trf] |
240 |
| - if(tmpDepth < closest && (ray.IsSubsurfaceRay() || tmpDepth >= MIN_ISECT_DEPTH)) |
| 239 | + POV_ASSERT(tmpDepth < 0.0); // Shape code should never return intersections <= 0.0 |
| 240 | + if (tmpDepth < closest) |
241 | 241 | {
|
242 | 242 | *isect = depthstack->top();
|
243 | 243 | closest = tmpDepth;
|
@@ -282,8 +282,8 @@ bool Find_Intersection(Intersection *isect, ObjectPtr object, const Ray& ray, BB
|
282 | 282 | while(depthstack->size() > 0)
|
283 | 283 | {
|
284 | 284 | tmpDepth = depthstack->top().Depth;
|
285 |
| - // TODO FIXME - This was SMALL_TOLERANCE, but that's too rough for some scenes [cjc] need to check what it was in the old code [trf] |
286 |
| - if(tmpDepth < closest && (ray.IsSubsurfaceRay() || tmpDepth >= MIN_ISECT_DEPTH) && postcondition(ray, object, tmpDepth)) |
| 285 | + POV_ASSERT(tmpDepth < 0.0); // Shape code should never return intersections <= 0.0 |
| 286 | + if (tmpDepth < closest && postcondition(ray, object, tmpDepth)) |
287 | 287 | {
|
288 | 288 | *isect = depthstack->top();
|
289 | 289 | closest = tmpDepth;
|
@@ -903,25 +903,25 @@ ObjectPtr CompoundObject::Invert()
|
903 | 903 |
|
904 | 904 | bool ObjectBase::Intersect_BBox(BBoxDirection variant, const BBoxVector3d& origin, const BBoxVector3d& invdir, BBoxScalar maxd) const
|
905 | 905 | {
|
906 |
| - // TODO FIXME - This was SMALL_TOLERANCE, but that's too rough for some scenes [cjc] need to check what it was in the old code [trf] |
| 906 | + // reverted to SMALL_TOLERANCE over v3.7 MIN_ISECT_DEPTH, for FS324 [jg] old code [trf] |
907 | 907 | switch(variant)
|
908 | 908 | {
|
909 | 909 | case BBOX_DIR_X0Y0Z0: // 000
|
910 |
| - return Intersect_BBox_Dir<0, 0, 0>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 910 | + return Intersect_BBox_Dir<0, 0, 0>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
911 | 911 | case BBOX_DIR_X0Y0Z1: // 001
|
912 |
| - return Intersect_BBox_Dir<0, 0, 1>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 912 | + return Intersect_BBox_Dir<0, 0, 1>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
913 | 913 | case BBOX_DIR_X0Y1Z0: // 010
|
914 |
| - return Intersect_BBox_Dir<0, 1, 0>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 914 | + return Intersect_BBox_Dir<0, 1, 0>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
915 | 915 | case BBOX_DIR_X0Y1Z1: // 011
|
916 |
| - return Intersect_BBox_Dir<0, 1, 1>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 916 | + return Intersect_BBox_Dir<0, 1, 1>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
917 | 917 | case BBOX_DIR_X1Y0Z0: // 100
|
918 |
| - return Intersect_BBox_Dir<1, 0, 0>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 918 | + return Intersect_BBox_Dir<1, 0, 0>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
919 | 919 | case BBOX_DIR_X1Y0Z1: // 101
|
920 |
| - return Intersect_BBox_Dir<1, 0, 1>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 920 | + return Intersect_BBox_Dir<1, 0, 1>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
921 | 921 | case BBOX_DIR_X1Y1Z0: // 110
|
922 |
| - return Intersect_BBox_Dir<1, 1, 0>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 922 | + return Intersect_BBox_Dir<1, 1, 0>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
923 | 923 | case BBOX_DIR_X1Y1Z1: // 111
|
924 |
| - return Intersect_BBox_Dir<1, 1, 1>(BBox, origin, invdir, MIN_ISECT_DEPTH, maxd); |
| 924 | + return Intersect_BBox_Dir<1, 1, 1>(BBox, origin, invdir, SMALL_TOLERANCE, maxd); |
925 | 925 | }
|
926 | 926 |
|
927 | 927 | return false; // unreachable
|
|
0 commit comments