Commit Graph
21 Commits
Author SHA1 Message Date
Branimir Karadžić 466c76071a Cleanup. 2015-06-05 10:43:43 -07:00
Matthew Endsley 05d70ea99d VR: Fix skewed viewports with buffered eye textures
Bug fix for #419

Viewport calculations need to take VR eye buffer size into
account. Noticable at the older 100px boundary. Skewing still
exists at newer 8px buffer, but is harder to notice.
Eventually causes pretty bad eye strain, though.

Easily reproduced by setting the buffer to something obscenely
large, such as 2048.
2015-06-05 02:12:24 -07:00
Matthew Endsley 9020994470 VR: Add buffer between left/right eye textures
This prevents bleeding across the individual viewports
when the oculus SDK applies distortion mapping. The current
reccommended values are 100px for SDK <= 0.5 and 8px for > 0.5

See: http://static.oculus.com/sdk-downloads/documents/0.6.0/Oculus_Developer_Guide.pdf
  in the "Bugs Fixed Since the Last Release" section.

For an example of this artifact, see the correct scene render:
![Imgur](http://i.imgur.com/fZZExg8.jpg)

followed by a scene that bleeds the left eye into the right eye:
![Imgur](http://i.imgur.com/dZalmPS.jpg)
2015-06-04 18:44:31 -07:00
Matthew Endsley 1e604e8f38 VR: Add device resolution to HMD. Init at startup.
BREAKING: bgfx::getHMD() now returns a valid pointer
if the VR runtime was initialized. This is different
from existing behavior where getHMD returned NULL until
a bgfx::reset(... BGFX_RESET_HMD) was issued. Applications
must now check HMD::flags for the current state of the VR
runtime. The following code has the code change required:

`const bgfx::HMD* hmd = bgfx::getHMD()
if (NULL != hmd)`
becomes:
`const bgfx::HMD* hmd = bgfx::getHMD()
if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDRERING))
{
	// rendering logic
}`

See the updated examples for details.

This allows applications to create the appropriately
sized back buffer for the HMD device by using the new device
resolution fields HMD::deviceHeight and HMD::deviceWidth.
These values report the pixel resolution of the attached
HMD hardware.

This also allows applications to query the reported HMD
resolution immediately after bgfx::init. This prevents
the device from being cycled which generates rendring
artifacts on startup - namely flashing back to a black
screen and reseting the Health+Warning disaply.

This involves initialization the ovrHmd device on
initialization, but deferring rendering until
postReset has been called. This adds an addiional
memory overhead of 32k to builds defining BGFX_CONFIG_USE_OVR.
The overhead for current builds is ~1.9MB for calls to
ovr_Initialize, so the additional overhead is pretty
trivial (+1.8%)
2015-06-03 15:39:09 -07:00
Branimir Karadžić 80b6202ec0 Fixed switch without case warning. 2015-04-27 19:38:48 -07:00
James Darpinian b54d33cdf7 Initialize Oculus pose after reset.
Without this change the pose is uninitialized during the first frame which causes Oculus timewarp to warp the output in crazy ways.
2015-04-17 11:03:41 -07:00
James Darpinian 8a689fac0d Switch Oculus distortion to high quality mode. 2015-04-17 11:03:04 -07:00
Branimir Karadžić 12998fe580 Update OVR pose. 2015-04-15 21:52:31 -07:00
Branimir Karadžić 6edd804f7a Cleanup. 2015-04-15 21:31:24 -07:00
Branimir Karadžić 66edb6c566 Moved HMD tracking into flip. Removed unnecessary frame data when using single-threaded renderer. 2015-04-15 20:59:00 -07:00
Branimir Karadžić 5ac092d036 Cleanup. 2015-04-14 22:05:20 -07:00
Matthew Endsley a8f715e279 Support Oculus SDK versions through 0.5.0.1-beta
Tested against the following SDKs:
 - 0.5.0-beta
 - 0.4.4-beta
 - 0.4.3-beta
 - 0.4.2-beta
 - 0.4.1-beta
 - 0.4.0-beta
2015-03-29 20:38:54 -07:00
Branimir Karadžić c25dd466be Updated copyright year. 2015-01-01 15:04:46 -08:00
Branimir Karadžić 9d83a5307c Fixed example 24-nbody with OVR. 2014-12-28 10:12:24 -08:00
Branimir Karadžić 08d97d8c4b OVR: Support for multiple SDK versions. 2014-12-21 18:55:33 -08:00
Branimir Karadžić 3ccf3f70bb Cleanup. 2014-12-10 22:44:00 -08:00
Branimir Karadžić 18e9c30a0c Updated OVR SDK 0.4.4. 2014-12-05 19:17:59 -08:00
Branimir Karadžić 7c1c180243 Fixed compile error. 2014-11-30 00:03:02 -08:00
Branimir Karadžić e147e7b2e6 OVR: Added rendering without distortion. 2014-11-12 21:26:28 -08:00
Branimir Karadžić 31efb2991f Updated to OVR 0.4.3. Added support for event char to read keyboard text input. 2014-11-08 20:57:47 -08:00
Branimir Karadžić f6cf4df3d3 Added OculusVR support. 2014-10-28 22:08:55 -07:00