@@ -746,9 +746,9 @@ class RendererGL extends Renderer3D {
746746 if ( ! this . _defaultNormalShader ) {
747747 this . _defaultNormalShader = new Shader (
748748 this ,
749- this . _webGL2CompatibilityPrefix ( "vert" , "mediump " ) +
749+ this . _webGL2CompatibilityPrefix ( "vert" , "highp " ) +
750750 defaultShaders . normalVert ,
751- this . _webGL2CompatibilityPrefix ( "frag" , "mediump " ) +
751+ this . _webGL2CompatibilityPrefix ( "frag" , "highp " ) +
752752 defaultShaders . normalFrag ,
753753 {
754754 vertex : {
@@ -774,9 +774,9 @@ class RendererGL extends Renderer3D {
774774 if ( ! this . _defaultColorShader ) {
775775 this . _defaultColorShader = new Shader (
776776 this ,
777- this . _webGL2CompatibilityPrefix ( "vert" , "mediump " ) +
777+ this . _webGL2CompatibilityPrefix ( "vert" , "highp " ) +
778778 defaultShaders . normalVert ,
779- this . _webGL2CompatibilityPrefix ( "frag" , "mediump " ) +
779+ this . _webGL2CompatibilityPrefix ( "frag" , "highp " ) +
780780 defaultShaders . basicFrag ,
781781 {
782782 vertex : {
@@ -802,9 +802,9 @@ class RendererGL extends Renderer3D {
802802 if ( ! this . _defaultLineShader ) {
803803 this . _defaultLineShader = new Shader (
804804 this ,
805- this . _webGL2CompatibilityPrefix ( "vert" , "mediump " ) +
805+ this . _webGL2CompatibilityPrefix ( "vert" , "highp " ) +
806806 defaultShaders . lineVert ,
807- this . _webGL2CompatibilityPrefix ( "frag" , "mediump " ) +
807+ this . _webGL2CompatibilityPrefix ( "frag" , "highp " ) +
808808 defaultShaders . lineFrag ,
809809 {
810810 vertex : {
@@ -889,14 +889,20 @@ class RendererGL extends Renderer3D {
889889 */
890890 _createImageLightShader ( type ) {
891891 if ( type === 'diffused' ) {
892- return this . _pInst . createShader (
893- defaultShaders . imageLightVert ,
894- defaultShaders . imageLightDiffusedFrag
892+ return new Shader (
893+ this ,
894+ this . _webGL2CompatibilityPrefix ( "vert" , "highp" ) +
895+ defaultShaders . imageLightVert ,
896+ this . _webGL2CompatibilityPrefix ( "frag" , "highp" ) +
897+ defaultShaders . imageLightDiffusedFrag
895898 ) ;
896899 } else if ( type === 'specular' ) {
897- return this . _pInst . createShader (
898- defaultShaders . imageLightVert ,
899- defaultShaders . imageLightSpecularFrag
900+ return new Shader (
901+ this ,
902+ this . _webGL2CompatibilityPrefix ( "vert" , "highp" ) +
903+ defaultShaders . imageLightVert ,
904+ this . _webGL2CompatibilityPrefix ( "frag" , "highp" ) +
905+ defaultShaders . imageLightSpecularFrag
900906 ) ;
901907 }
902908 throw new Error ( `Unknown imageLight shader type: ${ type } ` ) ;
0 commit comments