Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion filament/src/materials/skybox.mat
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ fragment {
sky = vec4(textureCube(materialParams_skybox, variable_eyeDirection.xyz).rgb, 1.0);
#else
sky = vec4(textureLod(materialParams_skybox, variable_eyeDirection.xyz, 0.0).rgb, 1.0);
#endif
sky.rgb *= frameUniforms.iblLuminance;
#endif // MATERIAL_FEATURE_LEVEL == 0
}
#if MATERIAL_FEATURE_LEVEL > 0
if (materialParams.showSun != 0 && frameUniforms.sun.w >= 0.0) {
vec3 direction = normalize(variable_eyeDirection.xyz);
// Assume the sun is a sphere
Expand All @@ -53,6 +54,7 @@ fragment {
float gradient = pow(1.0 - saturate(x), frameUniforms.sun.w);
sky.rgb = sky.rgb + gradient * sun;
}
#endif // MATERIAL_FEATURE_LEVEL > 0
material.baseColor = sky;
}
}
Expand Down
8 changes: 4 additions & 4 deletions libs/filamat/src/shaders/UibGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,16 @@ BufferInterfaceBlock const& UibGenerator::getPerViewUib() noexcept {
{ "dynReserved2", 0, Type::INT },

{ "iblLuminance", 0, Type::FLOAT, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
{ "iblRoughnessOneLevel", 0, Type::FLOAT, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
{ "iblRoughnessOneLevel", 0, Type::FLOAT },
{ "iblSH", 9, Type::FLOAT3 },

// ------------------------------------------------------------------------------------
// Directional Lighting [variant: DIR]
// ------------------------------------------------------------------------------------
{ "lightDirection", 0, Type::FLOAT3, Precision::HIGH, FeatureLevel::FEATURE_LEVEL_0 },
{ "lightDirection", 0, Type::FLOAT3, Precision::HIGH },
{ "padding0", 0, Type::FLOAT },
{ "lightColorIntensity", 0, Type::FLOAT4, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
{ "sun", 0, Type::FLOAT4, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
{ "lightColorIntensity", 0, Type::FLOAT4, Precision::DEFAULT },
{ "sun", 0, Type::FLOAT4, Precision::DEFAULT },
{ "shadowFarAttenuationParams", 0, Type::FLOAT2, Precision::HIGH },

// ------------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions shaders/src/surface_light_indirect.fs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if MATERIAL_FEATURE_LEVEL > 0

//------------------------------------------------------------------------------
// Image based lighting configuration
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -819,3 +821,5 @@ void evaluateIBL(const MaterialInputs material, const PixelParams pixel, inout v
color.rgb += Ft;
#endif
}

#endif // MATERIAL_FEATURE_LEVEL > 0
4 changes: 4 additions & 0 deletions shaders/src/surface_light_punctual.fs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if MATERIAL_FEATURE_LEVEL > 0

//------------------------------------------------------------------------------
// Punctual lights evaluation
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -271,3 +273,5 @@ void evaluatePunctualLights(const MaterialInputs material,
}
}
}

#endif // MATERIAL_FEATURE_LEVEL > 0