Skip to content

Commit

Permalink
fix: 纹理引入
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxue committed Dec 11, 2023
1 parent 2235c78 commit 098db2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev-demos/features/line/demos/lineArcPlane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default () => {
})
.shape('circle')
.color('#ffed11')
// .animate(true)
.animate(true)
.size(40);
const flyLine = new LineLayer({ blend: 'normal' })
.source(flydata, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; // 全局透明度


Expand Down
10 changes: 4 additions & 6 deletions packages/renderer/src/regl/ReglModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 098db2f

Please sign in to comment.