Wind-Field-Cesium
Wind-Field-Cesium copied to clipboard
粒子颜色
大佬,您能给小弟讲解一下粒子颜色实现的技术路线和原理么?我刚刚接触这些东西,代码没太看懂!! 谢谢您啦
其实实现原理很简单,首先颜色代表的是风速大小,任何一个粒子的风速对应的颜色是通过一个颜色表得到的,这个颜色表colorTable是在dataProcess.js文件中生成的,你可以调试看一下。 看后粒子的颜色是在片元着色器中控制的,这部分代码的实现是在segmentDraw.frag文件中,颜色表传到segmentDraw.frag中是以纹理的形式,该纹理就是particlesRendering.js中传入的colorTable纹理。 可能你需要了解一下GLSL语言是怎么实现uniform传到着色器中的,也就是colorTable纹理这个纹理怎么传到segmentDraw.frag文件中。
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年10月26日(星期一) 下午2:51 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "Subscribed"<[email protected]>; 主题: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
大佬,您能给小弟讲解一下粒子颜色实现的技术路线和原理么?我刚刚接触这些东西,代码没太看懂!! 谢谢您啦
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
大佬,您好! glsl代码里面的为什么要计算速度归一化? 您可以给小弟讲一讲速度归一化是如何计算的么??
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年10月26日(星期一) 下午3:12 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "啥也不会的小菜鸟"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
其实实现原理很简单,首先颜色代表的是风速大小,任何一个粒子的风速对应的颜色是通过一个颜色表得到的,这个颜色表colorTable是在dataProcess.js文件中生成的,你可以调试看一下。 看后粒子的颜色是在片元着色器中控制的,这部分代码的实现是在segmentDraw.frag文件中,颜色表传到segmentDraw.frag中是以纹理的形式,该纹理就是particlesRendering.js中传入的colorTable纹理。 可能你需要了解一下GLSL语言是怎么实现uniform传到着色器中的,也就是colorTable纹理这个纹理怎么传到segmentDraw.frag文件中。
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年10月26日(星期一) 下午2:51 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "Subscribed"<[email protected]>; 主题: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
大佬,您能给小弟讲解一下粒子颜色实现的技术路线和原理么?我刚刚接触这些东西,代码没太看懂!! 谢谢您啦
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
大佬,您好! 我突然想到一个问题,颜色代表速度值得大小,是根据U值还是V值匹配的呢??
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年10月26日(星期一) 下午3:12 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "啥也不会的小菜鸟"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
其实实现原理很简单,首先颜色代表的是风速大小,任何一个粒子的风速对应的颜色是通过一个颜色表得到的,这个颜色表colorTable是在dataProcess.js文件中生成的,你可以调试看一下。 看后粒子的颜色是在片元着色器中控制的,这部分代码的实现是在segmentDraw.frag文件中,颜色表传到segmentDraw.frag中是以纹理的形式,该纹理就是particlesRendering.js中传入的colorTable纹理。 可能你需要了解一下GLSL语言是怎么实现uniform传到着色器中的,也就是colorTable纹理这个纹理怎么传到segmentDraw.frag文件中。
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年10月26日(星期一) 下午2:51 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "Subscribed"<[email protected]>; 主题: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
大佬,您能给小弟讲解一下粒子颜色实现的技术路线和原理么?我刚刚接触这些东西,代码没太看懂!! 谢谢您啦
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
是根据U和V计算出的大小来匹配,相关代码参考calcRelativeSpeed
大佬,您好! 请问这个文件里生成的nextspeed是不是和颜色匹配的速度值?
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年10月26日(星期一) 下午5:15 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "啥也不会的小菜鸟"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
是根据U和V计算出的大小来匹配,相关代码参考calcRelativeSpeed
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
确切的说是postProcessingSpeed这个值和颜色进行匹配,postProcessingSpeed是对nextspeed做了一些后处理,比如判断生命周期是否结束,结束的话则不让该粒子显示
可是我没找到这个postProcessingSpeed是怎么计算的?是在postProcessingSpeed.frag这个文件? 但是我没看到怎么计算的?您能指点一下,它在哪个位置对nextspeed进行的后处理么?? ------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年10月28日(星期三) 下午4:50 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "啥也不会的小菜鸟"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
确切的说是postProcessingSpeed这个值和颜色进行匹配,postProcessingSpeed是对nextspeed做了一些后处理,比如判断生命周期是否结束,结束的话则不让该粒子显示
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
void main() {
vec4 randomParticle = texture2D(postProcessingPosition, v_textureCoordinates);
vec4 particleSpeed = texture2D(nextParticlesSpeed, v_textureCoordinates);
if (randomParticle.a > 0.0) {
gl_FragColor = vec4(0.0);
} else {
gl_FragColor = particleSpeed;
}
}
就这这段代码,如果生命周期到期了,则让速度为0,否则就用particleSpeed作为下一帧的粒子速度,即postProcessingSpeed
我好像明白了,就是这个particleSpeed是传到JS里面的postprocessingspeed对吧。------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein"<[email protected]> 发送时间: 2020年10月29日(星期四) 上午8:57 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "Rookiemin"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
是的
好的好的 谢谢大佬了,那我就走通了!!------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein"<[email protected]> 发送时间: 2020年10月29日(星期四) 上午9:43 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "Rookiemin"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
请问,你是有海洋的数据吗,方便分享一份吗?我想可视化一下看看效果,感谢感谢!
您给个邮箱,我发给您看看,在您这套代码上加载我的数据有些问题,正好给您看一下
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年11月1日(星期天) 晚上7:27 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "啥也不会的小菜鸟"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
请问,你是有海洋的数据吗,方便分享一份吗?我想可视化一下看看效果,感谢感谢!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
---原始邮件--- 发件人: "Rookiemin"<[email protected]> 发送时间: 2020年11月13日 17:50:19 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "AlbertEjiestein"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
您给个邮箱,我发给您看看,在您这套代码上加载我的数据有些问题,正好给您看一下
------------------ 原始邮件 ------------------ 发件人: "AlbertEjiestein/Wind-Field-Cesium" <[email protected]>; 发送时间: 2020年11月1日(星期天) 晚上7:27 收件人: "AlbertEjiestein/Wind-Field-Cesium"<[email protected]>; 抄送: "啥也不会的小菜鸟"<[email protected]>;"Author"<[email protected]>; 主题: Re: [AlbertEjiestein/Wind-Field-Cesium] 粒子颜色 (#9)
请问,你是有海洋的数据吗,方便分享一份吗?我想可视化一下看看效果,感谢感谢!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.