






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







10/23/2008 1
Juraj Obert
http://graphics.cs.ucf.edu/cap4720/fall2008/
10/23/2008 3
Color correction
HSV, CMYK corrections
Gamma correction
Artistic effects
Blur
Edge detection
All Photoshop filters (Emboss, Noise, etc.)
Advanced effects
HDR (High Dynamic Range) rendering
Screen-space ambient occlusion
requires implicit geometry information
Bilateral upsampling
smart edge-preserving upsampling method
Original Gaussian blur, kernel 10
10/23/2008 7
Original Photoshop Water Paper
โ
โโ
f ( x )* h ( x )= f (ฮป ) h ( x โฮป) d ฮป
f [ i ]* h [ i ] f [ n ] h [ i n ]
n
โ
=โโ
โ
=โโ
โ
=โโ
n m
f [ i , j ]* h [ i , j ] f [ n , m ] h [ i n , j m ]
10/23/2008 9
Box kernel
wi j otherwise
iffij W
wi j
2
Tent kernel
wi j otherwise
wi j i j iffi j
Spline kernel
3 2 1
3 0
3
3 0
3 1
3 1
3 0
b t t b t t t t
B t otherwise
B t b t iff t
B t b t iff t
B t b t iff t
B t b t iff t
10/23/2008 13
We had to transform everything to clip space in a vertex
shader, because rasterizer needs clip-space positions
We need to shade a specified portion of the screen (usually the whole screen)
How do we specify object-space positions so that their clip-
space equivalents cover the entire screen?
Answer : We donโt. We use clip-space positions from the beginning
10/23/2008 15
Object-space to clip-space
transformations
(-1,17, 2.5)
Object space
(0.0, -0.4)
Clip space
(-1.0, -1.0)
(1.0, 1.0)
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
Object-space to clip-space
transformations
(0.0, -0.4)
Clip space
(0.0, -0.4)
Clip space
(-1.0, -1.0)
(1.0, 1.0)
gl_Position = vec4(gl_Vertex.xy, 1.0, 1.0);
(-1.0, -1.0)
(1.0, 1.0)
10/23/2008 19
uniform float texelX;
uniform float texelY;
uniform sampler2D sampler0; varying vec2 positionTextureSpace;
const float boxKernel[9] = { 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11 };
void main() {
vec4 result = vec4(0.0, 0.0, 0.0, 0.0);
float i = 0; float j = 0;
float k = 0;
for (i = -1.0; i <= 1.0; i += 1.0)
for (j = -1.0; j <= 1.0; j += 1.0, k += 1.0) result += vec4(boxKernel[k] *
tex2D(sampler0, positionTextureSpace + vec2(i, j)*vec2(texelX, texelY)).rgb, 0.0);
gl_FragColor = result; }