zouyaoji / vue-cesium

🎉 Vue 3.x components for CesiumJS.
https://zouyaoji.top/vue-cesium
MIT License
1.53k stars 325 forks source link

[Bug Report] VcPostProcessStage 后期处理报错,Compile log: ERROR: 0:2: 'varying' : Illegal use of reserved word #358

Closed zhouzhili closed 1 year ago

zhouzhili commented 1 year ago

VueCesium version

3.1.4

OS/Browsers version

win11,Chrome 110.0.5481.97

Vue version

3.3.0-alpha.4

Cesium version

1.102.0

Reproduction Link

https://codepen.io/zhili124/pen/eYLpwmM

Steps to reproduce

官网示例在线运行,就报错了,应该是没有兼容新版本

What is Expected?

能够正常使用

What is actually happening?

RuntimeError: Fragment shader failed to compile. Compile log: ERROR: 0:2: 'varying' : Illegal use of reserved word

zouyaoji commented 1 year ago

嗯,已知bug,不过暂时没精力搞, 目前可以考虑用opengl1的方式初始化viewer看看还有没有问题。

zhouzhili commented 1 year ago

改好了,在cesium 1.102 下测试正常

uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
float hash(float x) {
  return fract(sin(x * 23.3) * 13.13);
}
void main(void) {
  float time = czm_frameNumber / 60.0;
  vec2 resolution = czm_viewport.zw;
  vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);
  vec3 c = vec3(.6, .7, .8);
  float a = -.4;
  float si = sin(a), co = cos(a);
  uv *= mat2(co, -si, si, co);
  uv *= length(uv + vec2(0, 4.9)) * .3 + 1.;
  float v = 1. - sin(hash(floor(uv.x * 100.)) * 2.);
  float b = clamp(abs(sin(20. * time * v + uv.y * (5. / (2. + v)))) - .95, 0., 1.) * 20.;
  c *= v * b;
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.5);
}
zouyaoji commented 1 year ago

你优秀!

zouyaoji commented 1 year ago

@zhouzhili

哈喽 问一下,你上面的内容是在哪儿看的啊, attribute 应该替换成什么啊?

zouyaoji commented 1 year ago

参考你发的,我只把VcPostProcessStage的问题修复了,可视域分析,风场的都没搞定。

需要你的help~ 空了支援一下 -0 -

zouyaoji commented 1 year ago

盲猜把attribute 换成 out,貌似好了。。

zouyaoji commented 1 year ago

image

现在还差这个