Opengl 基于物理的渲染:环境光在BRDF中的作用
我试图弄清楚我的BRDF方法是否正确Opengl 基于物理的渲染:环境光在BRDF中的作用,opengl,glsl,rendering,pbr,Opengl,Glsl,Rendering,Pbr,我试图弄清楚我的BRDF方法是否正确 // Calculate sun BRDF color vec3 sunBrdf = brdf(tsLightSourceDir, tsEyeDir, tsNormal, vtsTangent, vtsBinormal, albedo.rgb, NdotL, NdotV, tRoughness, tM
// Calculate sun BRDF color
vec3 sunBrdf = brdf(tsLightSourceDir, tsEyeDir,
tsNormal, vtsTangent, vtsBinormal,
albedo.rgb,
NdotL, NdotV,
tRoughness, tMetallic, specular);
// brdf multiplied by incoming sun radiance -> color
vec3 irradiance = sunAmbientRadiance + sunDiffuseRadiance * NdotL;
vec3 brdfColor = sunBrdf * irradiance;
// Add base ambient color
vec3 ambientColor = albedo.rgb * sunAmbientRadiance;
resultColor = ambientColor;
resultColor += brdfColor;
// Interpolate by shadow
resultColor = mix(ambientColor,
resultColor,
shadowAmount);
我的问题是:我正在添加环境光2x。计算环境色时为1x,将其与进入BRDF的光量相加为1x
我不知道这是否正确,因为我认为BRDF需要环境光,因为它是到达表面的照明的一部分。但另一方面,它已经通过乘以反照率颜色来计算,并添加为基础颜色
非常感谢您的帮助 正确的公式如下(在我看来): vec3辐照度=日晷辐射*NdotL