Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ namespace DynamicCubemaps
# if defined(IBL) && defined(LIGHTING)
const bool inWorld = (Permutation::ExtraShaderDescriptor & Permutation::ExtraFlags::InWorld);
const bool inReflection = (Permutation::ExtraShaderDescriptor & Permutation::ExtraFlags::InReflection);
if (SharedData::iblSettings.EnableIBL && SharedData::iblSettings.UseStaticIBL && !inWorld && !inReflection) {
float3 specularIrradiance = ImageBasedLighting::StaticSpecularIBLTexture.SampleLevel(SampColorSampler, R.xzy, level).xyz;
finalIrradiance = specularIrradiance;
return finalIrradiance;
}
const bool useStaticIBL = SharedData::iblSettings.EnableIBL && SharedData::iblSettings.UseStaticIBL && !inWorld && !inReflection;
# else
const bool useStaticIBL = false;
# endif

if (!useStaticIBL) {
# if defined(SKYLIGHTING)
float skylightingSpecular = 0.0;
if (!SharedData::InInterior) {
Expand All @@ -59,7 +58,8 @@ namespace DynamicCubemaps
if (SharedData::iblSettings.EnableIBL) {
float3 envSample = EnvTexture.SampleLevel(SampColorSampler, R, level);
float3 fullSample = EnvReflectionsTexture.SampleLevel(SampColorSampler, R, level);
float3 envSpecular, skySpecular;
float3 envSpecular = 0.0;
float3 skySpecular = 0.0;

if (SharedData::iblSettings.DALCMode == 2) {
// Mode 2: DALC-normalized env scaled by DALCAmount + sky overlay
Expand Down Expand Up @@ -118,6 +118,12 @@ namespace DynamicCubemaps
finalIrradiance = Color::IrradianceToLinear(specularIrradiance);
# endif
}
} else {
# if defined(IBL) && defined(LIGHTING)
float3 specularIrradiance = ImageBasedLighting::StaticSpecularIBLTexture.SampleLevel(SampColorSampler, R.xzy, level).xyz;
finalIrradiance = specularIrradiance;
# endif
}

return finalIrradiance;
# endif
Expand Down Expand Up @@ -147,8 +153,7 @@ namespace DynamicCubemaps
const bool inReflection = (Permutation::ExtraShaderDescriptor & Permutation::ExtraFlags::InReflection);
if (SharedData::iblSettings.EnableIBL && SharedData::iblSettings.UseStaticIBL && !inWorld && !inReflection) {
float3 specularIrradiance = ImageBasedLighting::StaticSpecularIBLTexture.SampleLevel(SampColorSampler, R.xzy, level).xyz;
finalIrradiance += specularIrradiance;
return (F0 * specularBRDF.x + specularBRDF.y) * finalIrradiance;
return (F0 * specularBRDF.x + specularBRDF.y) * specularIrradiance;
}
# endif

Expand All @@ -163,7 +168,8 @@ namespace DynamicCubemaps
if (SharedData::iblSettings.EnableIBL) {
float3 envSample = EnvTexture.SampleLevel(SampColorSampler, R, level);
float3 fullSample = EnvReflectionsTexture.SampleLevel(SampColorSampler, R, level);
float3 envSpecular, skySpecular;
float3 envSpecular = 0.0;
float3 skySpecular = 0.0;

if (SharedData::iblSettings.DALCMode == 2) {
// Mode 2: DALC-normalized env scaled by DALCAmount + sky overlay
Expand Down
Loading