0
내가 깊이 텍스처와 GLSL 쉐이더에 FBO의 색상 질감을 연결하기 위해 노력하고있어 작동하지 않는 두 개의 텍스처를 연결 (버전 4.0)는 OpenGL -
문제는, 동일에 하나의 링크입니다 시간, 이상한 다른 텍스처 아니라 함께 연결하기 때문에 (예 : 정상 및 반사 맵 확산)
가 여기 내 바인드 RT 코드입니다 :
이void RenderTexture::BindRead(GLuint locationColor,GLuint locationDepth,unsigned int unit,unsigned int dUnit)
{
colorUnit = unit;
this->depthUnit = dUnit;
assert(unit >= 0 && unit <= 31);
glActiveTexture(GL_TEXTURE0 + unit);
glBindTexture(GL_TEXTURE_2D,m_rt);
if (hasDepth)
{
assert(depthUnit >= 0 && depthUnit <= 31);
glActiveTexture(GL_TEXTURE0 + dUnit);
glBindTexture(GL_TEXTURE_2D,m_depth);
glUniform1i(locationDepth,dUnit);
}
glUniform1i(locationColor,unit);
}
난 정말 여기에서 뭐가 잘못 됐는지 모르겠어요 ...
쉐이더에 텍스처 바인딩이 작동하지 않는다는 것을 어떻게 알 수 있습니까? 오류가 있습니까? – BDL
아니요, 오류가 발생하지 않습니다. 두 sampler2D가 동일한 값을 반환합니다 (깊이를 먼저 설정하면 두 가지 모두 깊이 텍스처가됩니다) –
쉐이더를 표시 할 수 있습니까? – BDL