mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 22:27:41 +00:00
Display Gamma integration
This commit is contained in:
@@ -793,13 +793,18 @@ void CBooRenderer::UpdateAreaUniforms(int areaIdx, bool shadowRender)
|
||||
SetupRendererStates();
|
||||
|
||||
CModelFlags flags;
|
||||
int bufIdx;
|
||||
if (shadowRender)
|
||||
{
|
||||
flags.m_extendedShader = EExtendedShader::SolidColor;
|
||||
flags.x4_color = zeus::CColor::skBlack;
|
||||
bufIdx = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags.m_extendedShader = EExtendedShader::Lighting;
|
||||
bufIdx = 0;
|
||||
}
|
||||
|
||||
for (CAreaListItem& item : x1c_areaListItems)
|
||||
{
|
||||
@@ -807,7 +812,7 @@ void CBooRenderer::UpdateAreaUniforms(int areaIdx, bool shadowRender)
|
||||
continue;
|
||||
|
||||
item.m_shaderSet->m_geomLayout->Update(flags, nullptr, nullptr, &item.m_shaderSet->m_matSet,
|
||||
item.m_shaderSet->m_geomLayout->m_sharedBuffer[shadowRender]);
|
||||
item.m_shaderSet->m_geomLayout->m_sharedBuffer[bufIdx]);
|
||||
|
||||
for (auto it = item.x10_models.begin(); it != item.x10_models.end(); ++it)
|
||||
{
|
||||
@@ -815,7 +820,7 @@ void CBooRenderer::UpdateAreaUniforms(int areaIdx, bool shadowRender)
|
||||
if (model->TryLockTextures())
|
||||
{
|
||||
ActivateLightsForModel(&item, *model);
|
||||
model->UpdateUniformData(flags, nullptr, nullptr, shadowRender);
|
||||
model->UpdateUniformData(flags, nullptr, nullptr, bufIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ private:
|
||||
zeus::CMatrix4f m_proj;
|
||||
zeus::CMatrix4f m_texMtxs[9]; // Pad out to 768 bytes
|
||||
CModelShaders::LightingUniform m_lighting;
|
||||
zeus::CVector3f m_pad; // Pad out to 768 bytes
|
||||
};
|
||||
|
||||
std::experimental::optional<TLockedToken<CTexture>> m_patternTex1;
|
||||
|
||||
@@ -7,11 +7,13 @@ namespace urde
|
||||
CTexturedQuadFilter::CTexturedQuadFilter(const boo::ObjToken<boo::ITexture>& tex)
|
||||
: m_booTex(tex)
|
||||
{
|
||||
m_flipRect = CGraphics::g_BooFactory->platform() == boo::IGraphicsDataFactory::Platform::Vulkan;
|
||||
}
|
||||
|
||||
CTexturedQuadFilter::CTexturedQuadFilter(EFilterType type, const boo::ObjToken<boo::ITexture>& tex, bool gequal)
|
||||
: m_booTex(tex), m_gequal(gequal)
|
||||
{
|
||||
m_flipRect = CGraphics::g_BooFactory->platform() == boo::IGraphicsDataFactory::Platform::Vulkan;
|
||||
tex->setClampMode(boo::TextureClampMode::ClampToEdge);
|
||||
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool
|
||||
{
|
||||
@@ -26,6 +28,7 @@ CTexturedQuadFilter::CTexturedQuadFilter(EFilterType type,
|
||||
TLockedToken<CTexture> tex)
|
||||
: CTexturedQuadFilter(type, (tex ? tex->GetBooTexture() : nullptr))
|
||||
{
|
||||
m_flipRect = CGraphics::g_BooFactory->platform() == boo::IGraphicsDataFactory::Platform::Vulkan;
|
||||
m_tex = tex;
|
||||
}
|
||||
|
||||
@@ -40,10 +43,20 @@ void CTexturedQuadFilter::draw(const zeus::CColor& color, float uvScale, const z
|
||||
};
|
||||
m_vbo->load(verts, sizeof(verts));
|
||||
|
||||
m_uniform.m_matrix[0][0] = rect.size.x * 2.f;
|
||||
m_uniform.m_matrix[1][1] = rect.size.y * 2.f;
|
||||
m_uniform.m_matrix[3][0] = rect.position.x * 2.f - 1.f;
|
||||
m_uniform.m_matrix[3][1] = rect.position.y * 2.f - 1.f;
|
||||
if (!m_flipRect)
|
||||
{
|
||||
m_uniform.m_matrix[0][0] = rect.size.x * 2.f;
|
||||
m_uniform.m_matrix[1][1] = rect.size.y * 2.f;
|
||||
m_uniform.m_matrix[3][0] = rect.position.x * 2.f - 1.f;
|
||||
m_uniform.m_matrix[3][1] = rect.position.y * 2.f - 1.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_uniform.m_matrix[0][0] = rect.size.x * 2.f;
|
||||
m_uniform.m_matrix[1][1] = rect.size.y * -2.f;
|
||||
m_uniform.m_matrix[3][0] = rect.position.x * 2.f - 1.f;
|
||||
m_uniform.m_matrix[3][1] = rect.position.y * -2.f + 1.f;
|
||||
}
|
||||
m_uniform.m_color = color;
|
||||
m_uniBuf->load(&m_uniform, sizeof(m_uniform));
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ protected:
|
||||
boo::ObjToken<boo::IShaderDataBinding> m_dataBind;
|
||||
Uniform m_uniform;
|
||||
bool m_gequal;
|
||||
bool m_flipRect = false;
|
||||
|
||||
CTexturedQuadFilter(const boo::ObjToken<boo::ITexture>& tex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user