jcaw / bitangent_noise

Fast 3d/4d divergence-free noise for shaders.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bitangent Noise

Curl Noise by Robert Bridson is a widely known method that can generate divergence-free noise. This divergence-free property makes it extremely suitable for driving particles to move like real fluid motion.

Here is another divergence-free noise generator that is computationally cheaper than curl noise. I thought it was new and named it Bitangent Noise, but later I found it was already invented by Ivan DeWolf in 2005. (I'm wondering why it is so less popular comparing to curl noise.)

The implementation is carefully optimized, and both HLSL and GLSL codes are provided for your convenience. More details can be found here. Following image shows a particle system that is updated using bitangent noise.

image

Here is a shadertoy example shows how to use bitangent noise to make a smoke ball.

Performance

These performance data are measured on a Nvidia GTX 1060 card, where each noise function is executed 1280 * 720 * 10 times.

Noise Function Cost Desc
snoise3d 1530 μs stegu's 3d simplex nosie
SimplexNoise3D 1153 μs optimized 3d simplex noise
snoise4d 2578 μs stegu's 4d simplex nosie
SimplexNoise4D 1798 μs optimized 4d simplex noise
BitangentNoise3D_ref 2991 μs 3d bitangent noise, reference version
BitangentNoise3D 1534 μs optimized 3d bitangent noise
BitangentNoise4D_ref 4365 μs 4d bitangent noise, reference version
BitangentNoise4DFast_ref 3152 μs 4d bitangent noise, low quality
BitangentNoise4D 2413 μs optimized 4d bitangent noise

About

Fast 3d/4d divergence-free noise for shaders.

License:MIT License


Languages

Language:HLSL 80.1%Language:GLSL 19.9%