mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-02 04:37:54 +08:00
Set max specular IBL reflection mip level to 4.0 to match the number of generated mips.
This commit is contained in:
@@ -128,7 +128,7 @@ void main()
|
||||
vec3 diffuse = irradiance * albedo;
|
||||
|
||||
// sample both the pre-filter map and the BRDF lut and combine them together as per the Split-Sum approximation to get the IBL specular part.
|
||||
const float MAX_REFLECTION_LOD = 5.0;
|
||||
const float MAX_REFLECTION_LOD = 4.0;
|
||||
vec3 prefilteredColor = textureLod(prefilterMap, R, roughness * MAX_REFLECTION_LOD).rgb;
|
||||
vec2 brdf = texture(brdfLUT, vec2(max(dot(N, V), 0.0), roughness)).rg;
|
||||
vec3 specular = prefilteredColor * (F * brdf.x + brdf.y);
|
||||
|
||||
@@ -157,7 +157,7 @@ void main()
|
||||
vec3 diffuse = irradiance * albedo;
|
||||
|
||||
// sample both the pre-filter map and the BRDF lut and combine them together as per the Split-Sum approximation to get the IBL specular part.
|
||||
const float MAX_REFLECTION_LOD = 5.0;
|
||||
const float MAX_REFLECTION_LOD = 4.0;
|
||||
vec3 prefilteredColor = textureLod(prefilterMap, R, roughness * MAX_REFLECTION_LOD).rgb;
|
||||
vec2 brdf = texture(brdfLUT, vec2(max(dot(N, V), 0.0), roughness)).rg;
|
||||
vec3 specular = prefilteredColor * (F * brdf.x + brdf.y);
|
||||
|
||||
Reference in New Issue
Block a user