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 2edf38d51b5e886c6faddbcaa0b786f0429e5509..af2b1d638c26e2755a2cefe2c9235d41b56e6806 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), tBufferOutputEnabled_(false), tBufferOutputDirectory_("."), imageOutputEnabled_(true), @@ -120,8 +115,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. @@ -172,8 +166,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 4ca1008fef8c6959f19457ec4be30ea58bffe673..0749b4df1b31f627e00e23af00e078a6d371be3c 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 tBufferOutputEnabled_; //!< Enable / disable dumping the tbuffer to file. std::string tBufferOutputDirectory_; //!< Path to the tbuffer output directory. @@ -491,14 +488,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; @@ -530,16 +519,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");