Skip to content

Commit

Permalink
add some description
Browse files Browse the repository at this point in the history
  • Loading branch information
hongfaqiu committed May 8, 2021
1 parent f093f5c commit 0883f27
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 298 deletions.
4 changes: 2 additions & 2 deletions example/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export class ControlPanel {
gui.add(that.options, 'maxParticles', 1, 1000 * 1000, 1).name("最大粒子数").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'particleHeight', 1, 10000, 1).name("粒子高度").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'fadeOpacity', 0.90, 0.999, 0.001).name("拖尾透明度").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'dropRate', 0.0, 0.1).name("下降率").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'dropRateBump', 0, 0.2).name("下降颠簸率").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'dropRate', 0.0, 0.1).name("重置率").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'dropRateBump', 0, 0.2).name("重置&速度关联率").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'speedFactor', 0.05, 8).name("粒子速度").onFinishChange(onParticleSystemOptionsChange);
gui.add(that.options, 'lineWidth', 0.01, 16.0).name("线宽").onFinishChange(onParticleSystemOptionsChange);

Expand Down
2 changes: 1 addition & 1 deletion src/glsl/calculateSpeed.frag
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,5 @@ void main() {

vec4 particleSpeed = vec4(speedInLonLat, calculateWindNorm(speed / speedScaleFactor));
// gl_FragColor = particleSpeed;
gl_FragColor = vec4(speedInLonLat, calculateWindNorm(speedOrigin / speedFactor));
gl_FragColor = vec4(speedInLonLat, calculateWindNorm(speedOrigin));
}
11 changes: 0 additions & 11 deletions src/glsl/postProcessingPosition.frag
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ vec2 mapPositionToNormalizedIndex2D(vec3 lonLatLev) {
index3D.y = (lonLatLev.y - minimum.y) / interval.y;
index3D.z = ceil((lonLatLev.z - minimum.z) / interval.z);

// the st texture coordinate corresponding to (col, row) index
// example
// data array is [0, 1, 2, 3, 4, 5, 7, 8, 9], width = 2, height = 2, level = 2
// the content of texture will be
// t 1.0
// | 6 7
// | 4 5
// | 2 3
// | 0 1
// 0.0------1.0 s

vec2 index2D = vec2(index3D.x, index3D.z * dimension.y + index3D.y);
vec2 normalizedIndex2D = vec2(index2D.x / dimension.x, index2D.y / (dimension.y * dimension.z));
return normalizedIndex2D;
Expand Down
Loading

0 comments on commit 0883f27

Please sign in to comment.