Day12 - Procedural Textures Noise in glman glman...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Procedural Textures Noise in glman glman automatically creates 2D and 3D textures (with default sizes 64x64 and 64x64x64) named Noise2 Noise3 stores 4 octaves, 1 each in the R, G, B, A components Noise in glman Component Term Range Limits nv.r 0.5 0.5 0.0 1.0 1 nv.g 0.5 0.25 0.25 0.75 2 nv.b 0.5 0.125 0.375 0.625 3 nv.a 0.5 0.0625 0.4375 0.5625 sum 2.0 1.0 1.0 3.0 sum 1 1.0 1.0 0.0 2.0 (sum 1) / 2 0.5 0.5 0.0 1.0 (sum 2) 0.5 1.0-1.0 1.0 Table 10.1 Clouds 1 vertex shader outputs modelling coordinates of each vertex (scaled so that the values are suitable for use as texture coordinates) light intensity (from ADS lighting or other) fragment shader retrieves a 3D noise texture value using the incoming modelling coordinate computes a noise value from the retrieved texture value blends a sky color with a cloud color using the noise value and modulates the incoming light intensity Clouds 1 uniform sampler3D Noise3; uniform vec4 uSkyColor; uniform vec4 uCloudColor; in vec4 vColor; in vec3 vModelPosition; out vec4 fFragColor; void main(void) { vec4 nv = texture(Noise3, vModelPosition); Clouds 1 Clouds 2a you can choose to emphasize the large scale structure by increasing the contribution of the first octave float cloudIntensity = ( 3 * nv.r + nv.g + nv.b + nv.a - 2 ) / 2.0; Clouds 2a...
View Full Document

Page1 / 35

Day12 - Procedural Textures Noise in glman glman...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online