fix(layer): 新图层透明度

This commit is contained in:
thinkinggis 2020-11-21 00:43:44 +08:00
parent 1145eff9c7
commit e18a8644b3
3 changed files with 3 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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);