Assignment 4 hints
General
- Parameter files
- Use them! Make any variable you could ever possibly want to
change when experimenting a parameter.
- You can implement several ways of doing something as separate shaders -
*or* introduce an integer or string valued variable to make a choice between
implementations inside a shader.
- Document everything. We'll need to know what variables you used
so we can see what they do.
- Start early!
Surface shaders
- Bump mapping
- Take a look in the textbook for some really good fomulas (pg. 744)
- Use a paint program to design bump images. Start with a black canvas and
paint white shapes on it. Then, view it with xv and blur it (alot... use a
blur size of at least 7).
- Or, write a function that given parameter values (u,v), it
returns a height value or a gradiant value.
- Think about including a bumpScale parameter that will allow you
to increase or decrease the effect the bumps have on your normal to make them
easier to see.
- Wood & Marble
- Our silly noise example used the noise function
to modulate a color between black and white - ie. color =
noise*otherColor. Use a linear interpolation formula (like you used in
assignments 1 & 2) to modulate between two colors. Even better - figure
out a way to modulate between three colors (it would make Andrew happy).
- Real surface
- Combine the effects of many simpler shaders. Think about: bumps, color
modulations (perhaps with a noise function), response to incoming light
(is it a shiny surface? a matte surface?), etc.
Light shaders
- Projected textures
- Use the "direction", "up" and "right" parameters for a light to aim your
light source and orient your stencil image. (Actually, you only need two of
the three, if you remember back to the lectures on transformations).
- Implement a simple perspective projection of the points onto the stencil
plane - ala screenx = x/z for 3D perspective renderings - so your
projected light behaves properly. (see the online
example)
[email protected]
[email protected]
Copyright © 1997 Pat Hanrahan and Andrew C. Beers