Chair of Computer Graphics and Visualization

Sheet 7: Procedural Volume Generation

Exercise 1: Rescale-And-Add Clouds (20 points)

In this exercise you will replace the analytic volume datasets from the previous sheets with a procedurally generated cloud volume. The raycaster, transfer function, and volumetric shadow computation are already implemented.

Your task is to complete RescaleAndAddVolume.cpp. The class already contains the volume parameters, a permutation table, Perlin noise sampling, and helper functions such as smoothStep. The missing part is the actual cloud-density generation.

Implement the procedural volume in three parts:

The fractal noise should follow the rescale-and-add formula from the lecture:

H(x,y,z) equals one over A times the sum over octaves of roughness to the octave times Perlin noise sampled at lacunarity to the octave times base frequency; A is the sum of the amplitudes.

Here N is the provided Perlin noise function, f is baseFrequency, l is lacunarity, r is roughness, and o is octaves. Normalize the sum by A = ∑i=0o-1 ri so the result remains in a stable range when changing the number of octaves.

The provided perlin function returns values roughly in [-1, 1]. For ordinary noise, remap each octave with 0.5 * octaveValue + 0.5. For billowy noise, use 1.0 - abs(octaveValue) before adding the octave to the sum.

Octave noise is one minus the absolute Perlin value for billowy noise, or one half times the Perlin value plus one half for ordinary noise.

After computing the base fractal noise, shape the cloud density in generate:

Detail erosion, shaped noise, smooth coverage threshold, and final density equation.

For cloudEnvelope, start with the distance to the center of the unit volume. Then perturb the radius with a low-frequency Perlin sample:

Noisy silhouette sample, local radius, and smooth envelope equation.

Use radius * radiusScale as the local boundary and return 1.0 - smoothStep(radius - envelopeSoftness, radius, distance). This keeps the volume brick rectangular, but makes the actual cloud fade out with a soft, noisy silhouette.

The generated volume should be written into volume.data as 8-bit density values. Use the parameter sets in main.cpp to compare different clouds with the V key.

The most relevant parameters are:

Exercise 2: Find a Better Cloud (10 points)

The provided parameter sets in main.cpp are intentionally only a starting point. They demonstrate that the generator works, but they do not create especially convincing clouds yet. Procedural modeling often needs experimentation: small parameter changes can move the result from a soft cloud to a dense blob, noisy foam, or something that looks more like stone.

Create at least one additional RescaleAndAddVolumeParameters entry that produces a better-looking cloud. You may change any generator parameter, but keep the volume resolution reasonable enough that the program remains interactive.

Try to improve both the large shape and the fine structure:

Submit the new parameter set together with a short explanation of what you changed and why the result looks more cloud-like than the provided examples.

Reference Solution

Loading

V toggle cloud parameter set, R reset, T toggle transfer-function editor
1 clip in X, 2 clip in Y, 3 clip in Z
4 move clip in X, 5 move clip in Y, 6 move clip in Z
Q increase oversampling, W decrease oversampling
J/L move light in X, I/K move light in Y, U/O move light in Z
Up zoom in, Down zoom out
Left mouse drag rotate, Right mouse drag quick edit transfer function