View Single Post
  #1  
Old 01-22-2015, 03:08 PM
performlabrit performlabrit is offline
Member
 
Join Date: Oct 2013
Posts: 77
Oculus runtime disrupts clustering to mirror DK2 display

Hello! I can't seem to get my DK2 display to mirror correctly on a second monitor, and it appears to be because of the Oculus Runtime.

I am following your suggestion to use clustering to create two independent views of the scene, one window inside the Oculus Rift DK2 that uses the oculus module, and 1 on my desktop monitor that does not.

Although clustering does appear to create two windows, nothing is being rendered to the window that is not displayed on the DK2 unless I disable the oculus module.

Strangely enough, this is true when the client is on the local machine, or when it's on another machine on the LAN.

Example code pasted below. Note that you may have to change variables expMon to the ID of the desktop monitor and hmdMon to the ID of the Oculus Rift DK2.

Note that it will work if you comment out lines 40-50 (the parts which enable the Oculus module).

Thanks!

Code:
import viz


# Load environment
piazza = viz.add('piazza.osgb')
viz.add('piazza_animations.osgb')

# Swap out sky with animated sky dome
piazza.getChild('pz_skydome').remove()
day = viz.add('sky_day.osgb')
day.renderToBackground()


expMon = 2
hmdMon = 1

with viz.cluster.MaskedContext(viz.ALLCLIENTS):
	
	viz.window.setFullscreenMonitor(expMon)
	#viz.setMultiSample(8)
	#viz.vsync
	viz.window.setFullscreen(True)
	#viz.setOption('viz.glFinish',1)
	
	piazza = viz.add('piazza.osgb')
	
	text1 = viz.add(viz.TEXT3D,'EXP')
	text1.alignment(viz.ALIGN_RIGHT_BOTTOM)
	text1.setPosition([0.5,0.5,0])
	
	viz.go()
	
with viz.cluster.MaskedContext(viz.MASTER):
# The oculus is master
	import oculus
	viz.window.setFullscreenMonitor(hmdMon)
	viz.setMultiSample(8)
	viz.vsync
	
	##################################################################
	# Setup Oculus Rift HMD
	hmd = oculus.Rift()

	if not hmd.getSensor():
		sys.exit('Oculus Rift not detected')

	# Go fullscreen if HMD is in desktop display mode
	if hmd.getSensor().getDisplayMode() == oculus.DISPLAY_DESKTOP:
		viz.window.setFullscreen(True)
	###################################################################
	
	text1 = viz.add(viz.TEXT3D,'HMD',parent=viz.SCREEN)
	text1.alignment(viz.ALIGN_RIGHT_BOTTOM)
	text1.setPosition([0.5,0.5,0])
	 
	viz.go()
Reply With Quote