microsoft / HoloJS

Provides a framework for creating holographic apps using JavaScript and WebGL.
MIT License
1.19k stars 114 forks source link

THREE.WebGLProgram error: "extension directive must occur before any non-preprocessor tokens in ESSL3" #47

Closed odimond closed 7 years ago

odimond commented 7 years ago

Hi HoloJS,

There are errors from ThreeJS default shaders (I have observed MeshBasicMaterial and MeshPhongMaterial) in THREE.WebGLProgram: "extension directive must occur before any non-preprocessor tokens in ESSL3" which we do not see in any browser. I commented out "customExtensions" from prefixFragment in WebGLProgram and the errors go away but I don't know if there are side-effects doing this.

Thanks.

Almost-Done commented 7 years ago

Thank you for letting us know. I'll take a look. ThreeJS's shaders are being updated in the ANGLE layer to automatically convert them to stereo and this might be causing the errors.

Almost-Done commented 7 years ago

I made some fixes to the auto-stereo shader changes. Previously it was possible to rewrite unintended sections of the shader - the warnings you're describing are consistent with the types of corruptions we were causing.

With those fixes in, I no longer see these warnings and these materials seem to work as expected.