최근에 내 엔진 (지연된 음영)에 SSAO를 구현했지만 SSAO와 글로벌 라이트 및 로컬 라이트 (포인트 라이트)를 결합해야하는 방법에 대해 매우 불안합니다.SSAO와 전역 조명 및 로컬 표시 등을 결합하십시오.
나는이 작업을 수행해야 :
//Global light pass.
vec3 sceneColor = DiffuseBRDF + SpecularBRDF;
float luminance = dot(sceneColor, vec3(0.2126, 0.7152, 0.0722));
sceneColor *= mix(texture(ssaoTexture, texCoord).r, 1.0, luminance);
//Local light pass.
//Use additive blending in this pass, i.e. glBlendFunc(GL_ONE, GL_ONE).
//The final result would be:
vec3 finalColor = sceneColor + pointLight0 + pointLight1 + ... + pointLightN;
나이 :
//Global light pass.
vec3 sceneColor = DiffuseBRDF + SpecularBRDF;
//Local light pass.
//Use additive blending in this pass, i.e. glBlendFunc(GL_ONE, GL_ONE).
vec3 finalColor = sceneColor + pointLight0 + pointLight1 + ... + pointLightN;
//Composite pass.
float luminance = dot(finalColor, vec3(0.2126, 0.7152, 0.0722));
finalColor *= mix(texture(ssaoTexture, texCoord).r, 1.0, luminance);
음,'ssaoTexture'는 무엇을 의미합니까? SSAO는 장면의 모서리를 찾아이를 기반으로 주변의 빛을 없애고 화면 공간에서 일어난 것 같습니다. 나는 그 모델에 맞는'ssaoTexture'에 무엇이 있을지 모른다. –
ssaoTexture에는 현재 프레임에 대해 계산 된 SSAO가 포함됩니다. – karl88