diff --git a/apps/tutorials/pe/02_ConfinedGasExtended.cfg b/apps/tutorials/pe/02_ConfinedGasExtended.cfg index 06f681aa9a8881d1619ea01b562fcc0c4af86aca..1e1b9eb004a06fb94697ee26020344eeed99cf0a 100644 --- a/apps/tutorials/pe/02_ConfinedGasExtended.cfg +++ b/apps/tutorials/pe/02_ConfinedGasExtended.cfg @@ -20,7 +20,6 @@ Raytracing lookAt < -5, 10, 10 >; upVector < 0, 0, 1 >; antiAliasFactor 2; - blockAABBIntersectionPadding 0.8; reductionMethod MPI_REDUCE; Lighting { pointLightOrigin < -10, 10, 15 >; diff --git a/src/pe/raytracing/Raytracer.cpp b/src/pe/raytracing/Raytracer.cpp index eceba32b64d2fe30bb41207d4a9c9ff48ca51ad6..cc55068e192bc63816936f8a4281b45941d47506 100644 --- a/src/pe/raytracing/Raytracer.cpp +++ b/src/pe/raytracing/Raytracer.cpp @@ -62,9 +62,6 @@ void BodyIntersectionInfo_Comparator_MPI_OP( BodyIntersectionInfo *in, BodyInter * \param lookAtPoint Point the camera looks at in the global world frame. * \param upVector Vector indicating the upwards direction of the camera. * \param backgroundColor Background color of the scene. - * \param blockAABBIntersectionPadding The padding applied in block AABB intersection pretesting. - * Set it to the value of the farthest distance a object might protrude from - * its containing block. * \param bodyToShadingParamsFunc A function mapping a BodyID to ShadingParameters for this body. * This can be used to customize the color and shading of bodies. * \param isBodyVisibleFunc A function which returns a boolean indicating if a given body should be visible @@ -78,7 +75,6 @@ Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID st const Vec3& cameraPosition, const Vec3& lookAtPoint, const Vec3& upVector, const Lighting& lighting, const Color& backgroundColor, - real_t blockAABBIntersectionPadding, std::function<ShadingParameters (const BodyID)> bodyToShadingParamsFunc, std::function<bool (const BodyID)> isBodyVisibleFunc) : forest_(forest), storageID_(storageID), globalBodyStorage_(globalBodyStorage), ccdID_(ccdID), @@ -87,7 +83,6 @@ Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID st cameraPosition_(cameraPosition), lookAtPoint_(lookAtPoint), upVector_(upVector), lighting_(lighting), backgroundColor_(backgroundColor), - blockAABBIntersectionPadding_(blockAABBIntersectionPadding), imageOutputEnabled_(true), localImageOutputEnabled_(false), imageOutputDirectory_("."), @@ -118,8 +113,7 @@ Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID st * * The config block has to contain image_x (int), image_y (int) and fov_vertical (real, in degrees). * Additionally a vector of reals for each of cameraPosition, lookAt and the upVector for the view setup are required. - * Optional is antiAliasFactor (uint, usually between 1 and 4) for supersampling, blockAABBIntersectionPadding (real) - * and backgroundColor (Vec3). + * Optional is antiAliasFactor (uint, usually between 1 and 4) for supersampling and backgroundColor (Vec3). * For image output after raytracing, set image_output_directory (string); for local image output additionally set * local_image_output_enabled (bool) to true. outputFilenameTimestepZeroPadding (int) sets the zero padding * for timesteps in output filenames. @@ -162,8 +156,6 @@ Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID st lighting_ = Lighting(config.getBlock("Lighting")); backgroundColor_ = config.getParameter<Color>("backgroundColor", Vec3(real_t(0.1), real_t(0.1), real_t(0.1))); - blockAABBIntersectionPadding_ = config.getParameter<real_t>("blockAABBIntersectionPadding", real_t(0.0)); - std::string raytracingAlgorithm = config.getParameter<std::string>("raytracingAlgorithm", "RAYTRACE_HASHGRIDS"); if (raytracingAlgorithm == "RAYTRACE_HASHGRIDS") { setRaytracingAlgorithm(RAYTRACE_HASHGRIDS); diff --git a/src/pe/raytracing/Raytracer.h b/src/pe/raytracing/Raytracer.h index 4d64a371f3e6eae4b61c93c8adaf434f2720cc66..78fde4b90e06bfb22ec30f6f054f018a04ce445d 100644 --- a/src/pe/raytracing/Raytracer.h +++ b/src/pe/raytracing/Raytracer.h @@ -88,7 +88,6 @@ public: const Vec3& cameraPosition, const Vec3& lookAtPoint, const Vec3& upVector, const Lighting& lighting, const Color& backgroundColor = Color(real_t(0.1), real_t(0.1), real_t(0.1)), - real_t blockAABBIntersectionPadding = real_t(0.0), std::function<ShadingParameters (const BodyID)> bodyToShadingParamsFunc = defaultBodyTypeDependentShadingParams, std::function<bool (const BodyID)> isBodyVisibleFunc = defaultIsBodyVisible); @@ -119,8 +118,6 @@ private: Vec3 upVector_; //!< The vector indicating the upwards direction of the camera. Lighting lighting_; //!< The lighting of the scene. Color backgroundColor_; //!< Background color of the scene. - real_t blockAABBIntersectionPadding_; /*!< The padding applied in block AABB intersection pretesting, as - * some objects within a block might protrude from the block's AABB.*/ bool imageOutputEnabled_; //!< Enable / disable writing images to file. bool localImageOutputEnabled_; //!< Enable / disable writing images of the local process to file. @@ -445,14 +442,6 @@ inline void Raytracer::traceRayNaively(const Ray& ray, BodyID& body_closest, rea IntersectsFunctor func(ray, t, n); for (auto blockIt = forest_->begin(); blockIt != forest_->end(); ++blockIt) { - const AABB& blockAabb = blockIt->getAABB(); - -#if !defined(DISABLE_BLOCK_AABB_INTERSECTION_PRECHECK) - if (!intersects(blockAabb, ray, t, blockAABBIntersectionPadding_)) { - continue; - } -#endif - for (auto bodyIt = LocalBodyIterator::begin(*blockIt, storageID_); bodyIt != LocalBodyIterator::end(); ++bodyIt) { if (!isBodyVisibleFunc_(*bodyIt)) { continue; @@ -482,16 +471,9 @@ inline void Raytracer::traceRayInHashGrids(const Ray& ray, BodyID& body_closest, Vec3 n; for (auto blockIt = forest_->begin(); blockIt != forest_->end(); ++blockIt) { - const AABB& blockAabb = blockIt->getAABB(); - -#if !defined(DISABLE_BLOCK_AABB_INTERSECTION_PRECHECK) - if (!intersects(blockAabb, ray, t, blockAABBIntersectionPadding_)) { - continue; - } -#endif - - ccd::HashGrids* hashgrids = blockIt->uncheckedFastGetData<ccd::HashGrids>(ccdID_); - BodyID body = hashgrids->getClosestBodyIntersectingWithRay<BodyTypeTuple>(ray, blockAabb, t, n, + const AABB& blockAABB = blockIt->getAABB(); + const ccd::HashGrids* hashgrids = blockIt->uncheckedFastGetData<ccd::HashGrids>(ccdID_); + BodyID body = hashgrids->getClosestBodyIntersectingWithRay<BodyTypeTuple>(ray, blockAABB, t, n, isBodyVisibleFunc_); if (body != NULL && t < t_closest) { t_closest = t; diff --git a/tests/pe/Raytracing.cpp b/tests/pe/Raytracing.cpp index b3910f5501ae4a0695714fc4075c6500cb8a334d..ae75c447f71cb202c20717df76a1ea6f534a8cb2 100644 --- a/tests/pe/Raytracing.cpp +++ b/tests/pe/Raytracing.cpp @@ -250,7 +250,6 @@ void RaytracerTest(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RAYTRAC Vec3(-5,5,5), Vec3(-1,5,5), Vec3(0,0,1), //-5,5,5; -1,5,5 lighting, Color(real_t(0.2), real_t(0.2), real_t(0.2)), - real_t(2), customBodyToShadingParams); MaterialID iron = Material::find("iron");