bjornblissing / osgoculusviewer

An OsgViewer with support for the Oculus Rift
Other
106 stars 67 forks source link

Should disable the rendering of main camera to increase frame rate #11

Closed west036 closed 10 years ago

west036 commented 10 years ago

camera->setcullmarsk

bjornblissing commented 10 years ago

Hi West036,

Could you give a more detailed explanation of what you would like to happen with the camera->setCullMask() setting of the main camera? Which nodes do you want to filter out from the main camera?

Or even better supply me with a pull request of your suggested changes.

Best regards Björn

west036 commented 10 years ago

Björn, Two HUD cameras block the main camera render image, so not only the main camera's rendering become meaningless, but also a waste of time. Need to filtering whole of sencedata out from the main camera. sorry, I don't know how to pull a suggested changes, but I think this is a feasible way mainCamera->setCullMask(0x02) ; rttCamera->setCullMask(0x01) ;//left and right root->setNodeMask(0x01) ;

bjornblissing commented 10 years ago

Well, that makes sense. Made a quick test and got a noticeable performance increase of my test scene. I will try to implement this in my code. But working with nodemask can be a bit tricky since I like to have the ViewerConfig as self contained as possible, i.e. I do not want to set edit nodemasks in the OsgOculusViewer example file.

So I need to figure out a way of getting the nodemask settings from inside the OculusViewerConfig class and filter out the node from the main camera from there.

Another complication can be that there may already be nodemask settings present on the loaded model.