immersive-web / cardboard-vr-display

A JavaScript implementation of a WebVR 1.1 VRDisplay
https://immersive-web.github.io/cardboard-vr-display
Apache License 2.0
91 stars 43 forks source link

WebGL2 wrong resize #34

Closed supervitas closed 5 years ago

supervitas commented 5 years ago

https://github.com/immersive-web/cardboard-vr-display/blob/b2fd5b03fa579fecead1b3842782d7640e8ae61f/src/cardboard-vr-display.js#L298

This dosenot work if context is WebGL2

Should be: var gl = this.layer_.source.getContext('webgl'); if (!gl) gl = this.layer_.source.getContext('experimental-webgl'); if (!gl) gl = this.layer_.source.getContext('webgl2');

jsantell commented 5 years ago

Good catch, and thanks for filing! Do you have a webgl2 scene to test this on, or interested in making a PR?

supervitas commented 5 years ago

Yeah, here it is - https://github.com/immersive-web/cardboard-vr-display/pull/35

I tested this on my scene with WebGL 2 engine

jsantell commented 5 years ago

Fixed via #35 -- will be in next release