Move depth fade definition to GLDEFS

This commit is contained in:
nashmuhandes 2024-09-09 18:08:10 +08:00 committed by Nash Muhandes
commit 58fecd4b92
10 changed files with 12 additions and 16 deletions

View file

@ -264,11 +264,6 @@ public:
mSurfaceUniforms.uDesaturationFactor = 0.0f;
}
void SetDepthFadeThreshold(float falloff)
{
mSurfaceUniforms.uDepthFadeThreshold = falloff;
}
void SetTextureClamp(bool on)
{
if (on) mTextureClamp = TM_CLAMPY;

View file

@ -865,10 +865,12 @@ void VkLevelMeshUploader::UploadUniforms()
{
auto source = material.mMaterial->Source();
surfaceUniforms.uSpecularMaterial = { source->GetGlossiness(), source->GetSpecularLevel() };
surfaceUniforms.uDepthFadeThreshold = source->GetDepthFadeThreshold();
surfaceUniforms.uTextureIndex = Mesh->fb->GetBindlessTextureIndex(material.mMaterial, material.mClampMode, material.mTranslation);
}
else
{
surfaceUniforms.uDepthFadeThreshold = 0.f;
surfaceUniforms.uTextureIndex = 0;
}
}

View file

@ -413,9 +413,11 @@ void VkRenderState::ApplySurfaceUniforms()
mSurfaceUniforms.uTextureIndex = static_cast<VkMaterial*>(mMaterial.mMaterial)->GetBindlessIndex(mMaterial);
mSurfaceUniforms.uSpecularMaterial = { source->GetGlossiness(), source->GetSpecularLevel() };
mSurfaceUniforms.uDepthFadeThreshold = source->GetDepthFadeThreshold();
}
else
{
mSurfaceUniforms.uDepthFadeThreshold = 0.f;
mSurfaceUniforms.uTextureIndex = 0;
}
mMaterial.mChanged = false;