Document Details

MagnificentLithium

Uploaded by MagnificentLithium

Alexandrino Gonçalves

Tags

3D modeling lighting illumination computer graphics

Summary

This document is a presentation on lighting in 3D modeling. It covers various aspects of light sources, properties, and how they interact with surfaces. The presentation also compares different shading techniques like Gouraud and Phong shading.

Full Transcript

Lighting 3D Modelling Games and Multimedia Author: Alexandrino Gonçalves Last revision: 13/11/2024 Illumination Essential in all aspects of computer visualization Without it we don’t see the 3D models that we have modeled Since the physical models...

Lighting 3D Modelling Games and Multimedia Author: Alexandrino Gonçalves Last revision: 13/11/2024 Illumination Essential in all aspects of computer visualization Without it we don’t see the 3D models that we have modeled Since the physical models of light that travel through space are very demanding, normally those models are simplified in computer visualization Due to the late computer technological advancements, this is becoming less frequent, and the illumination models are gradually getting closer to reality 3DM 2 Illumination The illumination is described by: Position (only in some light geometries) Orientation Features: ▪ Light source(s) in the scene ▪ Materials of the illuminated surfaces 3DM 3 Light Source A light source can be considered just another object in the scene we are modelling 3DM 4 Light Source It is the interaction between the light source(s) and the objects (surfaces) of the scene that define the visual spectre of our world Features to define: Intensity: intensity of the light emitted Colour: colour emitted by the light source Geometry: the shape of the light source 3DM 5 Light Source Intensity: Depending on the type/geometry of the light source, this intensity is going to falloff through space Colour: Greatly influences the overall aspect of the scene (white by default) 3DM 6 Light Source - Geometry Directional: Its location is simulated in the infinity. Normally defined by a single vector that express its direction. The sun for example. Directional: Its location is simulated in the infinity. Normally defined by a single vector that express its direction. The sun for example. Directional_Light 3DM 7 Light Source - Geometry Point light: Located inside the boundaries of the 3D scene. It's specified by its 3D position. A lamp in a living room for example. 3DM 8 Light Source - Geometry Spotlight: Provides direct light through a cone. It is specified by its 3D position, a vector that define its direction and the drop-off for the cone’s softness. A flashlight for example. 3DM 9 Light Source - Geometry Area light: Emits directional light rays from an area shape, either a rectangle or circle. A florescent ceiling light for example. Area_Light 3DM 10 Light Source - Geometry Volume light: Similar to a point light. A volume light has a specific shape and size. Beams of light through an open window for example. Volume_Light 3DM 11 Light Source - Geometry Ambient light: Emits soft light rays in every direction. Simulates the indirect light that objects receive from all the objects in a scene. Useful for filling in areas that do not have enough illumination. 3DM 12 Light Source - Geometry Directional light Point light Spotlight Area light Volume light Ambient light 3DM 13 Illumination When traveling through space the light (photons) intersect the objects in the scene This intersection generates a reaction between the light and the object’s surface It is the light(s) features, and the material properties of the objects surfaces that produce the effect of colour in those objects 3DM 14 Illumination When the light energy reaches the material surface, it can be: Reflected: in the form of light Transmitted: in the form of energy Absorbed: converted into heat It is the reflection and the transmission that are responsible for the colour visibility of the object 3DM 15 Specular vs Diffuse The light reflected by an object surface depends on the composition, direction and geometry of the light source, as well as the properties of the object surface itself This reflected light, due to the surface properties, is categorized by: Specular: Reflection off smooth surfaces. Mirrors or a calm body of water for example. Diffuse: Reflection off rough surfaces. Clothing or asphalt roadway for example. 3DM 16 Specular vs Diffuse Specular Diffuse Specularity In which kind of surface, the observer position is irrelevant in the light calculations? Diffuse 3DM 17 Specular vs Diffuse The great majority of the material surfaces are not ideally specular or ideally diffuse As a result, the light rays are reflected in all directions in a random non uniform way In smother materials the specular light distribution is localized, creating an effect known as Highlight 3DM 18 Highlight Ideally Specular Ideally Diffuse Highlight 3DM 19 Local vs Global Shading The accuracy of a rendered three-dimensional scene is directly related to the illumination model utilised in its calculations These models describe how light travels through the scene from the light sources to the observer of that virtual environment 3DM 20 Local vs Global Shading Shading/illumination methods can be defined into two categories: Local illumination models: Only the light rays that directly hit the 3D surfaces are considered in the lighting calculations. Which does not occur in real life Global illumination models: In addition to the direct light, also considers the indirect light present in a scene, e.g., the light that is reflected or transmitted from all other objects in the scene 3DM 21 Local Illumination Models 3DM 22 Shading The normal of a facet/polygon is one of the main items to be considered in the shading/illumination models In a first approach, the shading algorithm could determine the normal in every point of a surface to be rendered Although, as expected, this process has considerable costs in computer power For this reason, methodologies were developed in order optimize the process and yet obtain satisfactory results 3DM 23 Constant Shading Only the normal of the polygon is used in the lighting calculations This implies that an entire polygon is shaded with the same colour This approach can lead to good results if: The light source is positioned at infinity The observer is also far away of the scene The scene doesn't have many curved surfaces to render 3DM 24 Constant Shading 3DM 25 Constant Shading Advantages: Very easy to implement Very light method Disadvantages: Since there is no lighting variations around the polygon, it can lead to unrealistic results, for example in big surfaces like a wall The transitions (edges) between the polygons are noticeable, giving the object a faceted appearance. Not suitable for curved surfaces 3DM 26 Interpolated Shading Interpolated methods of shading were developed to (try) eliminate the creases perceived in curved surfaces In order to smooth the transition between polygons, the approach is to use information of the adjacent polygons in the lighting calculations 3DM 27 Interpolated Shading There are two main algorithms that use this interpolated methodology: Gouraud shading Phong shading 3DM 28 Gouraud Shading Calculates the shading (colour) in each vertex using the normal of that specific vertex (determined by the average from all the normal vectors from the polygons that share that vertex) 3DM 29 Gouraud Shading The remaining shading intensities (colours) are determined by the interpolation of the initial values 3DM 30 Gouraud Shading 3DM 31 Gouraud Shading Advantages: Efficient Relatively easy to implement Disadvantages: Due to intensity interpolation, highlights will not appear within a polygon Even a highlight present in a vertex is scattered into a bigger area that really occurs 3DM 32 Phong Shading This algotithm follows the same principle as Gouraud shading, but in this method, it is the normals that are interpolated P3 P2 P Q P1 P4 3DM 33 Phong Shading 3DM 34 Phong Shading Advantages: Good results with specular surfaces Display highlights in the polygon interior More realistic results when displaying highlights Disadvantages: All the interpolated normals need to be normalized before shading calculations 3DM 35 Constant Shading 3DM 36 Gouraud Shading 3DM 37 ADSPNG Phong Shading 3DM 38 Global Illumination Models 3DM 39 Global Illumination Global illumination models try to, accurately, reproduce the direct and most important, the indirect light, since this light is widely responsible for the final appearance of a scene 3DM 40 Apart from the local illumination models, where only the light rays that hit the surfaces are considered in the lighting calculation, the global illumination models also consider the indirect light that hits an object, particularly: Refraction Shadows Reflection Global Illumination Apart from the local illumination models, where only the light rays that hit the surfaces are considered in the lighting calculation, the global illumination models also consider the indirect light that hits an object, particularly: Reflection Shadows Refraction 3DM 41 Global Illumination To improve realism, the reflection rays must consider the surface irregularity 3DM 42 Global Illumination In these late years, besides the reflection, shadows and refraction, global illumination methods also consider the light penetration and reflection in translucent surfaces, such as skin (known as Subsurface Scattering) 3DM 43 Subsurface Scattering 3DM 44 Global Illumination Such methods are, as expected, extremely demanding in terms of time and computer processing Although, the results produced by them are very realistic, towards a photorealistic or a physically- based image 3DM 45 Global Illumination 3DM 46 Global Illumination 3DM 47 Global Illumination 3DM 48 Ray Tracing Ray tracing is a technique that has its origins in lens-making. Gauss traced rays through lenses by hand in the 1800s 3DM 49 Ray Tracing Ray tracing algorithm is an illumination model, based on physic optics introduced in 1980 Rather than originating the rays at the light sources, the illumination of a desired scene is achieved by tracing these rays in reverse This method determines the path that could have been taken by a light ray from the camera/observer to the three-dimensional environment With this procedure, we can define the amount of light that hits a surface at a specific point 3DM 50 Ray Tracing Principle: cast a ray from the observer point of view into every pixel of the visualization screen, where the following situations can happen: The ray don’t intersect any object (draw background colour) 3DM 51 Ray Tracing The ray hits an object 3DM 52 Ray Tracing Shadows: When a ray hits an object, a new ray(s) is(are) traced into de light(s) source(s). If this new ray hits another object, then the 1st intersection point is in the shadow of the 2nd object 3DM 53 Ray Tracing Object shadow 3DM 54 Ray Tracing Reflection: When a ray hits an object, simultaneously a reflector ray is traced and tested against all objects in the scene 3DM 55 Ray Tracing Reflection: If the reflected ray hits another object, this light information is determined with a local illumination model and the result is sent to the 1st intersection point to be used in that spot 3DM 56 Ray Tracing Refraction: If the object has same sort of transparency, a new ray is emitted and tested with all objects in the scene rtrace8 3DM 57 Ray Tracing Inicial ray Rays to detect shadow Reflected rays Refracted rays 3DM 58 Ray Tracing 3DM 59 Ray Tracing 3DM 60 Ray Tracing Ray tracing is a recursive algorithm that produces very good results in scenes well illuminated and with reflective (specular) surfaces 3DM 61 Ray Tracing It is the level of recursion that establish the realism of the scene 3DM 62 Ray Tracing Scene without reflection rays 3DM 63 Ray Tracing Scene with one level of reflection 3DM 64 Ray Tracing rtrace12.gif Scene with two levels of reflection 3DM 65 Ray Tracing Disadvantages: Very computer demanding (number of intersections) Slow (due to the cost of the calculations in each intersection) If the viewer position changes, the algorithm need to be recalculated Advantages: Create very realistic scenarios with specular surfaces 3DM 66 Radiosity This technique is based on the thermal radiation theory between two surfaces, where it computes the amount of light energy transferred between those surfaces A light ray that hits a surface is reflected by numerous diffuse rays, which influence the light that might it other surfaces 3DM 67 Radiosity To achieve the results, this method split the 3D model into patches and do the calculations in each one 3DM 68 Radiosity 3DM 69 Radiosity Due to those diffuse rays, one advantage of this technique is that is viewer independent. If we change the viewer position, we don´t need to recalculate the light information. Which does not occur on ray-tracing This method is ideal to reproduce accurate lighting conditions in interior scenes. It can help to determine where to place windows or lights Widely used to test the colour bleeding effect 3DM 70 Radiosity Cornell Box 3DM 71 Radiosity 3DM 72 Radiance It’s an illumination model from the family of ray tracers developed by Greg Ward in 2003 It's considered a physically based illumination model designed to compute radiometric quantities Considers the radiance (incoming) and irradiance (outcoming) properties of a surface in a given point Suited to create HDR (High Dynamic Range) photorealistic images 3DM 73 Radiance 3DM 74 Radiance 3DM 75 Radiance - Conimbriga 3DM 76 Radiance - Conimbriga 3DM 77 Radiance - Conimbriga 3DM 78 Lumen It’s the new ray tracer global illumination model used in Unreal Engine 5 It can create dynamic photorealistic scenarios in real-time 3DM 79 Lumen 3DM 80

Use Quizgecko on...
Browser
Browser