mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Now serializing all environment settings + optimized transform system
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "Environment.h"
|
||||
|
||||
#include "src/Core/Core.h"
|
||||
|
||||
#include "src/Rendering/Textures/TextureManager.h"
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
@@ -88,6 +88,8 @@ namespace Nuake
|
||||
SERIALIZE_VAL(BloomEnabled);
|
||||
SERIALIZE_VAL_LBL("BloomThreshold", mBloom->GetThreshold());
|
||||
SERIALIZE_VAL_LBL("BloomIteration", mBloom->GetIteration());
|
||||
SERIALIZE_VAL_LBL("BloomDirtTexture", mBloom->GetLensDirt() ? mBloom->GetLensDirt()->GetPath() : "");
|
||||
SERIALIZE_VAL_LBL("BloomDirtIntensity", mBloom->GetLensDirtIntensity());
|
||||
|
||||
// Volumetric
|
||||
SERIALIZE_VAL(VolumetricEnabled);
|
||||
@@ -116,6 +118,13 @@ namespace Nuake
|
||||
|
||||
// DOF
|
||||
SERIALIZE_VAL(DOFEnabled);
|
||||
SERIALIZE_VAL(DOFAutoFocus);
|
||||
SERIALIZE_VAL(DOFFocalDepth);
|
||||
SERIALIZE_VAL(DOFManualFocus);
|
||||
SERIALIZE_VAL(DOFDist);
|
||||
SERIALIZE_VAL(DOFStart);
|
||||
SERIALIZE_VAL(DOFFocalLength);
|
||||
SERIALIZE_VAL(DOFShowFocus);
|
||||
|
||||
// Barrel distortion
|
||||
SERIALIZE_VAL(BarrelDistortionEnabled);
|
||||
@@ -131,6 +140,12 @@ namespace Nuake
|
||||
SERIALIZE_VAL(AmbientTerm);
|
||||
SERIALIZE_VEC4(AmbientColor);
|
||||
|
||||
SERIALIZE_VAL(PosterizationEnabled);
|
||||
SERIALIZE_VAL(PosterizationLevels);
|
||||
|
||||
SERIALIZE_VAL(PixelizationEnabled);
|
||||
SERIALIZE_VAL(PixelSize);
|
||||
|
||||
SERIALIZE_OBJECT(ProceduralSkybox);
|
||||
END_SERIALIZE();
|
||||
}
|
||||
@@ -175,6 +190,21 @@ namespace Nuake
|
||||
mBloom->SetIteration(j["BloomIteration"]);
|
||||
}
|
||||
|
||||
if(j.contains("BloomDirtTexture"))
|
||||
{
|
||||
std::string texturePath = j["BloomDirtTexture"];
|
||||
if (!texturePath.empty())
|
||||
{
|
||||
Ref<Texture> lensDirtTexture = TextureManager::Get()->GetTexture(texturePath);
|
||||
mBloom->SetLensDirt(lensDirtTexture);
|
||||
}
|
||||
}
|
||||
|
||||
if (j.contains("BloomDirtIntensity"))
|
||||
{
|
||||
mBloom->SetLensDirtIntensity(j["BloomDirtIntensity"]);
|
||||
}
|
||||
|
||||
// SSR
|
||||
if (j.contains("SSREnabled"))
|
||||
{
|
||||
@@ -279,6 +309,13 @@ namespace Nuake
|
||||
DOFEnabled = j["DOFEnabled"];
|
||||
}
|
||||
|
||||
DESERIALIZE_VAL(DOFAutoFocus);
|
||||
DESERIALIZE_VAL(DOFManualFocus);
|
||||
DESERIALIZE_VAL(DOFFocalDepth);
|
||||
DESERIALIZE_VAL(DOFFocalLength);
|
||||
DESERIALIZE_VAL(DOFStart);
|
||||
DESERIALIZE_VAL(DOFDist);
|
||||
|
||||
// Barrel distortion
|
||||
if (j.contains("BarrelDistortionEnabled"))
|
||||
{
|
||||
@@ -316,6 +353,14 @@ namespace Nuake
|
||||
VignetteIntensity = j["VignetteIntensity"];
|
||||
}
|
||||
|
||||
DESERIALIZE_VAL(PosterizationEnabled);
|
||||
DESERIALIZE_VAL(PosterizationLevels);
|
||||
|
||||
DESERIALIZE_VAL(PixelizationEnabled);
|
||||
DESERIALIZE_VAL(PixelSize);
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace Nuake
|
||||
anim->SetCurrentTime(animTime);
|
||||
|
||||
model->SetCurrentBlendTime(blendWeight - ts);
|
||||
Logger::Log("Blend time: " + std::to_string(model->GetCurrentBlendTime()));
|
||||
prevAnimTime = prevAnim->GetCurrentTime() + (ts * prevAnim->GetTicksPerSecond());
|
||||
prevAnim->SetCurrentTime(prevAnimTime);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Nuake
|
||||
const Matrix4& newLocalTransform = translationMatrix * rotationMatrix * scaleMatrix;
|
||||
|
||||
transform.GlobalDirty = true;
|
||||
UpdateDirtyFlagRecursive(currentEntity);
|
||||
//UpdateDirtyFlagRecursive(currentEntity);
|
||||
|
||||
transform.SetLocalTransform(newLocalTransform);
|
||||
transform.Dirty = false;
|
||||
|
||||
Reference in New Issue
Block a user