vsg-dev / VulkanSceneGraph

Vulkan & C++17 based Scene Graph Project
http://www.vulkanscenegraph.org
MIT License
1.32k stars 212 forks source link

Nodes flicker when moving the camera #113

Closed sbrkopac closed 5 years ago

sbrkopac commented 5 years ago

Describe the bug When moving the scene, all nodes in the scene rapidly flicker. There are even some angles or instances where you can get the nodes to disappear completely.

To Reproduce

Add the Trackball manipulator to the vsgdraw example

viewer->addEventHandlers({vsg::CloseHandler::create(viewer), vsg::Trackball::create(camera)});

Expected behavior No flickering should occur

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

sbrkopac commented 5 years ago

This only seems to happen when I attempt to rotate the scene.

robertosfield commented 5 years ago

Just tested it and the trackball is not behaving itself at all right now. Clearly there's been a regression due to recent changes to the maths function. I hope to get a fix checked in this morning.

vsg-dev commented 5 years ago

I've tracked down the regression to the change in the mat4 constructor order not being taken account of in the lookAtInverse() function. I've replaced this function with use of the new inverse() function. An update to VSG master will provide this fix. The commit is:

https://github.com/vsg-dev/VulkanSceneGraph/commit/3e501385e9fd36010148798b7519d2373f998f95