File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1117,6 +1117,8 @@ function initialize() {
1117
1117
gl . clearColor ( 0 , 0.8 , 1 , 0 ) ;
1118
1118
gl . clear ( gl . COLOR_BUFFER_BIT | gl . DEPTH_BUFFER_BIT | gl . STENCIL_BUFFER_BIT ) ;
1119
1119
1120
+ var presentingVR = g_vrDisplay && g_vrDisplay . isPresenting && pose . position ;
1121
+
1120
1122
var near = 1 ;
1121
1123
var far = 25000 ;
1122
1124
var aspect = canvas . clientWidth / canvas . clientHeight ;
@@ -1129,7 +1131,7 @@ function initialize() {
1129
1131
var xOff = width * g . net . offset [ 0 ] * g . net . offsetMult ;
1130
1132
var yOff = height * g . net . offset [ 1 ] * g . net . offsetMult ;
1131
1133
var uiMatrix = new Float32Array ( 16 ) ;
1132
- if ( g_vrDisplay && g_vrDisplay . isPresenting && pose . position ) {
1134
+ if ( presentingVR ) {
1133
1135
// Using head-neck model in VR mode because of unclear distance measurement(vr return position using meters),
1134
1136
// user could see around but couldn't move around.
1135
1137
eyePosition [ 0 ] = g . globals . eyeRadius ;
@@ -1416,7 +1418,8 @@ function initialize() {
1416
1418
1417
1419
gl . enable ( gl . BLEND ) ;
1418
1420
gl . disable ( gl . CULL_FACE ) ;
1419
- if ( g . options . lightRays . enabled ) {
1421
+ // Light rays are not supported in VR mode - they are rendered in a way that they can't handle headset rotation.
1422
+ if ( g . options . lightRays . enabled && ! presentingVR ) {
1420
1423
gl . blendFunc ( gl . SRC_ALPHA , gl . ONE ) ;
1421
1424
gl . depthMask ( false ) ;
1422
1425
lightRay . drawPrep ( lightRayConst ) ;
You can’t perform that action at this time.
0 commit comments