Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ShWorley.hpp File Reference

This is an implementation of 2D ShWorley texture. More...

#include <vector>
#include "ShAttrib.hpp"
#include "ShColor.hpp"
#include "ShTexture.hpp"
#include "ShWorleyImpl.hpp"

Include dependency graph for ShWorley.hpp:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  ShUtil


Detailed Description

This is an implementation of 2D ShWorley texture.

A Worley texture is made by distributing a set of points in a space and taking a weighted sum of basis functions for the k-nearest neighbours of a lookup point p. These basis functions can be the distance itself from p to the adjacent generators (the typical Worley function), or any other information. For example, we can attach colour information or refraction indicies to the generators.

This Worley implementation is split into two parts. The first part is a Generator Factory that produces a fixed number of candidate generators around a lookup point p.

A Property Factory is attaches properties to each Generator. Currently, there is no internal Sh representation for a struct of Sh types, so properties are generated into a long N-tuple. The generators are sorted by the first component in the N-tuple, so this should typically be a distance.

In the future, when it's possible to "call" an ShProgram object directly, Property Factories should actually be ShProgram objects that take a integer cell position as an input and output the desired properties.

The worley function itself sorts the generators based on the first component in its properties and returns a N-tuple containing the weighted sum of all properties.

Definition in file ShWorley.hpp.


Generated on Mon Oct 18 14:17:52 2004 for Sh by doxygen 1.3.7