Comments (5)
I can't replicate the bug. If it persists, please submit the entire shader
so I can test it.
I notice that you are doing bump mapping from noise. Simplex noise has a
distinct advantage over regular noise in that it is a sum of easily
differentiable terms, and its analytic derivative can be computed easily
with a low order polynomial. For a 2D version of simplex noise in GLSL with
an analytic derivative, have a look at the "flow noise" in this demo:
http://www.itn.liu.se/~stegu/gpunoise/
I have not made a GLSL version of 3D noise with analytic derivatives, but
the differentiation is quite straightforward and follows the same pattern
as for 2D noise, only with one more term and one more dimension for each
term. Last time I tested it, the speedup compared to computing a finite
difference approximation is around 2x for 2D noise and slightly more for 3D
noise.
/Stefan
On Fri, Dec 12, 2014 at 6:24 PM, EntityB [email protected] wrote:
It is possible that problem with 3d simplex was fixed before and I just
had old implementation.—
Reply to this email directly or view it on GitHub
#11 (comment).
from webgl-noise.
After looking at the code that generated the artifacts, I think the problem is with using
"precision mediump float" instead of "precision highp float". Some platforms choose a 16-bit floating point representation for "mediump", and that will cause problems with the permutation polynomials even quite close to the origin.
from webgl-noise.
Thank you, everything is working with "precision highp float"!
from webgl-noise.
Recent events force me to ask, would be possible to reimplement this noise with precision mediump float
?
from webgl-noise.
The problem here is that for compatibility with older versions of GLSL and with WebGL, the permutations are done by integer math with floating point variables.
I see no way to make the permutation polynomial method work with a 16-bit floating point representation. The permutation set would then have to be very small to keep the numbers in the range where the integers N and N+1 map to different representations, and the periodic artifacts from using such a small set of gradients would most probably be too strong to be acceptable.
If texture bandwidth is not a problem, I would recommend using the texture-based lookup table for the permutations, as demonstrated by the older version of noise which I link to on the wiki page in the section "Other noise implementations". The texture-heavy version is generally not as fast on mobile platforms, but on desktop GPUs it can actually be about twice as fast as the pure computational version.
from webgl-noise.
Related Issues (20)
- 3D simplex noise exhibiting spacial artifacts not found in 2D simplex noise HOT 30
- Gradient to 3D Simplex Noise HOT 7
- Question: offsetting / seeding noise2D.glsl . HOT 1
- Periodicity along diagonal HOT 6
- Mention the range somewhere HOT 2
- Texture-intensive noise implementations HOT 4
- Period z is ignored for float pnoise(vec3 P, vec3 rep) HOT 5
- snoise(vec3) discontinuities HOT 9
- webgl HOT 2
- 6D noise HOT 2
- Making perturbed normal bumps HOT 15
- Problems in Safari iOS on mediump HOT 25
- Use of implementation in art project HOT 10
- pnoise is not repeating HOT 3
- Linker flags in Linux makefiles HOT 2
- Procedural Focal Points HOT 3
- demo fails to build on OS X HOT 4
- How to get the noise value in [0, 1] HOT 3
- Seeds HOT 35
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webgl-noise.