Graphics Reference
In-Depth Information
Figure 10.13. The teapot shown with a cloud texture (left) and a cloud texture on a plane
(right) as it might be done for a sky background.
A fragment shader for cloud effects is given below. The noise octaves
are not uniformly weighted, because clouds seem to have more structure at
a larger scale, and the intensity is modified with a cosine function to achieve
even wider cloud and sky regions. This shader uses four uniform variables
that set the foreground and background colors for clouds and that control the
scale of the domain and shift the noise either toward the foreground or the
background color. If you use this shader with glman , the uniform variables
would need to be defined as slider or color chooser variables in a GLIB file, so
that you can adjust the values to tune the look of the cloud effect.
uniform vec4 uSkyColor;
uniform vec4 uCloudColor;
uniform float uBias;
uniform float uNoiseScale;
uniform sampler3D Noise3;
in float vLightIntensity;
in vec3 vMCposition;
out vec4 fFragColor;
const float PI = 3.14159265;
void main( )
Search WWH ::




Custom Search