You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varphi=halton(i+offset,2)*Math.PI*2;// rejecting samples that are close to tangent plane to avoid z-fighting artifactsvarcosTheta=1.0-(halton(i+offset,3)*0.85+0.15);varsinTheta=Math.sqrt(1.0-cosTheta*cosTheta);varr=Math.random();// for tbn spacevarx=Math.cos(phi)*sinTheta*r;vary=Math.sin(phi)*sinTheta*r;varz=cosTheta*r;
clay-viewer/src/graphic/SSAOPass.js
Line 45 in 86456ed
这里phi代表的是方位角吧,如果半球采样的话,theta 最大是 Math.PI,phi最大应该始终是2 * Math.PI。
另外,参考babylon的实现,建议处理一下theta角,避免因过于接近水平面而出现z-fight
The text was updated successfully, but these errors were encountered: