Set skybox exposure during ReflectionProbe bake

Signed-off-by: dmcdiar <dmcdiar@amazon.com>
monroegm-disable-blank-issue-2
dmcdiar 4 years ago
parent be934a4b32
commit dcb3ac4337

@ -120,15 +120,17 @@ namespace AZ
m_scene->RemoveRenderPipeline(m_environmentCubeMapPipelineId);
m_environmentCubeMapPass = nullptr;
// restore exposure
sceneSrg->SetConstant(m_iblExposureConstantIndex, m_previousExposure);
// restore exposures
sceneSrg->SetConstant(m_globalIblExposureConstantIndex, m_previousGlobalIblExposure);
sceneSrg->SetConstant(m_skyBoxExposureConstantIndex, m_previousSkyBoxExposure);
m_buildingCubeMap = false;
}
else
{
// set exposure to the user specified value while baking the cubemap
sceneSrg->SetConstant(m_iblExposureConstantIndex, m_bakeExposure);
// set exposures to the user specified value while baking the cubemap
sceneSrg->SetConstant(m_globalIblExposureConstantIndex, m_bakeExposure);
sceneSrg->SetConstant(m_skyBoxExposureConstantIndex, m_bakeExposure);
}
}
@ -305,9 +307,10 @@ namespace AZ
const RPI::Ptr<RPI::ParentPass>& rootPass = environmentCubeMapPipeline->GetRootPass();
rootPass->AddChild(m_environmentCubeMapPass);
// store the current IBL exposure value
// store the current IBL exposure values
Data::Instance<RPI::ShaderResourceGroup> sceneSrg = m_scene->GetShaderResourceGroup();
m_previousExposure = sceneSrg->GetConstant<float>(m_iblExposureConstantIndex);
m_previousGlobalIblExposure = sceneSrg->GetConstant<float>(m_globalIblExposureConstantIndex);
m_previousSkyBoxExposure = sceneSrg->GetConstant<float>(m_skyBoxExposureConstantIndex);
m_scene->AddRenderPipeline(environmentCubeMapPipeline);
}

@ -180,8 +180,10 @@ namespace AZ
RPI::Ptr<RPI::EnvironmentCubeMapPass> m_environmentCubeMapPass = nullptr;
RPI::RenderPipelineId m_environmentCubeMapPipelineId;
BuildCubeMapCallback m_callback;
RHI::ShaderInputNameIndex m_iblExposureConstantIndex = "m_iblExposure";
float m_previousExposure = 0.0f;
RHI::ShaderInputNameIndex m_globalIblExposureConstantIndex = "m_iblExposure";
RHI::ShaderInputNameIndex m_skyBoxExposureConstantIndex = "m_cubemapExposure";
float m_previousGlobalIblExposure = 0.0f;
float m_previousSkyBoxExposure = 0.0f;
bool m_buildingCubeMap = false;
};

@ -64,8 +64,8 @@ namespace AZ
->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorReflectionProbeComponent::BakeReflectionProbe)
->Attribute(AZ::Edit::Attributes::Visibility, &EditorReflectionProbeComponent::GetBakedCubemapVisibilitySetting)
->DataElement(AZ::Edit::UIHandlers::Slider, &EditorReflectionProbeComponent::m_bakeExposure, "Bake Exposure", "Exposure to use when baking the cubemap")
->Attribute(AZ::Edit::Attributes::SoftMin, -5.0f)
->Attribute(AZ::Edit::Attributes::SoftMax, 5.0f)
->Attribute(AZ::Edit::Attributes::SoftMin, -16.0f)
->Attribute(AZ::Edit::Attributes::SoftMax, 16.0f)
->Attribute(AZ::Edit::Attributes::Min, -20.0f)
->Attribute(AZ::Edit::Attributes::Max, 20.0f)
->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorReflectionProbeComponent::OnBakeExposureChanged)

Loading…
Cancel
Save