getStereoEye() broken in stereoscopic 3D QUAD-BUFFER mode?

I’m running BGE in QUAD-BUFFER mode (stereoscopic 3D) on NVDIA Quadro based PC.
Stereo 3D seems to work fine but when I run:

from bge import render
print(render.getStereoEye())

I get either 11111111… or 00000000…

I wold expect it to be 1010101010…

For my project, I need to know which is the current eye being rendered in order to to modify the viewpoint position and the projection Matrix accordingly.

Am I the only one facing this issue?

Thank you

You have to use that inside a draw callback (where it is inside a drawing context) otherwise it is returning values from the last render (or two render calls, for each eye).

However, I do recall there may be a bug here, in that you don’t always get the correct eye… That may have been fixed by this patch

Understood.

from bge import render, logic

def get_stero_eye():
    print(render.getStereoEye())
    
scene = logic.getCurrentScene()
scene.pre_draw.append(get_stero_eye) 

seems to work.

However, the documentation is not crystal clear about this method. I think It should be fixed.

Gets the current stereoscopy eye being rendered. This function is mainly used in a bge.types.KX_Scene.pre_draw callback function to customize the camera projection matrices for each stereoscopic eye.

However, I do recall there may be a bug here, in that you don’t always get the correct eye… That may have been fixed by this patch

This patch = ???

Although you’re correct, that information is not technically explained, it should be relatively obvious if you think about how the logic is processed - the logic ticks once, the render draws that twice. Hence, in a logic context, you won’t see both eyes being rendered, whilst in a render callback, (called for each eye), you do! :slight_smile:

Although you’re correct, that information is not technically explained, it should be relatively obvious if you think about how the logic is processed - the logic ticks once, the render draws that twice. Hence, in a logic context, you won’t see both eyes being rendered, whilst in a render callback, (called for each eye), you do! :slight_smile:

Makes sense.

What about the patch you were talking about?

Thanks

I was mistaken; this feature was added in the patch https://lists.blender.org/pipermail/bf-blender-cvs/2015-January/072506.html.

I was mistaken; this feature was added in the patch https://lists.blender.org/pipermail/…ry/072506.html.

Great! :eyebrowlift::eyebrowlift: