34#include <memory_resource>
43 #define JPL_PROFILE(...)
46#ifndef JPL_PROFILE_SET_INT
47 #define JPL_PROFILE_SET_INT(Stat, Value)
50#ifndef JPL_PROFILE_SET_FLOAT
51 #define JPL_PROFILE_SET_FLOAT(Stat, Value)
55#ifndef JPL_HAS_FUNCTION
56#define JPL_HAS_FUNCTION(Type, MemberFunctionCallPrototype)\
57requires(Type Object){ Object.MemberFunctionCallPrototype; }
60#ifndef JPL_HAS_FUNCTION_R
61#define JPL_HAS_FUNCTION_R(Type, MemberFunctionCallPrototype, ReturnType)\
62requires(Type Object) { { Object.MemberFunctionCallPrototype } -> std::same_as<ReturnType>; }
83 template<
class IntersectionType>
94 template<
class IntersectionType>
97 std::pmr::vector<TraceNode<IntersectionType>>
Nodes;
101 template<
class IntersectionType>
104 std::pmr::vector<TracedPath<IntersectionType>>
Paths;
107 template<
class R,
class IntersectionType>
109 std::ranges::input_range<R> &&
110 std::same_as<std::remove_cvref_t<std::ranges::range_value_t<R>>, TraceResults<IntersectionType>>;
112 template<
class V,
class IntersectionType>
114 std::ranges::view<V> &&
115 std::ranges::input_range<V> &&
116 std::same_as<std::remove_cvref_t<std::ranges::range_value_t<V>>, TraceResults<IntersectionType>>;
155 static constexpr std::size_t cMaxOrder = 16;
164 template<
class SceneType,
bool bPathHashCombine = true>
165 static void Trace(
const SceneType& sceneInterface,
166 const typename SceneType::Vec3& origin,
184 template<
class SceneType,
class SpecularPathCacheContainer>
185 static void ProcessTraces(SceneType& sceneInterface,
186 const typename SceneType::SourceData& sourceData,
188 std::span<const typename SceneType::ReceiverData> receiverData,
189 SpecularPathCacheContainer& caches);
206 template<
class SceneType,
class SpecularPathCacheContainer>
207 static void ProcessTraces(SceneType& sceneInterface,
208 const typename SceneType::SourceData& sourceData,
210 std::span<const typename SceneType::ReceiverData> receiverData,
212 SpecularPathCacheContainer& caches);
221 uint32 TotalNumImageSources;
223 template<
class IntersectionType>
228 struct ImageSourceBuffer
230 std::pmr::vector<Vec3> ImageSources;
231 std::pmr::vector<uint32> IndexTable;
233 static ImageSourceBuffer MakeFor(
const auto& subpathsList);
234 std::span<Vec3> GetImageSourcesFor(
const auto& subpath,
uint32 subpathIndex);
237 template<
class PathNodeType,
class Vec3>
238 struct alignas(JPL_CACHE_LINE_SIZE) NewSubpath
244 std::span<const PathNodeType> Subpath;
245 ETraceDirection Direction;
248 Vec3 LastImageSource;
254 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
257 using Vec3 =
typename SceneType::Vec3;
258 using Intersection =
typename SceneType::Intersection;
259 using PathNodeType = TraceNode<Intersection>;
260 using NewSubpathEntry = NewSubpath<PathNodeType, Vec3>;
261 using SourceData =
typename SceneType::SourceData;
262 using ReceiverData =
typename SceneType::ReceiverData;
264 SceneType& mSceneInterface;
265 const SourceData& mSourceData;
266 TraceResults<Intersection>& mSourceTraces;
267 std::span<const ReceiverData> mReceiverData;
268 TRView mReceiverTraces;
269 SpecularPathCacheContainer& mCaches;
272 ProcessRoutine(SceneType& sceneInterface,
273 const SourceData& sourceData,
274 TraceResults<Intersection>& sourceTraces,
275 std::span<const ReceiverData> receiverData,
276 TRView receiverTraces,
277 SpecularPathCacheContainer& caches);
282 std::pair<uint32, uint32> GetSubpathCountAndMaxOrder();
285 static TraceInfo PreprocessTraces(TraceResults<Intersection>& traces);
287 void CreateForwardSubpathsEntries(TraceResults<Intersection>& traces,
288 ScratchHashSetIdentity& uniqueCheckSet,
289 std::pmr::vector<NewSubpathEntry>& outNewSubpaths)
const;
291 void CreateBackwardSubpathsEntries(TRView traces,
292 ScratchHashSetIdentity& uniqueCheckSet,
293 std::pmr::vector<NewSubpathEntry>& outNewSubpaths)
const;
296 template<ETraceDirection PathDirection>
297 void ConstructImageSources(
const Vec3& sourcePosition,
298 std::span<
const TraceNode<Intersection>> path,
299 std::span<Vec3> outImageSources)
const;
302 template<ETraceDirection TraceDirection>
303 void ConstructImageSources(
const Vec3& sourcePosition,
304 std::span<
const TraceNode<Intersection>> path,
305 ETraceDirection pathDirection,
306 std::span<Vec3> outImageSources)
const;
309 template<ETraceDirection PathDirection>
310 bool ValidatePathForListener(std::span<
const TraceNode<Intersection>> nodes,
311 std::span<const Vec3> imageSources,
312 const Vec3& listenerPosition)
const;
315 template<ETraceDirection TraceDirection>
316 bool ValidatePathForListener(std::span<
const TraceNode<Intersection>> nodes,
317 ETraceDirection pathDirection,
318 std::span<const Vec3> imageSources,
319 const Vec3& listenerPosition)
const;
322 void ValidateNewSubpaths(std::span<NewSubpathEntry> newSubpaths,
323 const Vec3 listenerPosition)
const;
327 void AccumulateMaterialAbsorption(std::span<
const TraceNode<Intersection>> surfaces,
328 EnergyBands& outEnergyLoss)
const;
331 void CacheValidatedSubpaths(std::span<NewSubpathEntry> validatedSubpaths,
332 uint32 maxPathOrderHint)
const;
352 template<
class SceneType,
bool bPathHashCombine>
354 const typename SceneType::Vec3& origin,
358 using Vec3 =
typename SceneType::Vec3;
359 using Ray =
typename SceneType::Ray;
360 using Intersection =
typename SceneType::Intersection;
364 for (PathType& path : outTraceResults.
Paths)
369 auto traceRay = [&](
int32 index)
371 PathType& path = outTraceResults.
Paths[index];
374 Ray ray(origin, Math::InternalUtils::RandDirection<Vec3>());
381 if (not sceneInterface.Intersect(ray, parameters.
MaxRayLength, hit))
386 if constexpr (bPathHashCombine)
393 hash = sceneInterface.GetHash(hit);
397 path.Nodes.push_back({ .Hit = hit, .Hash = hash });
400 static constexpr float offset = 0.001f;
403 ray.Origin = sceneInterface.GetPosition(hit) + sceneInterface.GetNormal(hit) * offset;
404 ray.Direction = Math::SpecularReflection(ray.Direction, sceneInterface.GetNormal(hit));
414 sceneInterface.PreTrace();
431 sceneInterface.PostTrace();
438 inline auto SpecularRayTracing::ImageSourceBuffer<Vec3>::MakeFor(
const auto& subpathsList) -> ImageSourceBuffer<Vec3>
443 return acc +
static_cast<uint32>(entry.Subpath.size() + 1);
446 ImageSourceBuffer ISBuffer
452 for (
uint32 entryIndex = 0, ISCacheOffset = 0; entryIndex < subpathsList.size(); ++entryIndex)
454 ISBuffer.IndexTable[entryIndex] = ISCacheOffset;
455 const auto& entry = subpathsList[entryIndex];
456 const uint32 imageSourcePathSize = entry.Subpath.size() + 1;
457 ISCacheOffset += imageSourcePathSize;
459 JPL_ASSERT(ISCacheOffset <= ISBuffer.ImageSources.size());
466 inline std::span<Vec3> SpecularRayTracing::ImageSourceBuffer<Vec3>::GetImageSourcesFor(
const auto& subpath,
uint32 subpathIndex)
468 const uint32 imageSourcePathSize = subpath.size() + 1;
469 return std::span<Vec3>(&ImageSources[IndexTable[subpathIndex]], imageSourcePathSize);
473 template<
class IntersectionType>
474 auto SpecularRayTracing::TraceInfo::Parse(
const TraceResults<IntersectionType>& traces) -> TraceInfo
477 info.PathCount =
static_cast<uint32>(traces.Paths.size());
479 info.TotalNumSubpaths = 0;
481 for (
const auto& path : traces.Paths)
483 info.TotalNumSubpaths += path.Nodes.size();
484 info.MaxOrder = std::max(info.MaxOrder,
static_cast<uint32>(path.Nodes.size()));
487 info.TotalNumImageSources = info.TotalNumSubpaths + info.PathCount;
493 template<
class SceneType,
class SpecularPathCacheContainer>
495 const typename SceneType::SourceData& sourceData,
497 std::span<const typename SceneType::ReceiverData> receiverData,
498 SpecularPathCacheContainer& caches)
502 std::span<TraceResults<typename SceneType::Intersection>> emptyReceiverTRs;
503 ProcessRoutine(sceneInterface, sourceData, traces, receiverData, emptyReceiverTRs, caches).Process();
507 template<
class SceneType,
class SpecularPathCacheContainer>
509 const typename SceneType::SourceData& sourceData,
511 std::span<const typename SceneType::ReceiverData> receiverData,
513 SpecularPathCacheContainer& caches)
517 ProcessRoutine(sceneInterface, sourceData, sourceTraces, receiverData, receiverTraces, caches).Process();
521 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
522 inline SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
523 ProcessRoutine(SceneType& sceneInterface,
524 const SourceData& sourceData,
526 std::span<const ReceiverData> receiverData,
527 TRView receiverTraces,
528 SpecularPathCacheContainer& caches)
529 : mSceneInterface(sceneInterface)
530 , mSourceData(sourceData)
531 , mSourceTraces(sourceTraces)
532 , mReceiverData(receiverData)
533 , mReceiverTraces(
std::move(receiverTraces))
539 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
540 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::Process()
543 const auto [totalSubpathCount, maxPathOrder] = GetSubpathCountAndMaxOrder();
548 newSubpaths.reserve(totalSubpathCount);
561 CreateForwardSubpathsEntries(mSourceTraces, subpathsChecked, newSubpaths);
563 if (not mReceiverTraces.empty())
565 CreateBackwardSubpathsEntries(mReceiverTraces, subpathsChecked, newSubpaths);
570 ValidateNewSubpaths(std::span(newSubpaths), mSourceData.Position);
573 CacheValidatedSubpaths(std::span(newSubpaths), maxPathOrder);
576 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
577 inline std::pair<uint32, uint32> SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::GetSubpathCountAndMaxOrder()
581 const TraceInfo sourceTraceInfo = PreprocessTraces(mSourceTraces);
582 const uint32 listenerToReceiverSubpathCount = sourceTraceInfo.TotalNumSubpaths * mReceiverData.size();
584 uint32 totalSubpaths = listenerToReceiverSubpathCount;
585 uint32 maxPathOrder = sourceTraceInfo.MaxOrder;
587 for (
auto& receiverTraceResults : mReceiverTraces)
589 const TraceInfo receiverTraceInfo = PreprocessTraces(receiverTraceResults);
590 totalSubpaths += receiverTraceInfo.TotalNumSubpaths;
591 maxPathOrder = std::max(maxPathOrder, receiverTraceInfo.MaxOrder);
594 return std::pair(totalSubpaths, maxPathOrder);
599 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
600 inline auto SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::PreprocessTraces(TraceResults<Intersection>& traces) -> TraceInfo
603 std::erase_if(traces.Paths, [](
const auto& path) { return path.Nodes.empty(); });
612 auto eraseDuplicatePaths = [&](
auto& paths)
618 std::erase_if(paths, [&uniqueKeys](
const auto& path)
620 return not uniqueKeys.Insert(path.Nodes.back().Hash);
624 eraseDuplicatePaths(traces.Paths);
631 return TraceInfo::Parse(traces);
635 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
636 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
637 CreateForwardSubpathsEntries(TraceResults<Intersection>& traces,
639 std::pmr::vector<NewSubpathEntry>& outNewSubpaths)
const
641 using NewSubpathEntry = NewSubpath<PathNodeType, Vec3>;
643 for (
uint32 pathIdx = 0; pathIdx < traces.Paths.size(); ++pathIdx)
645 const auto& path = traces.Paths[pathIdx].Nodes;
647 for (
uint32 nf = 1; nf <= path.size(); ++nf)
649 std::span<const PathNodeType> subpath(path.data(), nf);
652 pathPartialId.
AddVertex(subpath.back().Hash);
654 for (
uint32 receiverIdx = 0; receiverIdx < mReceiverData.size(); ++receiverIdx)
656 const ReceiverData& receiver = mReceiverData[receiverIdx];
665 if (not uniqueCheckSet.Insert(pathId.
Id))
673 outNewSubpaths.emplace_back(
677 .ReceiverIdx = receiverIdx,
686 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
687 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
688 CreateBackwardSubpathsEntries(TRView traces,
690 std::pmr::vector<NewSubpathEntry>& outNewSubpaths)
const
695 auto hashSequence = [](std::span<const PathNodeType> subpath)
698 for (
auto const& node : subpath | std::views::reverse)
700 hash.Combine(node.Hash);
702 return hash.GetCurrent();
705 for (
uint32 receiverIdx = 0; receiverIdx < mReceiverData.size(); ++receiverIdx)
707 const TraceResults<Intersection>& traceResults = traces[receiverIdx];
708 const ReceiverData& receiver = mReceiverData[receiverIdx];
711 for (
uint32 pathIdx = 0; pathIdx < traceResults.Paths.size(); ++pathIdx)
713 const auto& path = traceResults.Paths[pathIdx].Nodes;
717 for (
int32 nb = 1; nb <= path.size(); ++nb)
719 std::span<const PathNodeType> subpath(path.data(), nb);
726 if (not uniqueCheckSet.Insert(pathId.
Id))
734 outNewSubpaths.emplace_back(
738 .ReceiverIdx = receiverIdx,
748 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
749 template<ETraceDirection PathDirection>
750 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
751 ConstructImageSources(
const Vec3& sourcePosition,
752 std::span<
const TraceNode<Intersection>> path,
753 std::span<Vec3> outImageSources)
const
755 JPL_ASSERT(outImageSources.size() >= path.size() + 1);
757 outImageSources[0] = sourcePosition;
761 for (
int32 i = 0; i < path.size(); ++i)
763 const TraceNode<Intersection>& node = path[i];
764 outImageSources[i + 1] = Math::GetImageSource(outImageSources[i],
765 mSceneInterface.GetNormal(node.Hit),
766 mSceneInterface.GetPosition(node.Hit));
771 for (
int32 i = path.size() - 1, ISIndex = 0; i >= 0; --i, ++ISIndex)
773 const TraceNode<Intersection>& node = path[i];
774 outImageSources[ISIndex + 1] = Math::GetImageSource(outImageSources[ISIndex],
775 mSceneInterface.GetNormal(node.Hit),
776 mSceneInterface.GetPosition(node.Hit));
781 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
782 template<ETraceDirection TraceDirection>
783 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
784 ConstructImageSources(
const Vec3& sourcePosition,
785 std::span<
const TraceNode<Intersection>> path,
787 std::span<Vec3> outImageSources)
const
791 static constexpr auto cISTraceDirection = TraceDirection;
792 return ConstructImageSources<cISTraceDirection>(sourcePosition, path, outImageSources);
797 return ConstructImageSources<cISTraceDirection>(sourcePosition, path, outImageSources);
801 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
802 template<ETraceDirection PathDirection>
803 inline bool SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
804 ValidatePathForListener(std::span<
const TraceNode<Intersection>> nodes,
805 std::span<const Vec3> imageSources,
806 const Vec3& listenerPosition)
const
811 Vec3 R = listenerPosition;
815 for (
uint32 i = imageSources.size() - 1, ni = 0; i >= 1; --i, ++ni)
819 if (not mSceneInterface.Intersect(R, imageSources[i], hit) ||
820 not mSceneInterface.IsSameSurface(hit, nodes[ni].Hit))
824 static constexpr float offset = 0.001f;
826 R = mSceneInterface.GetPosition(hit) + mSceneInterface.GetNormal(hit) * offset;
831 for (
auto i = imageSources.size() - 1; i >= 1; --i)
835 if (not mSceneInterface.Intersect(R, imageSources[i], hit) ||
836 not mSceneInterface.IsSameSurface(hit, nodes[i - 1].Hit))
840 static constexpr float offset = 0.001f;
842 R = mSceneInterface.GetPosition(hit) + mSceneInterface.GetNormal(hit) * offset;
848 return not mSceneInterface.IsOccluded(R, imageSources[0]);
851 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
852 template<ETraceDirection TraceDirection>
853 inline bool SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
854 ValidatePathForListener(std::span<
const TraceNode<Intersection>> nodes,
856 std::span<const Vec3> imageSources,
857 const Vec3& listenerPosition)
const
861 static constexpr auto cISDirection = TraceDirection;
862 return ValidatePathForListener<cISDirection>(nodes, imageSources, listenerPosition);
867 return ValidatePathForListener<cISDirection>(nodes, imageSources, listenerPosition);
871 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
872 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
873 ValidateNewSubpaths(std::span<NewSubpathEntry> newSubpaths,
874 const Vec3 listenerPosition)
const
877 JPL_PROFILE(SpecularRayTracing_ValidateNewSubpaths);
882 auto imageSourceBuffer = ImageSourceBuffer<Vec3>::MakeFor(newSubpaths);
884 auto validateSubpath = [&](
int32 ei)
886 NewSubpathEntry& entry = newSubpaths[ei];
887 const ReceiverData& receiver = mReceiverData[entry.ReceiverIdx];
888 std::span<Vec3> imageSources = imageSourceBuffer.GetImageSourcesFor(entry.Subpath, ei);
890 ConstructImageSources<ETraceDirection::Backward>(receiver.Position,
895 entry.LastImageSource = imageSources.back();
898 entry.bIsValid = ValidatePathForListener<ETraceDirection::Backward>(entry.Subpath,
905 AccumulateMaterialAbsorption(entry.Subpath, entry.EnergyLoss);
913 mSceneInterface.PreTrace();
918 mSceneInterface.ParallelFor(
static_cast<uint32>(newSubpaths.size()), validateSubpath);
922 for (
uint32 ei = 0; ei < newSubpaths.size(); ++ei)
930 mSceneInterface.PostTrace();
934 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
935 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
936 AccumulateMaterialAbsorption(std::span<
const TraceNode<Intersection>> surfaces,
939 for (
const auto& surfaceHit : surfaces)
942 if (mSceneInterface.GetMaterialAbsorption(surfaceHit, materialAbsorption))
944 outEnergyLoss += materialAbsorption;
950 template<
class SceneType,
class SpecularPathCacheContainer, CTraceResultsView<
typename SceneType::Intersection> TRView>
951 inline void SpecularRayTracing::ProcessRoutine<SceneType, SpecularPathCacheContainer, TRView>::
952 CacheValidatedSubpaths(std::span<NewSubpathEntry> validatedSubpaths,
953 uint32 maxPathOrderHint)
const
958 nodeCache.reserve(maxPathOrderHint + 2);
961 nodeCache.push_back(mSourceData.Id);
964 subpathCopy.reserve(maxPathOrderHint);
966 [[maybe_unused]]
uint32 numValidPathsFound = 0;
969 for (
const NewSubpathEntry& entry : validatedSubpaths)
975 subpathCopy.resize(entry.Subpath.size());
976 std::ranges::copy(entry.Subpath, subpathCopy.begin());
981 std::ranges::reverse(subpathCopy);
985 nodeCache.resize(1 + subpathCopy.size());
988 mSceneInterface.CacheSubpath(subpathCopy, std::span(&nodeCache[1], subpathCopy.size()));
991 nodeCache.push_back(
static_cast<int32>(mReceiverData[entry.ReceiverIdx].Id));
998 pathCache.
Add(entry.PathId, nodeCache, entry.LastImageSource, entry.EnergyLoss, entry.bIsValid);
1000 numValidPathsFound += entry.bIsValid;
1004 JPL_PROFILE_SET_FLOAT(TraceQuality, validatedSubpaths.empty() ? 0.0f : 100.0f * numValidPathsFound /
float(validatedSubpaths.size()));
#define JPL_ASSERT(inExpression,...)
Main assert macro, usage: JPL_ASSERT(condition, message) or JPL_ASSERT(condition)
Definition ErrorReporting.h:80
#define JPL_PROFILE_SET_INT(Stat, Value)
Definition SpecularRayTracing.h:47
#define JPL_PROFILE(...)
Definition SpecularRayTracing.h:43
#define JPL_HAS_FUNCTION(Type, MemberFunctionCallPrototype)
Definition SpecularRayTracing.h:56
#define JPL_PROFILE_SET_FLOAT(Stat, Value)
Definition SpecularRayTracing.h:51
static JPL_INLINE std::size_t GetRequiredMemorySize(uint32 expectedCount)
Definition ScratchHashSet.h:105
A very experimental specular path cache.
Definition SpecularPathCache.h:49
JPL_INLINE bool Contains(SpecularPathId pathId) const
Definition SpecularPathCache.h:157
void Add(SpecularPathId path, std::span< const int > nodes, const Vec3 &imageSource, const EnergyBands &energy, bool isPathValid)
Definition SpecularPathCache.h:165
Definition SpecularRayTracing.h:153
static void Trace(const SceneType &sceneInterface, const typename SceneType::Vec3 &origin, const TraceParameters ¶meters, TraceResults< typename SceneType::Intersection > &outTraceResults)
Definition SpecularRayTracing.h:353
static void ProcessTraces(SceneType &sceneInterface, const typename SceneType::SourceData &sourceData, TraceResults< typename SceneType::Intersection > &traces, std::span< const typename SceneType::ReceiverData > receiverData, SpecularPathCacheContainer &caches)
Definition SpecularRayTracing.h:494
Definition SpecularRayTracing.h:108
Definition SpecularRayTracing.h:113
JPL_INLINE constexpr T Accumulate(RangeType &&range, T initialValue, Fn reduceOp={})
Just a wrapper for a range, to not have to type begin and end iterators.
Definition Algorithm.h:45
Definition AcousticMaterial.h:36
std::uint32_t uint32
Definition Core.h:311
JPL_INLINE constexpr void HashCombine32(uint32_t &seed, uint32_t id32)
Definition Hash.h:42
ETraceDirection
Definition SpecularRayTracing.h:69
simd EnergyBands
Definition FrequencyBands.h:36
std::int32_t int32
Definition Core.h:316
std::pmr::memory_resource * GetDefaultMemoryResource() noexcept
Definition Memory.h:42
ScratchHashSet32< uint32, std::identity > ScratchHashSetIdentity
Definition ScratchHashSet.h:38
Definition ChannelMap.h:272
static constexpr uint32_t cStartSeed
Definition Hash.h:31
A very experimental specular path definition.
Definition SpecularPath.h:40
uint32 Id
Definition SpecularPath.h:41
JPL_INLINE constexpr void AddVertex(uint32 id)
Definition SpecularPath.h:46
Node of a traced paths.
Definition SpecularRayTracing.h:85
uint32 Hash
Definition SpecularRayTracing.h:90
IntersectionType Hit
Definition SpecularRayTracing.h:87
Generic parameters used in different kinds of traces.
Definition SpecularRayTracing.h:76
uint32 MaxTraceOrder
Definition SpecularRayTracing.h:78
float MaxRayLength
Definition SpecularRayTracing.h:79
uint32 NumPrimaryRays
Definition SpecularRayTracing.h:77
Result of tracing paths.
Definition SpecularRayTracing.h:103
std::pmr::vector< TracedPath< IntersectionType > > Paths
Definition SpecularRayTracing.h:104
Sequence of traced path intersections.
Definition SpecularRayTracing.h:96
std::pmr::vector< TraceNode< IntersectionType > > Nodes
Definition SpecularRayTracing.h:97
Minimal 4-wide 32-bit float vector implementation for SIMD.
Definition SIMD.h:60