Initial commit: Final state of the master project
This commit is contained in:
20
Research/scene/Material/MaterialQuantizer/NormalQuantizer.h
Normal file
20
Research/scene/Material/MaterialQuantizer/NormalQuantizer.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "../SmallNormal.h"
|
||||
#include "BaseQuantizer.h"
|
||||
|
||||
// Super simple quantizer: takes the original value, sets some bits to zero so that only the given number of bits remain
|
||||
class NormalQuantizer : public BaseQuantizer<SmallNormal, NormalCompare>, public QuickQuantizer<SmallNormal>
|
||||
{
|
||||
public:
|
||||
NormalQuantizer(unsigned8 bits);
|
||||
std::map<SmallNormal, SmallNormal, NormalCompare>* QuantizeMaterials(std::vector<SmallNormal> materials) const override;
|
||||
std::string GetQuantizerDescriptor() const override;
|
||||
SmallNormal Quantize(const SmallNormal& normal) const override;
|
||||
private:
|
||||
// if the number of bits is smaller than or equal to this number, all possible quantization values will be added.
|
||||
static const unsigned8 QUANTIZE_ALL_UP_TO = 14;
|
||||
unsigned8 mBits;
|
||||
unsigned32 mChannelMask;
|
||||
};
|
||||
Reference in New Issue
Block a user