对前端感兴趣,立志成为一名优秀的全栈工程师。
我的常用邮箱 [email protected]
I am interested in front-end development and aspire to become an excellent full-stack engineer.
My regular email is [email protected].
Visualize wind field(NC file) on Cesium
Home Page: https://cesium-particle.opendde.com/
License: MIT License
对前端感兴趣,立志成为一名优秀的全栈工程师。
我的常用邮箱 [email protected]
I am interested in front-end development and aspire to become an excellent full-stack engineer.
My regular email is [email protected].
我尝试用这段代码加载一个字段为u, v, x, y的nc文件,但仍会出现这样的报错信息:‘error NetCDF file no such attribute: U
all variables are: x,y,depth,u,v,ocean_time’,Particle3D API中fields的设置似乎并没有生效
particle3D = new Particle3D(viewer, {
input: file,
fields: {
U: 'u',
V: 'v',
lon: 'x',
lat: 'y'
},
colorTable,
userInput
});
拖动地球时不隐藏风场,期望跟随地球一起转动,有思路解决吗?
现在的效果是相机高度低于粒子高度时粒子不显示,请问如何让它们显示?
当在viewer中设置请求使用 webgl2 时,场景中不显示粒子了。
cesium 版本1.99,viewer 实例化传入以下参数。
contextOptions: { requestWebGl2: true }
在 cesium 版本1.101 中是这样设置
contextOptions: { requestWebgl1: false }
首先 calculateSpeed.frag 这个文件的第19行报错了,说是全局变量初始化必须是常量表达式
float speedScaleFactor = speedFactor * pixelSize;
将这句注释掉,然后写到对应方法里面去计算,重新打包后渲染不报错了,但是也看不到粒子了。
现在移动相机视野,会出现一些粒子被裁剪的情况,如下截图:
如上截图,红色区域以上的屏幕像素的粒子像是被裁剪了一样
预期效果:粒子不被裁剪
个人思考:是不是和深度测试有关系呢,在Wind-Field-Cesium项目中也出现了这个现象
已尝试的几个失败方案:
uniform sampler2D trailsColorTexture;
uniform sampler2D trailsDepthTexture;
varying vec2 textureCoordinate;
void main() {
vec4 trailsColor = texture2D(trailsColorTexture, textureCoordinate);
float trailsDepth = texture2D(trailsDepthTexture, textureCoordinate).r;
float globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, textureCoordinate));
// - 注释掉以下内容
// if (trailsDepth < globeDepth) {
// gl_FragColor = trailsColor;
// } else {
// gl_FragColor = vec4(0.0);
// }
// + 增加以下1行语句
gl_FragColor = trailsColor;
}
uniform sampler2D segmentsColorTexture;
uniform sampler2D segmentsDepthTexture;
uniform sampler2D currentTrailsColor;
uniform sampler2D trailsDepthTexture;
uniform float fadeOpacity;
varying vec2 textureCoordinate;
void main() {
vec4 pointsColor = texture2D(segmentsColorTexture, textureCoordinate);
vec4 trailsColor = texture2D(currentTrailsColor, textureCoordinate);
trailsColor = floor(fadeOpacity * 255.0 * trailsColor) / 255.0; // make sure the trailsColor will be strictly decreased
float pointsDepth = texture2D(segmentsDepthTexture, textureCoordinate).r;
float trailsDepth = texture2D(trailsDepthTexture, textureCoordinate).r;
float globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, textureCoordinate));
gl_FragColor = vec4(0.0);
// - 注释掉以下内容
// if (pointsDepth < globeDepth) {
// gl_FragColor = gl_FragColor + pointsColor;
// }
// if (trailsDepth < globeDepth) {
// gl_FragColor = gl_FragColor + trailsColor;
// }
// + 增加以下2行语句
gl_FragColor = gl_FragColor + pointsColor;
gl_FragColor = gl_FragColor + trailsColor;
gl_FragDepthEXT = min(pointsDepth, trailsDepth);
}
由于本人刚刚接触webgl不久,烦请忽略我的一些不专业的术语表达。
如题,nc 里面的数据千奇百怪,总觉得哪里不对
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.