Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Issue 332523006: Fix tiled perlin noise. (Closed)

Created:
6 years, 6 months ago by Stephen White
Modified:
6 years, 6 months ago
Reviewers:
sugoi
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Fix tiled perlin noise. It turns out that the perlin implementation we inherited from WebKit does not actually generate tileable noise (see Chromium bug http://crbug.com/383495). The main problem is that when generating coordinates for gradient interpolation, it was attempting to wrap both x and (x + 1) simultaneously at the tile boundary (that is, either both or neither are wrapped). This obviously won't work, since along the tile seams, (x + 1) should be wrapped, but x should not. The same is true in y. This patch fixes both the CPU and GPU paths, renames some variables to more closely match the spec, and modifies the perlin noise GM to actually test tiling. (Note that the clipping the GM was doing was removed, since it's superfluous: it used to be necessary for image filters, but isn't anymore, and this isn't an image filter GM anyway.) R=sugoi TBR=senorblanco Committed: https://skia.googlesource.com/skia/+/ce6a354e121915c2925e545e7df2929492d69d50

Patch Set 1 #

Patch Set 2 : add code review link #

Total comments: 2

Patch Set 3 : Remove spurious .xy in GLSL shader #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -46 lines) Patch
M expectations/gm/ignored-tests.txt View 1 1 chunk +4 lines, -0 lines 0 comments Download
M gm/perlinnoise.cpp View 4 chunks +21 lines, -12 lines 0 comments Download
M src/effects/SkPerlinNoiseShader.cpp View 1 2 10 chunks +43 lines, -34 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Stephen White
sugoi: PTAL. Thanks!
6 years, 6 months ago (2014-06-12 16:20:01 UTC) #1
sugoi
LGTM with one minor comment. https://codereview.chromium.org/332523006/diff/20001/src/effects/SkPerlinNoiseShader.cpp File src/effects/SkPerlinNoiseShader.cpp (right): https://codereview.chromium.org/332523006/diff/20001/src/effects/SkPerlinNoiseShader.cpp#newcode1030 src/effects/SkPerlinNoiseShader.cpp:1030: noiseCode.appendf("\tvec2 %s = fract(%s.xy);\n", ...
6 years, 6 months ago (2014-06-12 17:19:53 UTC) #2
Stephen White
https://codereview.chromium.org/332523006/diff/20001/src/effects/SkPerlinNoiseShader.cpp File src/effects/SkPerlinNoiseShader.cpp (right): https://codereview.chromium.org/332523006/diff/20001/src/effects/SkPerlinNoiseShader.cpp#newcode1030 src/effects/SkPerlinNoiseShader.cpp:1030: noiseCode.appendf("\tvec2 %s = fract(%s.xy);\n", fractVal, noiseVec); On 2014/06/12 17:19:53, ...
6 years, 6 months ago (2014-06-12 17:37:18 UTC) #3
Stephen White
The CQ bit was checked by senorblanco@chromium.org
6 years, 6 months ago (2014-06-12 17:50:32 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/senorblanco@chromium.org/332523006/40001
6 years, 6 months ago (2014-06-12 17:50:52 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-12 17:50:53 UTC) #6
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
6 years, 6 months ago (2014-06-12 17:50:54 UTC) #7
Stephen White
The CQ bit was checked by senorblanco@chromium.org
6 years, 6 months ago (2014-06-12 17:53:06 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/senorblanco@chromium.org/332523006/40001
6 years, 6 months ago (2014-06-12 17:53:52 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-12 17:53:53 UTC) #10
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
6 years, 6 months ago (2014-06-12 17:53:54 UTC) #11
Stephen White
The CQ bit was checked by senorblanco@chromium.org
6 years, 6 months ago (2014-06-12 17:56:44 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/senorblanco@chromium.org/332523006/40001
6 years, 6 months ago (2014-06-12 17:57:52 UTC) #13
commit-bot: I haz the power
6 years, 6 months ago (2014-06-12 18:24:25 UTC) #14
Message was sent while issue was closed.
Change committed as ce6a354e121915c2925e545e7df2929492d69d50

Powered by Google App Engine
This is Rietveld 408576698