mirror of https://github.com/bjornbytes/lovr.git
Automatically detect mipmap count for IBL;
This commit is contained in:
parent
b5be93b94b
commit
2c115ce66e
|
@ -242,7 +242,8 @@ const char* lovrStandardFragmentShader = ""
|
|||
// Indirect lighting
|
||||
"#ifdef FLAG_indirectLighting \n"
|
||||
" vec2 lookup = texture(lovrBRDFLookup, vec2(NoV, roughness)).rg; \n"
|
||||
" vec3 specularIndirect = (F0 * lookup.r + lookup.g) * textureLod(lovrSpecularIrradianceTexture, R, roughness * 1.).rgb; \n"
|
||||
" float mipmaps = log2(textureSize(lovrSpecularIrradianceTexture, 0).x); \n"
|
||||
" vec3 specularIndirect = (F0 * lookup.r + lookup.g) * textureLod(lovrSpecularIrradianceTexture, R, roughness * mipmaps).rgb; \n"
|
||||
" vec3 diffuseIndirect = diffuseDirect * E_SphericalHarmonics(lovrIrradiance, N); \n"
|
||||
"#ifdef FLAG_occlusion \n" // Occlusion only affects indirect diffuse light
|
||||
" diffuseIndirect *= texture(lovrOcclusionTexture, uv).r; \n"
|
||||
|
|
Loading…
Reference in New Issue