diff --git a/packages/layers/src/image/shaders/image_frag.glsl b/packages/layers/src/image/shaders/image_frag.glsl index 91901e16b2..ed617c17e3 100644 --- a/packages/layers/src/image/shaders/image_frag.glsl +++ b/packages/layers/src/image/shaders/image_frag.glsl @@ -5,4 +5,5 @@ varying vec2 v_texCoord; void main() { vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)); gl_FragColor = color; + gl_FragColor.a *= u_opacity; } diff --git a/packages/layers/src/line/shaders/line_frag.glsl b/packages/layers/src/line/shaders/line_frag.glsl index 545413161e..3d820ca113 100644 --- a/packages/layers/src/line/shaders/line_frag.glsl +++ b/packages/layers/src/line/shaders/line_frag.glsl @@ -25,7 +25,7 @@ void main() { gl_FragColor = v_color; // anti-alias // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy)); - // gl_FragColor.a *= u_opacity * blur ; + gl_FragColor.a *= u_opacity; if(u_aimate.x == Animate) { float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y); alpha = (alpha + u_aimate.w -1.0) / u_aimate.w; diff --git a/stories/Layers/components/Line.tsx b/stories/Layers/components/Line.tsx index 59b30974b2..c13b48295f 100644 --- a/stories/Layers/components/Line.tsx +++ b/stories/Layers/components/Line.tsx @@ -41,7 +41,7 @@ export default class LineDemo extends React.Component { .shape('line') .color('#f00') .style({ - opacity: 1.0, + opacity: 0.5, }); scene.addLayer(polygonLayer);