1/21
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
where does texture mapping take place?
fragment processor
what is the idea?
mapping from some dimension to another dimension
the coordinate systems that might be involved in texture mapping
parametric coordinates (u,v), texture coordinates (s,t), object/world coordinates (x,y,z), screen coordinates
what are parametric coordinates used for?
to model curved surfaces
what is the direction we want to find in texture mapping
given a point on the object we’d rater like to know which point in the texture it corresponds to
so in a sense:
s = s(x,y,z)
t = t(x,y,z,)
0 <= s, t <= 1
how does texture mapping kinda work?
for object vertices on the world map you will have (via algorithm or explicitly given) coordinates on the texture, and then you could map it via bilinear interpolation.
issue with bilinear interpolation
may cause distortions when texutre is mapped on a trianglea
aliasing
point sampling of the texture can lead to aliasing errors
a better option for anti aliasing
using are averaging
magnification
one texel may cover many pixels
minification
many texels may cover a single pixel
mipmapping
allows for prefiltered texture maps of decreasing resolutions
one option for genertaing texture coordinates if they are not explicitly given?
specify a plane near the object, and then generate texture coordinates based upond distance from that plane.
two point mapping approach
map to some intermediate object, and then map to actual object.
cylinder as the intermediate object, two point mapping
x = r*cos(2pi*u)
y = r*sin(2pi*u)
z = v.h
notice that this is a parametric form, hence u = s, and v = t.
parametric sphere, two point mapping
x=rcos(pi*u)
y = rcos(pi*u)*cos(2pi*v)
z = r*sin(pi*u)*sin(2pi*v)
one thing to consider with sphere mapping, two point
need to decide where to put the distortion (at the poles e.g.)
spherical maps are expecially used in
environmental mapping
box mapping
like minecraft skins
second part of two point mapping
what if the object is not a sphere cylinder, or a box,
then on the object
use normals from the intermediate to actual
use normals from actual to intermediate
use vectors from the center of the intermediate
what does culling enable
we can avoid rendering triangles facing away from the viewer by culling.
culling predicate
a face is visible if -90 <= the angle between the normal and the viewer vector <= 90
or equivalently, if 0 <= v.n