문제

I'm drawing my scene to a texture using FBO and reading the pixel in order to select my object.

The problem is that the drawing into the texture is ignoring the depth Left is real scene and right is the texture

On Left is scene and right is the texture (saved it to file for debug reasons). As u can see there are 2 planes one on top of another and the one in the front is more directed up. although on the texture it's the other way around. and this makes the user pick the plane in the background when he sees the other plane.

I'v tried to enable everything i thought of but i guess i'm missing something.

도움이 되었습니까?

해결책

Thanks to ratchet freak,

I've realized that i skipped the depth buffer :)

I just had to create a render buffer for the depth component and attach it to the frame buffer object.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top