Graphics Demo

Graphics Techniques Demopress to download

Technologies Used: , C++, opengl, SDL, imgui, glew, glm, GSL, glsl
Collaboration with teammate
Spring 2023

This project demonstrates a range of advanced graphics techniques using OpenGL, including procedural geometric modeling, toon/cell shading, fog effects, and noise generation (value and gradient). It also explores curve modeling with Hermite and Catmull-Rom splines, geometry and tessellation shaders, and shadow mapping. Each feature is presented in an intuitive interface with tweakable parameters, allowing for detailed customization and experimentation in real time.

Key Features:

  • Procedural Geometric Modeling: Real-time terrain generation with adjustable parameters.
  • Toon Shading and Fog Effects: Interactive shading effects combined with fog for enhanced visual depth.
  • Noise Algorithms: Value and gradient noise, used for terrain generation and texture effects.
  • Curves and Splines: Hermite and Catmull-Rom curves for smooth object transitions and path modeling.
  • Geometry/Tessellation Shaders and Shadow Mapping: Advanced shader techniques for refined details and realistic shadows.
  • This project was designed for easy interaction, enabling users to navigate and explore each demo via a simple UI. The comprehensive setup includes clear build and run instructions, a structured codebase, and attention to detail in code quality, style, and documentation.

Procedural Geometric Modeling

This image shows a scene from the graphics project, highlighting a wireframe cube mesh rendered in OpenGL. In this demo, users can explore different mesh types through an interactive menu, which includes options to select from various shapes such as a plane, cube, sphere, torus, cylinder, cone, and custom object (obj).

Toon Shading and Fog Effects

The demo is designed to illustrate various shading and fog effects, with interactive controls for adjusting the display parameters. The primary object, shown in a toon-shaded style, highlights the use of simplified shading for a cartoon-like aesthetic, enhanced by fog effects that provide depth and atmosphere.

In the control panel, users can enable or disable additional toon shading, rotate the object, and adjust fog distances and field of view (FOV) settings. The options to switch between different rendering modes, such as GL_FILL and GL_LINE, allow for further customization of the object’s appearance. This setup enables viewers to interact with the rendering process, visually experimenting with the effects of shading and fog on 3D models.

“Terrain” toggle and the “Sharp” checkbox allow users to switch between different terrain styles or details, while sliders for “stacks” and “slices” adjust the terrain’s mesh resolution, impacting the smoothness or complexity of the surface. This interactive setup provides flexibility for exploring the procedural terrain generation process, making it an effective demonstration of real-time terrain manipulation and rendering in OpenGL.

Noise Algorithms

This screenshot displays a noise generation demo from the graphics project, showcasing the application of both value noise and Perlin noise. The noise pattern is rendered dynamically, allowing users to explore different visual effects and noise types.

The control panel offers several customization options:

  • Noise Type Selection: Users can switch between Value Noise and Perlin Noise to observe the distinct characteristics of each.
  • Interpolation Modes: Options like linear, cosine, smoothStep, and quintic interpolation provide different methods for blending noise values, affecting the smoothness of the transitions within the noise pattern.
  • Movement Toggle: Enabling “Moving?” animates the noise, creating a shifting effect that adds dynamism to the visual.
  • Frequency Adjustment: A slider for frequency control allows users to adjust the density and scale of the noise, producing finer or coarser patterns.
  • Color Toggle: While grayed out in this screenshot, a color option may be available, allowing further customization of the noise display.

Curves and Splines

In this demo, users can adjust the start, mid, and end points of the curve to alter its shape dynamically. The red curve shown is influenced by these control points, which can be modified using sliders in the control panel. The interface includes the following options:

  • Start, Mid, and End Points (X and Y): Adjusting these sliders changes the coordinates of each point, allowing the user to reshape the curve in real-time.
  • Curve Switching: The “Press me! Switch curve” button enables users to toggle between different curve types, such as Hermite and Catmull-Rom splines, to observe how each interpolation method affects the curve’s form.

The blue squares serve as visual markers for the curve’s control points, making it easier to see the impact of adjustments. This demo provides a hands-on way to explore and understand the behavior of various curve types, commonly used in animation, modeling, and simulation applications.

Curves and Splines

This image demonstrates a tessellation and lighting demo from the graphics project, focusing on rendering a tessellated sphere in OpenGL. Tessellation is used to create a detailed mesh structure, dividing the surface into smaller triangles for smoother geometry.

The control panel provides several options:

  • Rendering Modes: Options for GL_FILL, GL_LINE, and GL_POINT allow users to switch between solid, wireframe, and point-based rendering, providing different visualizations of the tessellated mesh.
  • Tessellation Levels: Users can adjust tessellation levels, affecting the density and detail of the mesh. Higher tessellation results in a smoother sphere, while lower tessellation shows a more faceted structure.
  • Movement Toggle: Enabling “More Movement?” animates the sphere, adding dynamic changes to the tessellation effect.
  • Light Position Controls: Sliders for Light X, Light Y, and Light Z allow users to move the light source, affecting how light and shadows interact with the tessellated surface. This feature is useful for visualizing how light impacts different sections of a complex mesh.

The gradient color effect across the sphere adds visual depth, emphasizing the mesh structure. This demo serves as an interactive exploration of tessellation and lighting in 3D graphics, highlighting techniques used to achieve smooth and detailed models.

Geometry/Tessellation Shaders and Shadow Mapping

This image shows a shadow mapping demo from the graphics project, illustrating the creation and manipulation of shadows in a 3D scene using OpenGL. Shadow mapping is an essential technique for adding depth and realism to scenes by calculating shadows based on light sources and object positions.

Key Features and Controls:

  • View Modes: Users can toggle between Camera View, Light View, and Debug View to see the scene from different perspectives. This helps in understanding how shadows are cast from the light source and visualizing the shadow map.
  • Draw Back Faces: This option allows users to decide whether back faces (faces of objects not directly visible to the camera) should be included in the shadow calculations, impacting the accuracy and quality of shadows.
  • Zoom and Position Controls: The Zoom Rate slider and X, Y, Z Position controls adjust the camera or light source position, allowing for precise control over how shadows are viewed and cast within the scene.
  • Light Field of View (FOV): This setting controls the spread of light, influencing the size and shape of shadows. Adjusting the FOV can simulate different lighting conditions.
  • Light Near and Far Distances: These parameters define the range of the light’s influence, affecting how close or far objects must be to cast shadows.
  • Shadow Map Settings: Users can modify the Depth Component Bit Size and Shadow Map Dimensions to control the resolution and depth accuracy of the shadow map, enhancing shadow quality at the cost of computational resources.

In this scene, shadows cast by various 3D objects (cubes, spheres, and a model) are clearly visible, demonstrating the impact of light position, angle, and field of view on shadow placement and shape. This interactive setup allows for in-depth exploration of shadow mapping, providing insight into how shadows are computed and displayed in real-time graphics.

press to download!