param vertexShader returns export function convertVertexShaderToWebGL2 ( vertexShader ) { return ( [ "#define attribute in" , "#define varying out" , "#define texture2D texture" ] . join ( "\n" ) + "\n" + vertexShader ) ; } param fragmentShader returns export function convertFragmentShaderToWebGL2 ( fragmentShader ) { return ( [ "#define varying in" , "out highp vec4 pc_fragColor;" , "#define gl_FragColor pc_fragColor" , "#define gl_FragDepthEXT gl_FragDepth" , "#define texture2D texture" , "#define textureCube texture" , "#define texture2DProj textureProj" , "#define texture2DLodEXT textureLod" , "#define texture2DProjLodEXT textureProjLod" , "#define textureCubeLodEXT textureLod" , "#define texture2DGradEXT textureGrad" , "#define texture2DProjGradEXT textureProjGrad" , "#define textureCubeGradEXT textureGrad" ] . join ( "\n" ) + "\n" + fragmentShader ) ; }