Surface Rendering in Computer Graphics with examples

Surface Rendering in Computer Graphics with examples

What is Surface Rendering?

  • Surface rendering refers to generating 2D images from 3D geometric models.
  • Basic illumination is a crucial aspect of surface rendering, as it simulates the interaction of light with surfaces, creating realistic images.

What is Basic illumination?

  • Basic illumination refers to the fundamental process of simulating how light interacts with surfaces in a 3D environment to generate realistic images.
  • It involves factors such as light sources, material properties, and reflection models.

Light Sources

  • In a 3D environment, light sources play a vital role.
  • They can be directional, point lights, or ambient lights.
  • Directional lights have a specific direction but no definite position.
  • Point lights emit light uniformly in all directions from a specific point.
  • Ambient lights provide constant illumination across the scene.
  • Example: In a virtual room, a directional light might represent sunlight streaming through a window,
  • while point lights could simulate lamps, and ambient light contributes to overall scene brightness.

Material Properties

  • Surface materials have properties such as ambient reflectance, diffuse reflectance, and specular reflectance.
  • Ambient reflectance represents the constant color of an object,
  • diffuse reflectance determines how it interacts with direct light and
  • specular reflectance accounts for shiny highlights.

Ambient Reflectance

  • Ambient reflectance represents the constant color and brightness of an object under ambient or indirect lighting.
  • It is the component that ensures that objects are not completely dark, even in the absence of direct light sources.
  • Ambient reflectance provides a uniform level of illumination across an object's surface.
  • This helps maintain visibility and prevents complete darkness.
  • Unlike direct lighting, which varies based on the direction of light, ambient reflectance is independent of light direction.

Diffuse Reflectance

  • Diffuse reflectance accounts for how a surface interacts with direct light.
  • It determines the color and brightness of a surface based on the angle between the incoming light and the surface normal.
  • Example: Imagine a virtual soccer ball on a grassy field under sunlight. The green color of the grass is the diffuse reflectance.
  • When sunlight hits the ball, the color and brightness are influenced by how the surface scatters light, creating a realistic appearance.

Specular Reflectance

  • Specular reflectance is responsible for the shiny highlights on a surface, especially when illuminated by a direct light source.
  • It represents the mirror-like reflection of light.
  • It occurs on smooth surfaces like glass, metal, or water.
  • Example: Imagine sunlight reflecting off the surface of a calm lake.
  • The concentrated, bright reflection of the sun on the water is an example of specular reflectance.

Reflection Models

Basic illumination often employs reflection models like Lambertian reflectance, which assumes that light is reflected equally in all directions, resulting in a diffuse appearance.

Ambient Lighting

  • Ambient lighting contributes to the overall illumination or light of a scene.
  • It is a constant light that simulates indirect illumination or light from multiple sources.
  • While it helps eliminate dark areas, too much ambient light can lead to unrealistic scenes.

Distance Effects

  • The distance between a light source and a surface affects the intensity of illumination or light.
  • The inverse square law dictates that as distance increases, the illumination decreases quadratically.
  • This distance attenuation is crucial for creating realistic lighting in a 3D environment.

Shading Models

What is Gouraud Shading?

  • Gouraud shading is an interpolation technique used to produce smooth shading across polygons.
  • Gouraud shading produces visually appealing results and is computationally less expensive than other shading models like Phong shading.
  • Gouraud shading may not capture specular highlights and subtle lighting variations as effectively as more advanced models.
  • Named after Henri Gouraud, this method calculates vertex colors and then interpolates them across the polygon's surface.
  • Color intensity at each vertex is computed based on the lighting model (e.g., Phong reflection model) and material properties.

Phong Shading Model

  • The Phong shading model, proposed by Bui Tuong Phong, is an improvement over Gouraud shading, particularly in handling specular highlights.
  • The Phong model incorporates three main components: ambient, diffuse, and specular reflection.
  • Phong shading excels at capturing highlights and shadows, making it suitable for materials with glossy or shiny surfaces
  • Unlike Gouraud shading, Phong shading calculates color intensities at each pixel rather than at the vertices
  • Example: Imagine a 3D model of a metallic sphere under directional lighting

Intensity Calculation

Compute the intensity of light at each pixel using the reflection vectors.
This involves considering ambient, diffuse, and specular components, providing a more accurate representation of light interaction.

Conclusion

In summary, surface rendering involves the simulation of light interaction with 3D surfaces, considering factors like light sources, material properties, and reflection models.