0% found this document useful (0 votes)
17 views23 pages

Bump and Environment Mapping Techniques

The document discusses bump mapping and environment mapping techniques used in computer graphics to simulate surface details and reflections without adding geometry. Bump mapping modifies surface normals to create the illusion of texture, while environment mapping simulates reflections by mapping the environment onto objects. Both techniques involve complex calculations and transformations to achieve realistic visual effects in rendered images.

Uploaded by

Jyriwu Craftaj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views23 pages

Bump and Environment Mapping Techniques

The document discusses bump mapping and environment mapping techniques used in computer graphics to simulate surface details and reflections without adding geometry. Bump mapping modifies surface normals to create the illusion of texture, while environment mapping simulates reflections by mapping the environment onto objects. Both techniques involve complex calculations and transformations to achieve realistic visual effects in rendered images.

Uploaded by

Jyriwu Craftaj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Bump and

Environment
Mapping
CS 211A
Bump Mapping
• Simulate the effects of details in
geometry without adding geometry
Difference from Texture
Mapping
• Texture mapping cannot simulate
rough surface details
• Rough surfaces show illumination
changes with the movement of the
light or object
– Textured objects cannot simulate that
– Since independent of illumination
parameters
• Basic Idea
– Perturb the normal and use the perturbed
normal for illumination computation
Normal Perturbation Theory
u N = Pu x Pv Modify the surface position
P’(u,v) by adding a small
P(u,v) Pu
perturbation (called bump
function) in the direction of
Pv
the normal:
v
P’(u,v) = P(u,v) + B(u,v) n
P – Point on the surface
Pu – Tangent at P in u direction B(u,v) is a scalar function
Pv – Tangent at P in v direction
N – Normal at P This is a vector addition
Normal Perturbation Theory
• P’(u,v) = P(u,v) + B(u,v) N
• P’u = Pu + BuN + BNu
• P’u ≈ Pu + BuN
• P’v ≈ Pv + BvN
• N’ = P’u x P’v
= Pu x Pv + Bv (Pu x N) + Bu (Pv x
N)
+ BuBv (NxN)
= N + Bv (Pu x N) + Bu (Pv x N)
Implementation
• Start with a gray scale texture –
B(u,v)
Implementation
• Find the image Bu(u,v) by subtracting
every pixel from its right neighbor
Implementation
• Find the image Bv(u,v) by subtracting
every pixel from its bottom neighbor
Implementation
• N’ = N + Bv (Pu x N) + Bu (Pv x N)
Implementation
• N’ = N + Bv (Pu x N) + Bu (Pv x N)

(0, 0, 1) (0, 1, 0) (1, 0, 0)


• These vectors are orthogonal to each other
• Define a local coordinate system at a vertex
by normal and the tangent plane at this
vertex
• N’ = (Bu, Bv, 1) – Perturbed normal in the
local coordinate system of each triangle
Normal Map
• N’ = (Bu, Bv, 1) - Stored as RGB value
• Since B is always 1, it is bluish in
appearance
Light and View Vector
• Light and View vectors
– Defined in the global coordinate system
• Convert these to the local coordinate
system
– Standard coordinate transformation
Rasterization
• Using pixel shaders
– Interpolate light
vector
– Interpolate normal
– Find the perturbed
normal from the
normal map
– Do lighting
computation in the
local coordinate
system
Examples
Interpolating Vectors?
• Yes, using pixel shaders you can do
it
• So, you can do Phong shading using
pixel shaders
• Standard openGL lighting does NOT
do phong shading
Environment Map
• Simulating the effect of reflection of
environment on a shiny object
Environment Map
• Generate the map of the
environment
– On a sphere, cube or paraboloid
• Use a view-dependent mapping on
the geometry
Generating the Map (Cube)
• Render the
scene from one
point, six times
with six different
view frustums
• On six planes of
a cube
Cubic Environment Map
Generating the Map
(Sphere)
• Use a angle
parameterization
• Use ray tracing to
sample the angles
at uniform
intervals
• OpenGL provides
a spherical
mapping for this
Mapping the Environment
V
N
• Enclose the arbitrary
geometry in the sphere
R
or the cube
• Reflect the view vector
about the normal
• The environment in the What does this remind you of?
direction of R is getting Difference: For texture mapping,
reflected about N and the mapping dependent on
reaching the viewer at geometry (vertex and normals),
here it depends on the view
V
Results
It is an approximation
• Ideally, we should get self reflections
• In this case, we would not get
• This is just an approximation
• To get accurate environment map, we
have to use ray tracing

Common questions

Powered by AI

Pixel shaders enhance bump mapping and Phong shading by allowing complex per-pixel lighting calculations, leading to more detailed and accurate rendering of surfaces. In bump mapping, pixel shaders can interpolate vectors such as light and normal vectors to apply perturbations at the pixel level, improving the fidelity of the bump effect. Similarly, for Phong shading, pixel shaders perform detailed calculations for specular highlights and smooth shading across surfaces, which are not possible with standard OpenGL lighting. This capability significantly increases the visual realism of scenes by considering finer details and variations in lighting and surface interactions .

Bump mapping and environment mapping serve different purposes: bump mapping aims to simulate detailed surface textures without modifying geometry by perturbing normal vectors, enhancing how surfaces interact with light. In contrast, environment mapping is used to simulate reflections on shiny objects, capturing how the environment appears on the surface of an object. Implementation-wise, bump mapping focuses on normal perturbation and lighting calculations in the local coordinate system, whereas environment mapping involves generating an environment map that reflects the scene, using techniques like cubic or spherical mapping dependent on view vectors. Notably, environment mapping is an approximation and does not handle self-reflections accurately without ray tracing .

Angle parameterization in sphere mapping uses predefined angles to capture environment reflections uniformly across the spherical surface, offering a straightforward technique for creating environment maps. It involves sampling these angles to reflect environment details onto a sphere surrounding the geometry. Conversely, ray tracing for environment maps traces light paths to accurately capture reflections based on surface geometry and light interaction, which allows precise simulations including self-reflections. While sphere mapping is less computationally expensive and easier to implement, ray tracing provides much higher fidelity but at a higher computational cost .

Normal perturbation theory significantly enhances the appearance of geometry by altering the normal vectors at surface points to simulate the effects of detailed textures, such as bumps or grooves, without modifying the underlying geometry. This modification affects how light interacts with the surface, providing visual cues of surface roughness and increasing realism. By presenting perturbed normals in lighting calculations, surfaces exhibit variations in shading and highlights as light or the object moves, thereby making flat surfaces appear textured without additional computational geometry costs .

The transformation of light and view vectors to the local coordinate system in bump mapping is done to accurately perform lighting computations relative to the perturbed normals. Since bump mapping modifies the normal vectors at surface points, converting the global light and view vectors to align with these local changes ensures that the interaction of light with the surface is correctly simulated. This transformation uses a standard coordinate transformation from the global to the local coordinate system defined by perturbed normals and the tangent plane .

Bump mapping simulates surface details by perturbing the normal vectors at the surface points based on a bump function, without changing the actual geometry of the object. This method is more effective than traditional texture mapping because texture mapping cannot simulate illumination changes that occur with light movement, as it is independent of illumination parameters. Bump mapping, by altering the normal vectors, affects the lighting computations, thereby simulating rough surface details and the resulting changes in illumination .

The key steps in implementing bump mapping using a grayscale texture involve: 1) Starting with a grayscale texture to define the bump function B(u,v); 2) Creating derivative images Bu(u,v) and Bv(u,v) by subtracting each pixel from its right and bottom neighbors, respectively; 3) Perturbing the normal vectors using these derivatives, defining the new perturbed normal as N' = N + Bv(Pu x N) + Bu(Pv x N); 4) Using these perturbed normals in lighting calculations to simulate the effects of surface bumps .

Cubic environment maps are generated by rendering the scene from a single point using six different view frustums and capturing these views on the six faces of a cube. This technique creates a comprehensive representation of the environment surrounding the object. The captured maps are then used to simulate reflections by mapping the direction of incoming view vectors to the corresponding point on the cube map. This is particularly useful for achieving realistic reflections on shiny objects by approximating how they interact with the surrounding environment .

In bump mapping, perturbed normals re-define how light interacts with each triangle by altering the direction of the normal vector within the triangle's local coordinate system. These perturbed normals are crucial because they determine the resultant shading and highlights that suggest surface texture. By altering the normals' orientation, bump mapping simulates the presence of fine surface details and textures in lighting calculations, contributing depth and realism to surfaces without changing their geometric shape .

Environment mapping is limited as an approximation technique because it cannot precisely capture self-reflections or dynamic changes in the environment. This approach approximates reflections by mapping the environment onto an object without considering the actual geometry or dynamic movement within the scene. The main limitation is that it does not account for interactions between the object and its actual mirrored surroundings, resulting in less accurate reflections. To overcome these limitations and achieve accurate reflections, ray tracing is required, which can more precisely simulate how light paths change based on both environment and object geometry .

You might also like