修改间距大值 缓冲区bug

This commit is contained in:
2025-07-09 11:26:33 +08:00
parent dd003aa00d
commit 45f2d6f4eb
8 changed files with 54 additions and 36 deletions

View File

@ -55,6 +55,7 @@ function LineTexture() {
1.0,
result.repeat
);
result.frameNumber = Cesium.getTimestamp();
return result;
}
@ -90,7 +91,8 @@ function LineTexture() {
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
st.s *= repeat; // 关键通过repeat控制纹理密度
vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));
// vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));
vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat ), st.t));
material.alpha = colorImage.a * color.a;
material.diffuse = color.rgb;
return material;
@ -106,6 +108,7 @@ function LineTexture() {
image: '',
repeat: 1.0,
speed: 1.0,
frameNumber: Cesium.getTimestamp(),
uTime: 1
},
source: Cesium.Material.LineTextureMaterialSource,