Make clipping planes consistent across most headset drivers;

The default far clipping plane was changed from 30 to 100 for openvr
and oculus.  oculus_mobile clipping planes can't be changed easily.
This commit is contained in:
bjorn 2020-01-23 11:25:38 -08:00
parent 8c429e89ac
commit c7f5406ce2
4 changed files with 8 additions and 3 deletions

View File

@ -29,7 +29,7 @@ static struct {
static bool desktop_init(float offset, uint32_t msaa) {
state.offset = offset;
state.clipNear = 0.1f;
state.clipNear = .1f;
state.clipFar = 100.f;
if (!state.initialized) {

View File

@ -87,8 +87,8 @@ static bool oculus_init(float offset, uint32_t msaa) {
state.needRefreshTracking = true;
state.needRefreshButtons = true;
state.clipNear = 0.1f;
state.clipFar = 30.f;
state.clipNear = .1f;
state.clipFar = 100.f;
map_init(&state.textureLookup, 4);

View File

@ -416,6 +416,9 @@ static bool openxr_init(float offset, uint32_t msaa) {
state.layerViews[1].subImage.imageRect.offset.x += state.width;
}
state.clipNear = .1f;
state.clipNear = 100.f;
return true;
}

View File

@ -30,6 +30,8 @@ var LibraryLOVR = {
var a, b, c, d, e, canvas, display;
webvr.initialized = true;
webvr.display = display = Module.lovrDisplay;
webvr.display.depthNear = .1;
webvr.display.depthFar = 100;
webvr.canvas = canvas = Module.canvas;
webvr.frameData = new VRFrameData();
webvr.gamepads = [];