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.
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
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
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!
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!