Fix gamma rendering issues
- Remove gamma correction from the Vulkan renderer - Add SamplerCreator, used to specify Min/Mag filter - Add character texture to example project - Add AnimationSystem, DebugSystem and UiRenderSystem to example project
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include "copium/sampler/SamplerCreator.h"
|
||||
|
||||
#include "copium/util/Common.h"
|
||||
|
||||
namespace Copium
|
||||
{
|
||||
|
||||
SamplerCreator::SamplerCreator() = default;
|
||||
|
||||
SamplerCreator::SamplerCreator(const MetaFileClass& metaClass)
|
||||
{
|
||||
if (metaClass.HasValue("min-filter"))
|
||||
minFilter = GetFilterFromString(metaClass.GetValue("min-filter"));
|
||||
if (metaClass.HasValue("mag-filter"))
|
||||
magFilter = GetFilterFromString(metaClass.GetValue("mag-filter"));
|
||||
}
|
||||
|
||||
void SamplerCreator::SetMinFilter(VkFilter minFilter)
|
||||
{
|
||||
SamplerCreator::minFilter = minFilter;
|
||||
}
|
||||
|
||||
void SamplerCreator::SetMagFilter(VkFilter magFilter)
|
||||
{
|
||||
SamplerCreator::magFilter = magFilter;
|
||||
}
|
||||
|
||||
VkFilter SamplerCreator::GetFilterFromString(const std::string& str) const
|
||||
{
|
||||
if (str == "nearest")
|
||||
return VK_FILTER_NEAREST;
|
||||
else if (str == "linear")
|
||||
return VK_FILTER_LINEAR;
|
||||
else
|
||||
CP_ABORT("Invalid texture filtering: %s", str.c_str());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user