Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer...

49
Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics

Transcript of Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer...

Page 1: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Radiosity, Surface Detail, Textures

Saravanan Manoharan

EEL 5771-001Introduction to Computer Graphics

Page 2: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Overview:• Radiosity

- Intensity

- Radiant flux

- Form factor & Equation

- Radiosity equation

- Progressive refinement• Surface detail

- Texture

- Bump mapping

- Frame mapping

- wire frame• Non- photorealistic rendering

- Hatching & cross hatching

- pen and ink techniques

- Artistic style rendering

- Mosaic rendering

Page 3: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

RADIOSITY:

A rendering method that simulates light reflecting off one surface and onto another. It is a more accurate method of rendering light and shadows than ray tracing

Radiosity produces the soft shadows from multiple reflect-ions and light sources that exist in the real world

Global illumination algorithm: illumination arriving on a surface comes not just directly from the light sources, but also from other surfaces reflecting light

Page 4: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Scene without radiosity

Same scene with radiosity

Page 5: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Bi is the radiosity of patch i.Ei is emitted energy.Ri is the reflectivity of the patch, giving reflected energy by multiplying by the incident energy (the energy which arrives from other patches).All j () in the rendered environment are integrated for BjFjidAj, to determine the energy leaving each patch j that arrives at patch i.Fji is a constant form factor for the geometric relation between patch i and each patch j.

Radiosity is the energy leaving the patch surface per discrete time interval and is the combination of emitted and reflected energy

Page 6: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Intensity• Intensity: RGB components weighted equally• Eye is sensitive to ratios of intensity rather than absolute

intensity levels• Most displays output light intensity: L = kNγ where N is

number of electrons in the beam and γ is usually 2.2-2.5• Intensity attenuates in proportion to distance from source

SOLID ANGLE:• A solid angle is a 3D angular volume that is defined

analogously to the definition of a plane angle in two dimensions.

Page 7: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

• Intensity, I, is the flux per unit solid angle. It is the amount of flux from a point source contained in a small angular volume.

• Steradian (sr): The solid angle subtended at the center of a sphere by an area on its surface numerically equal to the square of the radius

• When the solid angle is large enough so that the angle with the surface normal is not the same over the entire solid angle, the total projected solid angle must be computed by integrating the incremental projected solid angles

Page 8: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Radiant Flux:

• Light “flows” through space, and so radiant power is more commonly referred to as the “time rate of flow of radiant energy,” or radiant flux.

• Φ = dQ/dt • where Q is radiant energy and t is time. In terms of a photographic

light meter measuring visible light, the instantaneous magnitude of the electric current is directly proportional to the radiant flux.

Page 9: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Form Factor:• In radiosity, the surfaces of the scene to be rendered are each

divided up into one or more smaller surfaces (patches). A form factor is computed for each pair of patches; it is a coefficient describing how well the patches can see each other. Patches that are far away from each other, or oriented at oblique angles relative to one another, will have smaller view factors.

• The form factor in the above equation is defined to be the fraction of energy that leaves surface i and lands on surface j

Page 10: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Radiosity equation:

• Radiosity B is the energy per unit area leaving the patch surface per discrete time interval and is the combination of emitted and reflected energy:

• B(x)i dAi - total energy leaving a small area dAi around a point x.

• E(x)i dAi is the emitted energy.

• ρ(x) is the reflectivity of the point, giving reflected energy per unit area by multiplying by the incident energy per unit area (the total energy which arrives from other patches).

• S denotes that the integration variable x' runs over all the surfaces in the scene• r is the distance between x and x‘

If the surfaces are approximated by a finite number of planar patches, each of which is taken to have a constant radiosity Bi and reflectivity ρi, the above equation gives the discrete radiosity equation,

Page 11: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Form Factor Equation:

• Polar angles and ’ between normals and ray between x and y • Visibility function v(x,y) = 0 if ray from x to y is occluded, v(x,y) = 1

otherwise• Distance r between x and y

• Form factors are symmetric:

• Divide radiosity equation by A

Page 12: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Progressive Refinement:

• Instead of computing all form-factors and then solving a complete set of linear radiosity equations, the progressive refinement method computes and distributes the light energy one patch per refinement iteration step.

• Progressive refinement is a ray tracing algorithm that quickly reveals coarse structure of an image, and gradually reveals additional detail over time.

• The first pixel is rendered as a single rectangle occupying the entire work area. The second through fourth each occupy a quarter of the work area.

• Sufficient progression will refine the image until the rendered rectangles correspond to a target resolution

Advantage:

The main advantage of the technique from the user point of view, is to be able to quickly get a visual feedback about what the frame looks like before it is completely finished. This might be useful when an artist is tweaking the lighting or the materials of the scene.

Page 13: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.
Page 14: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Example:

• Screen resolution

Working:• Each element in the scene maintains two energy values: an accumulated energy value

and residual (or "upshot") energy. We choose one of the elements in the scene as the "shooter" .• If a receiving element is visible, then we calculate the amount of energy transferred from the

shooter to the receiving element, as described by the corresponding form factor and the shooter's residual energy.

• This energy is multiplied by the receiver's reflectance, which is the fraction of incoming energy that is reflected back out again, and is usually represented by an RGB color.

Page 15: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Radiosity applications:The Radiosity method offers a powerful capability that the ray tracing

technique cannot - interactive walk throughs of the environment.dealing with diffuse reflectors in enclosures, the method works best for man-

made environments such as architectural designs, interiors of offices, factories and lighting designs

useful tool for light designers and theatrical lighting designers since it accurately simulates global illumination

Page 16: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Typical features of a radiosity application for architecture would include

• Translation from modeler data formats

• Access to material libraries

• Access to lighting libraries

• Positioning of lights

• Assignment of material properties

• Positioning of texture maps

Page 17: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Environmental MappingApproximating the appearance of a reflective surface by means of a

precomputed texture imageThe texture is used to store the image of the distant environment

surrounding the rendered object

Types:Sphere mappingCube mappingHealpix mapping

Page 18: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Steps for Environmental mapping• Create a 2D environment map Create a 2D environment map • For each pixel on a reflective object, compute the normal the normal • Compute the reflection vector based on the eye position and surface

normal position and surface normal • Use the reflection vector to compute an index into the environment

texture into the environment texture • Use the corresponding texture to color the pixel

Page 19: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Sphere mapping:• Represents the sphere of incident illumination as though it

were seen in the reflection of a reflective sphere through an orthographic camera

• a fisheye lens or via prerendering a scene is used• Synthetic scene can be generated using ray tracing

Page 20: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Cube mapping: • uses the six faces of a cube as the map shape. • The environment is projected onto the sides of a cube and

stored as six square textures, or unfolded into six regions of a single texture.

• The cube map is generated by first rendering the scene six times from a viewpoint, with the views defined by an 90 degree view frustum representing each cube face.

Page 21: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

HEALPix mapping:• HEALPix environment mapping is similar to the other polyhedron

mappings, but can be hierarchical, thus providing a unified framework for generating polyhedra that better approximate the sphere. This allows lower distortion at the cost of increased computation

• Healpix mapping with Grid example

Page 22: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

• We can display an object on a monitor screen in three different computer-model forms:

• Wireframe model • Surface Model • Solid model

Wire frame model:• A wireframe model consist of points and curves only, and looks as if

its made up with a bunch of wires. • This is the simplest CAD model of an object.• Advantages- 1. Ease of creation and low level hardware and

software requirements. 2. the data storage requirement is low. • Disadvantage- very confusing to visualize. For example, a blind hole

in a box may look like a solid cylinder, as shown in the figure.

Page 23: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Polygonal modeling:

-Polygon mesh: vertex, edges and polygon collection where each edge is shared by two polygons as maximum

• vertex: point with coordinates (x,y,z)

• edge: line segment that joins two vertices

• polygon: close sequence of edges

– There are different type of representation that can be used at the same time in a same application

• Explicit

• Pointers to list of vertices

• Pointers to list of edges

– Criteria to evaluate different representations:

• time

• space

• topological information

Page 24: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Surface detailing:• In computer graphics, the fine surface detail on an object

is generated using textures.

Three aspects of texture are generally considered:

1.Texture mapping: the addition of a separately specified pattern to a smooth surface. After the pattern is added, the surface remains smooth. Also known as patterns or colour detail

2. Bump mapping: the addition of roughness to the surface. This is obtained perturbation function that changes the geometry of the surface. Also known as roughness

3. Simulating environments: for example, shadows and lighting using textures.

Page 25: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Texture mapping:• Texture mapping is the process of mapping an image onto a

triangle in order to increase the detail of the rendering• This allows us to get fine scale details without resorting to

rendering tons of tiny triangles • The image that gets mapped onto the triangle is called a

texture map or texture and is usually a regular color image• We define our texture map as existing in texture space, which

is a normal 2D space • The lower left corner of the image is the coordinate (0,0) and

the upper right of the image is the coordinate (1,1) • The actual texture map might be 512 x 256 pixels for example,

with a 24 bit color stored per pixel

Page 26: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Texture Coordinates

• To render a textured triangle, we must start by assigning a texture coordinate to each vertex

• A texture coordinate is a 2D point [t x t y ] in texture space that is the coordinate of the image that will get mapped to a particular vertex

Page 27: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

• Mapping functions: s=f(u,v) , t=g(u,v) • The mapping functions are frequently assumed to be

linear:

s=A u+B

t=C v+D • where the constants A, B, C and D are obtained from the

relationship between known points in the two systems.

Page 28: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Texture mapping

1. Image without texture

2. Image with texture

Page 29: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Anti-aliasing:

• Aliasing is a constant aspect of texture mapping

• Frequency domain analysis: silhouette edges and

perspective can cause high frequency patterns in image

space

• Point sampling (mapping the center of image pixel to

texture space and use the nearest texture pixel) a texture

pattern can generate lots of aliasing problems:

• Wide literature on different filters to circumvent the

problem

Page 30: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Bump Mapping:

• A sphere without bump mapping (left). A bump map to be applied to the sphere (middle). The sphere with the bump map applied (right) appears to have a mottled surface resembling an orange. Bump maps achieve this effect by changing how an illuminated surface reacts to light without actually modifying the size or shape of the surface.

Page 31: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Bump mapping:• Adding texture patterns to smooth surfaces produces smooth

surfaces• Using a rough-textured pattern to add the appearance of roughness

to a surface is not a good idea. Rough-textured surfaces hava a small random component in the surface normal and hence in the light reflection direction

• Blinn developed a method to for perturbing the surface normal. At any point of the surface S, the partial derivatives are Su and Sv . The surface normal n is given by the cross-product:

Page 32: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Bump Mapping:

Page 33: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Example:

Page 34: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Non- photorealistic rendering:• Non-photorealistic rendering does not reproduce the real object, but

focuses on graphic art, personality and style of expression. NPR has recently become a hot research topic in computer graphics.

• It produce schematic representations of scenes that include only the relevant geometric information, clarifying shapes and focusing attention

Page 35: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Algorithms in NPR:

• Silhouette and Hidden-Line Algorithms• Image-Space Silhouette Algorithms• Object-space silhouette algorithms• Stroke and Paint Models• Interactive Painting and Drawing• Automatic Painting Algorithms• Automatic Pen-and-Ink Algorithms

Page 36: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Applications:

• Architectural designs• Medical textbooks• In paintings• Film production industry• In animation production

Page 37: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Hatching:

• Drawing surfaces using hatching strokes simultaneously conveys material, tone, and form

• Hatching can simultaneously convey lighting, suggest material properties, and reveal shape.

• Hatching generally refers to groups of strokes with spatially-coherent direction and quality. The density of the strokes controls tone for shading.

• Their character and aggregate arrangement suggests surface texture• Several non-photorealistic rendering (NPR) methods address

hatching in still images rendered from 3D scenes. However, these methods lack temporal coherence, and are thus unsuitable for animation.

Page 38: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Halftone:• Halftone is the reprographic technique that simulates continuous

tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient like effect.[ "Halftone" can also be used to refer specifically to the image that is produced by this process.

Page 39: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Halftone Dot pattern:• Producing halftone dots of different sizes requires not only an appropriate

halftone screen but also keeping the screen at a certain distance from a light-sensitive plate. Only then will the final dots have different sizes related to the amount of light penetrating each opening of the screen

• The halftone process was used for books, newspapers, and magazines, as well as many different forms of printed and visual advertising and product decoration.

• Halftone in QR scan

Page 40: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Cross hatching:• A way of adding cartoon like detail and shading to a scene. • It details a scene by adding lines right-angles to create a mesh

like appearance. • In OpenGL, a rather simple shader exists to create a similar kind of scene. All

we need is a fragment shader to handle the cross hatching of our scene• need a 2D texture that will tell us what fragment is being rendered and a

luminace value to help determine whether or not our current fragment lies on a particular line

Page 41: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

NPR techniques:

•  Pen-and-Ink illustration

Techniques: cross-hatching, outlines, line art,etc. • Painterly rendering

Styles: impressionist, expressionist, pointillist, etc. • Cartoons

Effects: cartoon shading, distortion, etc. • Technical illustrations

Characteristics: Matte shading, edge lines, etc.• Scientific visualization

Methods: splatting, hedgehogs, etc.

Page 42: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Pen and ink techniques:

• Strokes- Curved lines of varying thickness and density of placement

• Texture - Character conveyed by collection of strokes, e.g. crisp and clean vs. rough and sketchy

• Tone - Perceived gray level across the image • Outline - Boundary lines which disambiguate structure

information

Page 43: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Characteristics of pen-and-ink• showing not only region borders (maybe combined w/ sparse lines) • also showing shading • also showing surface shape • also illustrating material • abstraction and emphasis

Advantages:• does not require halftoning, already black-and-white • thus images good for printing • mark placement & stylization allow abstraction & emphasis• precise depiction, good for illustration applications• high-quality representation: vector or 1 bit pixel images

Page 44: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Artistic style rendering:

• Rendering in visual art and technical drawing means the process of formulating, adding color, shading, and texturing of an image

• The alternative method to rendering an image is capturing an image such as photography or image scanning. Both rendered and captured images can be mixed, edited, or both

• visual information is interpreted by the artist and displayed accordingly using the chosen art medium and level of abstraction in abstract art

Page 45: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Mosiacs Rendering:

• Constrain camera motion to planar concentric circles, and create concentric mosaics by composing slit images taken at different locations along each circle.

• Constrain cam motion to planar concentric circle, create concentric mosaics by composing slit images taken at different locations along each circle.

Page 46: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Construction of a concentric mosaic:

Page 47: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

Rotoscoping:• Rotoscoping is a technique where images are copied from a moving

video into an animation. The animator draws the motion and shape of the object by referring to the video as opposed to imagining in his head. With the help of the rotoscoping one can animate some complex scenes that would be hard to visualize otherwise. The disadvantage is that one will have to hunt for the exact video that one wants to animate.

Page 48: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

• Advantages: • Rotoscoping makes it easier to animate really difficult, complex actions.• Rotoscoping motivates students to learn more complex software

applications.• The process of rotoscoping teaches students about the reality of animating

as a very time intensive activity.

Things to consider:• Style: What type of drawing will you do? Experimenting in advance is

encouraged to develop a style that you can consistently replicate throughout the animation

• Color: You will be re-drawing the action but it does not have to be the same color. What happens when the hue is changed?

• Time: This can be a very time consuming process, so do not pick a drawing style that will take you 30 minutes per frame to complete

• Audio: How does the role of audio in your animation affect the style and pace?

• Continuity or discontinuity in drawing style.

Page 49: Radiosity, Surface Detail, Textures Saravanan Manoharan EEL 5771-001 Introduction to Computer Graphics.

References:

• http://sensing.konicaminolta.asia/learning-center/light-measurement/radiometry-spectroradiometry-photometry/

• http://www.scratchapixel.com/old/lessons/3d-advanced-lessons/adaptive-progressive-refinement-rendering/technique-description/

• http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter39.html• http://www.multires.caltech.edu/pubs/ffpaper.pdf• https://www.siggraph.org/education/materials/HyperGraph/mapping/

r_wolfe_mapping.pdf• http://jerome.jouvie.free.fr/opengl-tutorials/Tutorial11.php• http://citeseerx.ist.psu.edu/viewdoc/download?

doi=10.1.1.424.3421&rep=rep1&type=pdf