Skip to content

Commit

Permalink
fix noise (#4031)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Jun 23, 2017
1 parent f99b0d7 commit efc2a21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/filters/blendcolor_filter.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
*/
toObject: function() {
return {
type: this.type,
color: this.color,
mode: this.mode,
alpha: this.alpha
Expand Down
4 changes: 2 additions & 2 deletions src/filters/noise_filter.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
fragmentSource: 'precision highp float;\n' +
'uniform sampler2D uTexture;\n' +
'uniform float uHeight;\n' +
'uniform float uStepH;\n' +
'uniform float uNoise;\n' +
'uniform float uSeed;\n' +
'varying vec2 vTexCoord;\n' +
Expand All @@ -45,7 +45,7 @@
'}\n' +
'void main() {\n' +
'vec4 color = texture2D(uTexture, vTexCoord);\n' +
'color.rgb += (0.5 - rand(vTexCoord, uSeed, uHeight / 10.0)) * uNoise;\n' +
'color.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\n' +
'gl_FragColor = color;\n' +
'}',

Expand Down

0 comments on commit efc2a21

Please sign in to comment.