From 098db2f1e0f2584617a19ee6dd094aeee73e8efd Mon Sep 17 00:00:00 2001 From: lzxue <120635640@qq.com> Date: Mon, 11 Dec 2023 16:01:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BA=B9=E7=90=86=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev-demos/features/line/demos/lineArcPlane.tsx | 2 +- .../src/line/shaders/linearLine/line_linear_vert.glsl | 2 +- packages/renderer/src/regl/ReglModel.ts | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) 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,