Add light support (WIP)
This commit is contained in:
@@ -3,10 +3,25 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/ForwardFramePipeline.hpp>
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline std::size_t ForwardFramePipeline::LightKeyHasher::operator()(const LightKey& lightKey) const
|
||||
{
|
||||
std::size_t lightHash = 5;
|
||||
auto CombineHash = [](std::size_t currentHash, std::size_t newHash)
|
||||
{
|
||||
return currentHash * 23 + newHash;
|
||||
};
|
||||
|
||||
std::hash<const Light*> lightPtrHasher;
|
||||
for (std::size_t i = 0; i < lightKey.size(); ++i)
|
||||
lightHash = CombineHash(lightHash, lightPtrHasher(lightKey[i]));
|
||||
|
||||
return lightHash;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/DebugOff.hpp>
|
||||
|
||||
Reference in New Issue
Block a user