diff --git a/dev-demos/features/line/demos/lineArcPlane.tsx b/dev-demos/features/line/demos/lineArcPlane.tsx index bacca3838e..154d483886 100644 --- a/dev-demos/features/line/demos/lineArcPlane.tsx +++ b/dev-demos/features/line/demos/lineArcPlane.tsx @@ -63,7 +63,7 @@ export default () => { }) .shape('circle') .color('#ffed11') - // .animate(true) + .animate(true) .size(40); const flyLine = new LineLayer({ blend: 'normal' }) .source(flydata, { diff --git a/packages/layers/src/line/shaders/linearLine/line_linear_vert.glsl b/packages/layers/src/line/shaders/linearLine/line_linear_vert.glsl index 432bd2acde..700586a6c1 100644 --- a/packages/layers/src/line/shaders/linearLine/line_linear_vert.glsl +++ b/packages/layers/src/line/shaders/linearLine/line_linear_vert.glsl @@ -39,7 +39,7 @@ void main() { linearRadio = texV; } - v_Color = texture(u_texture, vec2(linearRadio, 0.5)); + v_Color = texture(SAMPLER_2D(u_texture), vec2(linearRadio, 0.5)); v_Color.a *= opacity; // 全局透明度 diff --git a/packages/renderer/src/regl/ReglModel.ts b/packages/renderer/src/regl/ReglModel.ts index c435923336..d768c097c0 100644 --- a/packages/renderer/src/regl/ReglModel.ts +++ b/packages/renderer/src/regl/ReglModel.ts @@ -87,16 +87,14 @@ export default class ReglModel implements IModel { Object.keys(attributes).forEach((name: string) => { reglAttributes[name] = (attributes[name] as ReglAttribute).get(); }); - let frag = removeDuplicateUniforms( + const frag = removeDuplicateUniforms( preprocessShader_GLSL(vendorInfo, 'frag', fs, null, false), ); - frag = frag.replace(' texture(',' texture2D(');//没用正则 暂时这样吧 - frag = frag.replace(' texture (',' texture2D('); - let vert = removeDuplicateUniforms( + + const vert = removeDuplicateUniforms( preprocessShader_GLSL(vendorInfo, 'vert', vs, null, false), ) - vert = vert.replace(' texture(',' texture2D(');//没用正则 暂时这样吧 - vert = vert.replace(' texture (',' texture2D('); + const drawParams: regl.DrawConfig = { attributes: reglAttributes,