Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
Results
README.md
ispc.exe
worley.cpp
worley.exe
worley.ispc
worley.vcxproj
worley_serial.cpp

README.md

worley

This repository contains an ISPC implementation of Worley Noise [1], also known as cellular noise.

Based on a set of irregular (or random) points, the distance to the closest point is approximated. [2]

When multiple octaves are combined, cellular-like behaviour is produced:

A serial implementation is also provided, for comparison.

ISPC

ispc is a compiler for a variant of the C programming language, with extensions for "single program, multiple data" (SPMD) programming. Under the SPMD model, the programmer writes a program that generally appears to be a regular serial program, though the execution model is actually that a number of program instances execute in parallel on the hardware. [4]

Performance

On an i7-7700K @ 4.20GHz:

  • Serial: 2255.734 million cycles
  • ISPC: 272.316 million cycles

Overall, an 8.28x speedup from ISPC.

Additional optimizations are most likely possible, as this is a simple 1:1 conversion to ISPC. Performance will be revisited in the near future. For example, workload splitting can also be tweaked without changing the code (with --workloads=#). Finding the right number here can definitely change the performance metrics for the better.

Running

To run the sample, simply execute the provided binary. You can also recompile it via hlsl-to-ispc.sln.

References

[1] Worley, Steven. "A Cellular Texture Basis Function", SIGGRAPH 1996, Available Online

[2] Cozzi, Patrick and Riccio, Christophe. OpenGL Insights. CRC Press. pp. 113–115. 2012. Available Online

[3] http://glslsandbox.com/e#23237.0

[4] ISPC, https://ispc.github.io/index.html