Jorg's Graphics Lecture Notes: Discrete Graphics and Pixel Shaders, Study notes of Computer Graphics

A portion of jorg's graphics lecture notes covering discrete graphics and pixel shaders. Topics include curved surfaces, procedural detail, textures, bitmaps, geometry pipeline, rasterization, texture mapping, challenges of texturing, and texture details. The document also discusses various texture mapping types, texture shading, and attaching textures to patches.

Typology: Study notes

Pre 2010

Uploaded on 03/18/2009

koofers-user-emk
koofers-user-emk 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Jorg’s Graphics Lecture Notes Discrete Graphics, Pixel shaders 1
Discrete Graphics, Pixel shaders
Better looking models
curved surfaces (10),
procedural detail (11),
textures (9)
Bit maps: rgb, normal texture, displacement maps
geometry pipeline, pixel pipeline, ‘Vertex shader and Pixel shader’
Geometric
processing Rasterization DisplayVertices
Pixel
operations
Pixels
Texture maps
Texture mapping types
(2D) texture : pasting an image onto a surface (challenges: distortion
and aliasing)
(3D) texture generated random, x,y,z direct, discrete grid
transfer texture from an intermediate object (sphere or cylinder) for
better parametrization; use the object normal.
environment map:
place viewer at object center, cube map
transfer resulting image as texture (possibly via intermediate object)
glTexCoord 9texgen.c 9checker.c
video texture
bump mapping: perturb normal nat point pas if phad been moved by
din the direction of the normal n:
pnew =p+dn.
Compute
pnew
∂u ×pnew
∂v =p
∂u + d
∂u n+dn
∂u ×p
∂v + d
∂v n+dn
∂v
=n+∂d
∂u n×p
∂v + d
∂v n×p
∂u .+O(n
∂u ,n
∂v ).
The leading terms of the perturbation f the normal are therefore
∂d
∂u n×p
∂v + d
∂v n×p
∂u .
pf3

Partial preview of the text

Download Jorg's Graphics Lecture Notes: Discrete Graphics and Pixel Shaders and more Study notes Computer Graphics in PDF only on Docsity!

Discrete Graphics, Pixel shaders

Better looking models

  • curved surfaces (10),
  • procedural detail (11),
  • textures (9)

Bit maps: rgb, normal texture, displacement maps geometry pipeline, pixel pipeline, ‘Vertex shader and Pixel shader’ Vertices^ Geometricprocessing Rasterization Display

Pixels operations^ Pixel

Texture maps

  • Texture mapping types
    • (2D) texture : pasting an image onto a surface (challenges: distortion and aliasing)
    • (3D) texture — generated random, x,y,z direct, discrete grid
    • transfer texture from an intermediate object (sphere or cylinder) for better parametrization; use the object normal.
    • environment map: place viewer at object center, cube map transfer resulting image as texture (possibly via intermediate object)
  • glTexCoord 9texgen.c 9checker.c video texture bump mapping: perturb normal n at point p as if p had been moved by d in the direction of the normal n: pnew^ = p + dn. Compute ∂pnew ∂u

×

∂pnew ∂v

( (^) ∂p ∂u

∂d ∂u

n + d

∂n ∂u

×

( (^) ∂p ∂v

∂d ∂v

n + d

∂n ∂v

= n + ∂d ∂u

n × ∂p ∂v

∂d ∂v

n × ∂p ∂u

. + O(

∂n ∂u

∂n ∂v

The leading terms of the perturbation f the normal are therefore ∂d ∂u

n ×

∂p ∂v

∂d ∂v

n ×

∂p ∂u

Challenges of texturing

  • distortion (flat to sphere)
  • want pixel – so need map from screen coordinats to texture coordinates;
  • areas, not points should be mapped bilinear interpolation
  • aliasing (Moir´e pattern) – pointwise: might miss, average: smears out

s(u,v) t(u,v) u

v

x(u,v) y(u,v) z(u,v)

s

t

tex(s(u,v),t(u,v))

s

t

u

v

9projtext.pdf

Texture details

  • many bit patterns (formats) (gimp exports C-arrays!)
  • texture wrapping
  • GL LINEAR, GL NEAREST
  • mipmapping, 9mipmap.c
  • texture shading: (RGB) pp replace (color=tex(ture), alpha=frag(ment)) modulate (color=fragtex, alpha=frag) decal (color=tex, alpha=frag) blend (color=frag(1-tex)+tex*environment color, alpha=frag)