3D graphics eBook - Course Materials Repository
3D graphics eBook - Course Materials Repository 3D graphics eBook - Course Materials Repository
Procedural texture 123 } for (scale = 1; scale > twice; scale /= 2) turbulence += scale * noise(PP/scale); /* Gradual fade out of highest-frequency component near limit */ if (scale > pixelsize) { } /* weight = (scale / pixelsize) - 1; weight = clamp(weight, 0, 1); turbulence += weight * scale * noise(PP/scale); * Magnify the upper part of the turbulence range 0.75:1 * to fill the range 0:1 and use it as the parameter of * a color spline through various shades of blue. */ csp = clamp(4 * turbulence - 3, 0, 1); Ci = color spline(csp, color (0.25, 0.25, 0.35), /* pale blue */ color (0.25, 0.25, 0.35), /* pale blue */ color (0.20, 0.20, 0.30), /* medium blue */ color (0.20, 0.20, 0.30), /* medium blue */ color (0.20, 0.20, 0.30), /* medium blue */ color (0.25, 0.25, 0.35), /* pale blue */ color (0.25, 0.25, 0.35), /* pale blue */ color (0.15, 0.15, 0.26), /* medium dark blue */ color (0.15, 0.15, 0.26), /* medium dark blue */ color (0.10, 0.10, 0.20), /* dark blue */ color (0.10, 0.10, 0.20), /* dark blue */ color (0.25, 0.25, 0.35), /* pale blue */ color (0.10, 0.10, 0.20) /* dark blue */ ); /* Multiply this color by the diffusely reflected light. */ Ci *= Ka*ambient() + Kd*diffuse(Nf); /* Adjust for opacity. */ Oi = Os; Ci = Ci * Oi; /* Add in specular highlights. */ Ci += specularcolor * Ks * specular(Nf,V,roughness); This article was taken from The Photoshop Roadmap [5] with written authorization
Procedural texture 124 References [1] http:/ / www. spiralgraphics. biz/ gallery. htm [2] Ebert et al: Texturing and Modeling A Procedural Approach, page 10. Morgan Kaufmann, 2003. [3] Ebert et al: Texturing and Modeling A Procedural Approach, page 135. Morgan Kaufmann, 2003. [4] Ebert et al: Texturing and Modeling A Procedural Approach, page 547. Morgan Kaufmann, 2003. [5] http:/ / www. photoshoproadmap. com Some programs for creating textures using Procedural texturing • Allegorithmic Substance • Filter Forge • Genetica (program) (http:/ / www. spiralgraphics. biz/ genetica. htm) • DarkTree (http:/ / www. darksim. com/ html/ dt25_description. html) • Context Free Art (http:/ / www. contextfreeart. org/ index. html) • TexRD (http:/ / www. texrd. com) (based on reaction-diffusion: self-organizing textures) • Texture Garden (http:/ / texturegarden. com) • Enhance Textures (http:/ / www. shaders. co. uk) 3D projection 3D projection is any method of mapping three-dimensional points to a two-dimensional plane. As most current methods for displaying graphical data are based on planar two-dimensional media, the use of this type of projection is widespread, especially in computer graphics, engineering and drafting. Orthographic projection When the human eye looks at a scene, objects in the distance appear smaller than objects close by. Orthographic projection ignores this effect to allow the creation of to-scale drawings for construction and engineering. Orthographic projections are a small set of transforms often used to show profile, detail or precise measurements of a three dimensional object. Common names for orthographic projections include plane, cross-section, bird's-eye, and elevation. If the normal of the viewing plane (the camera direction) is parallel to one of the primary axes (which is the x, y, or z axis), the mathematical transformation is as follows; To project the 3D point , , onto the 2D point , using an orthographic projection parallel to the y axis (profile view), the following equations can be used: where the vector s is an arbitrary scale factor, and c is an arbitrary offset. These constants are optional, and can be used to properly align the viewport. Using matrix multiplication, the equations become: . While orthographically projected images represent the three dimensional nature of the object projected, they do not represent the object as it would be recorded photographically or perceived by a viewer observing it directly. In particular, parallel lengths at all points in an orthographically projected image are of the same scale regardless of whether they are far away or near to the virtual viewer. As a result, lengths near to the viewer are not foreshortened as they would be in a perspective projection.
- Page 77 and 78: Level of detail 72 Well known appro
- Page 79 and 80: Level of detail 74 Hierarchical LOD
- Page 81 and 82: Newell's algorithm 76 Newell's algo
- Page 83 and 84: Non-uniform rational B-spline 78 Us
- Page 85 and 86: Non-uniform rational B-spline 80 of
- Page 87 and 88: Non-uniform rational B-spline 82 ar
- Page 89 and 90: Non-uniform rational B-spline 84 Ex
- Page 91 and 92: Normal mapping 86 How it works To c
- Page 93 and 94: OrenNayar reflectance model 88 Oren
- Page 95 and 96: OrenNayar reflectance model 90 , ,
- Page 97 and 98: Painter's algorithm 92 The algorith
- Page 99 and 100: Parallax mapping 94 • Parallax Ma
- Page 101 and 102: Particle system 96 A cube emitting
- Page 103 and 104: Path tracing 98 History Further inf
- Page 105 and 106: Path tracing 100 Scattering distrib
- Page 107 and 108: Phong reflection model 102 Visual i
- Page 109 and 110: Phong reflection model 104 Because
- Page 111 and 112: Phong shading 106 Visual illustrati
- Page 113 and 114: Photon mapping 108 Rendering (2nd p
- Page 115 and 116: Photon tracing 110 Advantages and d
- Page 117 and 118: Potentially visible set 112 • Can
- Page 119 and 120: Potentially visible set 114 Externa
- Page 121 and 122: Procedural generation 116 increases
- Page 123 and 124: Procedural generation 118 • Softi
- Page 125 and 126: Procedural generation 120 Reference
- Page 127: Procedural texture 122 Self-organiz
- Page 131 and 132: 3D projection 126 The distance of t
- Page 133 and 134: Quaternions and spatial rotation 12
- Page 135 and 136: Quaternions and spatial rotation 13
- Page 137 and 138: Quaternions and spatial rotation 13
- Page 139 and 140: Quaternions and spatial rotation 13
- Page 141 and 142: Quaternions and spatial rotation 13
- Page 143 and 144: Quaternions and spatial rotation 13
- Page 145 and 146: Radiosity 140 Overview of the radio
- Page 147 and 148: Radiosity 142 This is sometimes kno
- Page 149 and 150: Radiosity 144 References [1] " Mode
- Page 151 and 152: Ray casting 146 the light will reac
- Page 153 and 154: Ray tracing 148 Typically, each ray
- Page 155 and 156: Ray tracing 150 independence of eac
- Page 157 and 158: Ray tracing 152 On June 12, 2008 In
- Page 159 and 160: Reflection 154 Reflection Reflectio
- Page 161 and 162: Reflection 156 Glossy Reflection Fu
- Page 163 and 164: Reflection mapping 158 Cube mapping
- Page 165 and 166: Render Output unit 160 Render Outpu
- Page 167 and 168: Rendering 162 • indirect illumina
- Page 169 and 170: Rendering 164 Ray tracing Ray traci
- Page 171 and 172: Rendering 166 Academic core The imp
- Page 173 and 174: Rendering 168 • 1984 Distributed
- Page 175 and 176: Retained mode 170 Retained mode In
- Page 177 and 178: Scanline rendering 172 Comparison w
Procedural texture 123<br />
}<br />
for (scale = 1; scale > twice; scale /= 2)<br />
turbulence += scale * noise(PP/scale);<br />
/* Gradual fade out of highest-frequency component near limit */<br />
if (scale > pixelsize) {<br />
}<br />
/*<br />
weight = (scale / pixelsize) - 1;<br />
weight = clamp(weight, 0, 1);<br />
turbulence += weight * scale * noise(PP/scale);<br />
* Magnify the upper part of the turbulence range 0.75:1<br />
* to fill the range 0:1 and use it as the parameter of<br />
* a color spline through various shades of blue.<br />
*/<br />
csp = clamp(4 * turbulence - 3, 0, 1);<br />
Ci = color spline(csp,<br />
color (0.25, 0.25, 0.35), /* pale blue */<br />
color (0.25, 0.25, 0.35), /* pale blue */<br />
color (0.20, 0.20, 0.30), /* medium blue */<br />
color (0.20, 0.20, 0.30), /* medium blue */<br />
color (0.20, 0.20, 0.30), /* medium blue */<br />
color (0.25, 0.25, 0.35), /* pale blue */<br />
color (0.25, 0.25, 0.35), /* pale blue */<br />
color (0.15, 0.15, 0.26), /* medium dark blue */<br />
color (0.15, 0.15, 0.26), /* medium dark blue */<br />
color (0.10, 0.10, 0.20), /* dark blue */<br />
color (0.10, 0.10, 0.20), /* dark blue */<br />
color (0.25, 0.25, 0.35), /* pale blue */<br />
color (0.10, 0.10, 0.20) /* dark blue */<br />
);<br />
/* Multiply this color by the diffusely reflected light. */<br />
Ci *= Ka*ambient() + Kd*diffuse(Nf);<br />
/* Adjust for opacity. */<br />
Oi = Os;<br />
Ci = Ci * Oi;<br />
/* Add in specular highlights. */<br />
Ci += specularcolor * Ks * specular(Nf,V,roughness);<br />
This article was taken from The Photoshop Roadmap [5] with written authorization