mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-11 23:33:10 +00:00
fix noise (#4031)
This commit is contained in:
parent
f99b0d78f3
commit
efc2a216c7
2 changed files with 3 additions and 2 deletions
|
|
@ -276,6 +276,7 @@
|
|||
*/
|
||||
toObject: function() {
|
||||
return {
|
||||
type: this.type,
|
||||
color: this.color,
|
||||
mode: this.mode,
|
||||
alpha: this.alpha
|
||||
|
|
|
|||
|
|
@ -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' +
|
||||
|
|
@ -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' +
|
||||
'}',
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue