سؤال

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