how Multiview Textures work ?

in render-to-texture demo, i set a Multiview Textures

self.texBase = Texture()
self.texBase.setNumViews(2)
self.texBase.setTexturesPower2(0)
base.win.addRenderTexture(self.texBase,GraphicsOutput.RTM_bind_or_copy)

self.makeTvMan(-5, 30, 1, self.texBase, 0.9)
self.makeTvMan(5, 30, 1, self.texBase, 1.4)
self.makeTvMan(0, 23, -3, self.texBase, 2.0)
self.makeTvMan(-5, 20, -6, self.texBase, 1.1)
self.makeTvMan(5, 18, -5, self.texBase, 1.7)

and set config : loadPrcFileData(’’, ‘side-by-side-stereo 1’)

i found view 0 is left and right side by side image, view 1 is nothing. not left eye image in view0,and right in view1

This only works for buffers, not for the main window. You have to create a buffer with stereo.

For example, to adjust the Teapot on TV sample, replace the buffer creation code:

fbp = FrameBufferProperties()
fbp.setRgbaBits(1, 1, 1, 1)
fbp.setDepthBits(1)
fbp.setStereo(True)

tex = Texture()
tex.setNumViews(2)

altBuffer = self.win.makeTextureBuffer("hello", 256, 256, tex, False, fbp)
altBuffer.getTexture(0).setNumViews(2)

And enable side-by-side with exaggerated interocular distance to see the effect:

loadPrcFileData("", """
side-by-side-stereo true
default-iod 5
""")