Skip to content

Commit 20aa91e

Browse files
authored
remove sunDisk in skybox at FL0 (#9675)
1 parent d65589b commit 20aa91e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

filament/src/materials/skybox.mat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ fragment {
4040
sky = vec4(textureCube(materialParams_skybox, variable_eyeDirection.xyz).rgb, 1.0);
4141
#else
4242
sky = vec4(textureLod(materialParams_skybox, variable_eyeDirection.xyz, 0.0).rgb, 1.0);
43-
#endif
4443
sky.rgb *= frameUniforms.iblLuminance;
44+
#endif // MATERIAL_FEATURE_LEVEL == 0
4545
}
46+
#if MATERIAL_FEATURE_LEVEL > 0
4647
if (materialParams.showSun != 0 && frameUniforms.sun.w >= 0.0) {
4748
vec3 direction = normalize(variable_eyeDirection.xyz);
4849
// Assume the sun is a sphere
@@ -53,6 +54,7 @@ fragment {
5354
float gradient = pow(1.0 - saturate(x), frameUniforms.sun.w);
5455
sky.rgb = sky.rgb + gradient * sun;
5556
}
57+
#endif // MATERIAL_FEATURE_LEVEL > 0
5658
material.baseColor = sky;
5759
}
5860
}

libs/filamat/src/shaders/UibGenerator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,16 @@ BufferInterfaceBlock const& UibGenerator::getPerViewUib() noexcept {
148148
{ "dynReserved2", 0, Type::INT },
149149

150150
{ "iblLuminance", 0, Type::FLOAT, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
151-
{ "iblRoughnessOneLevel", 0, Type::FLOAT, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
151+
{ "iblRoughnessOneLevel", 0, Type::FLOAT },
152152
{ "iblSH", 9, Type::FLOAT3 },
153153

154154
// ------------------------------------------------------------------------------------
155155
// Directional Lighting [variant: DIR]
156156
// ------------------------------------------------------------------------------------
157-
{ "lightDirection", 0, Type::FLOAT3, Precision::HIGH, FeatureLevel::FEATURE_LEVEL_0 },
157+
{ "lightDirection", 0, Type::FLOAT3, Precision::HIGH },
158158
{ "padding0", 0, Type::FLOAT },
159-
{ "lightColorIntensity", 0, Type::FLOAT4, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
160-
{ "sun", 0, Type::FLOAT4, Precision::DEFAULT, FeatureLevel::FEATURE_LEVEL_0 },
159+
{ "lightColorIntensity", 0, Type::FLOAT4, Precision::DEFAULT },
160+
{ "sun", 0, Type::FLOAT4, Precision::DEFAULT },
161161
{ "shadowFarAttenuationParams", 0, Type::FLOAT2, Precision::HIGH },
162162

163163
// ------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)