Home / Engineering Computing / Get Real Shading in Minutes

Get Real Shading in Minutes

By Randi Rost

It used to be that an MCAD designer could easily spend hours and hours creating and modifying a particular shader in order to get a 3D model’s surface to show a realistic texture. But with the introduction of OpenGL 2.0, you can actually create and modify photorealistic shaders in real time.

Since OpenGL is a cross-platform, vendor-neutral graphics application programming interface (API) controlled by a consortium of cooperating organizations, development of OpenGL 2.0 took the day-to-day challenges of designers into account. In part, this was inspired by last year’s unveiling of the OpenGL Shading Language and the integration of this language into OpenGL 1.5. The OpenGL Architecture Review Board (ARB; opengl.org), which controls the OpenGL specification, made it a point to consider the daily challenges faced by designers with the new release.

With OpenGL 2.0, developers use a high-level shading language that is compiled from source code to machine code within the graphics driver to create photorealistic shaders in minutes rather than hours. By enabling direct compilation to machine code, MCAD software developers obtain the maximum possible performance for custom rendering effects on a much wider range of graphics hardware. This performance gain is passed directly to MCAD designers who can take full advantage of the programmability and surprisingly realistic shaders effects in real time.


Figure 1: This image was rendered using OpenGL 2.0 with a metallic shader that is faster and more realistic than was possible with OpenGL 1.5. Click image to enlarge. Image courtesy LightWork Design Ltd.

Why would MCAD designers want to make sure their preferred software is compatible with OpenGL 2.0 rather than previous versions of the API? One reason is that OpenGL 2.0 integrates the highly programmable OpenGL Shading Language into its core. That means the shading language successfully brings state-of-the-art programmability to OpenGL, which, by nature, takes an agnostic approach to operating environments as well. OpenGL is supported on several operating systems including Windows, Mac OSX, Linux, Solaris, and other Unix variants. Designers can choose from any platform available and use OpenGL 2.0’s programmability.

Designer Usage

OpenGL 2.0 makes realistic effects easier to create than ever before. Designers can now create photorealistic shaders and apply finishes that were previously unheard of. For example, MCAD designers had a difficult time creating the appearance of a clear-coat metallic paint finish for use on car models. To create the effect with OpenGL 2.0, designers simply apply the metallic paint shader to the designated area to obtain the clear, crisp, and reflective characteristics of a clear-coat metallic paint (see Figure 1, above). The only way this effect was possible previously was through software-rendering packages that could take hours to render a single image. This new time-saving feature alone brings new productivity and flexibility to MCAD designers. It decreases the time and design rounds required to complete a project because products and components are drawn to accurate specification the first time and clients can interactively review the final design with photorealistic shaders applied.


Figure 2: This wrought stainless shader was created using SolidWorks 2004 and a Wildcat Realizm 100 graphics accelerator. Image courtesy SolidWorks Corp. Click on image to enlarge.

Having access to extensive libraries of interactive photorealistic shaders and rendering effects changes the MCAD development landscape. By adding shaders directly or offering shader plug-in options to new versions of their software programs, some software companies like SolidWorks and LightWork Design bring the power and programmability of shaders directly to the designer’s operating environment.

SolidWorks was the first company to release a commercial product that used the OpenGL Shading Language. SolidWorks 2004 introduced a library of nearly 80 realistic materials called RealView Graphics that can be applied to any surface and are rendered using OpenGL shaders. Materials supported in this library include various steel alloys; pure metals such as silver, gold, copper, lead, molybdenum, vanadium, and zirconium; mixed metals like cast iron and brass; synthetic materials such as rubber, PVC plastics, and glass fibers; woods such as maple, oak, pine, beech, and cedar; and even a few natural materials such as air and water (see Figure 2 and Figures 3  and Figure 4 below).


Figure 3: The same setup as in Figure 2 was used to get this leaded commercial bronze shader. Image courtesy SolidWorks Corp. Click on image to enlarge.

LightWork Design has taken this approach even further in its LightWorks Archive (LWA) material file format by licensing and releasing real-world material libraries based on Mold-Tech and Roehlen-textured surface finishes, RAL Colours, Sherwin-Williams paint libraries, Benjamin Moore colors and finishes, Avonite surfacing, and extensive ranges of carpets and tiles from manufacturers such as Mannington, Marley Floors, Westbond, and UNS Metals. The materials are downloadable from the LightWorks-user website for use with CAD applications based on LightWork’s rendering software. The OpenGL Shading Language has the ability to render these materials in real-time on the latest generation of graphics hardware.

Another New Trick

With this new programmability, application developers can implement new algorithms for lighting and surface reflection and pass them on to MCAD designers who can then make lighting changes at will. Also, surface materials can be computed using any combination of textures or they can be synthesized algorithmically. This provides designers with more surface materials to work with, which means greater design flexibility and more creative possibilities. Another new trick is animation. With OpenGL 2.0 any shader parameters can be modified over time to provide animation effects.


Figure 4: This titanium shader is just one of many metallic shaders. Synthetic and natural materials can also be rendered. Image courtesy SolidWorks Corp. Click on image to enlarge.

New shader possibilities enabled by OpenGL 2.0 include:• Render increasingly more realistic materials like metal, stone, wood, and paint
• Render natural phenomena like fire, clouds, and smoke
• Use procedural texturing to create stripes, polka dots, bricks, and stars
• Use nonphotorealistic effects to create paint strokes, pen and ink, hatching, technical illustration, and cartoons
• Create animations by modifying any shader; morphing and particle systems are now achievable
• Alter texture maps to create bidirectional reflectance functions (BDRF), polynomial texture maps, gloss maps, or irradiance maps
• Use imaging operations to perform color correction or transformation, noise removal, blurring, sharpening, or blending
• Perform anti-aliasing procedures better with stochastic sampling, adaptive pre-filtering, analytic integration, or frequency clamping
• Use graphics hardware to perform highly parallel computations so that numerical simulations and visualizations of complex functions are faster than using a CPU to perform the same task.

Upgrade Advantages

MCAD designers will see improved performance over previous versions of OpenGL with OpenGL 2.0. Developers are rapidly taking advantage of OpenGL 2.0’s programmability to improve the end-user experience. Computations that were once performed on the CPU because the graphics hardware lacked flexibility are now accomplished on the graphics hardware. By offloading this work from the CPU, the CPU can spend more time actually running the application. Additionally, the graphics hardware can perform these computations many times faster than the CPU. To designers this means more performance and improved productivity.

Designers will need to invest in fully programmable graphics hardware to recognize the full benefits of OpenGL 2.0. The increased parallelism offered by today’s fully programmable graphics also provides designers with a significant performance improvement when completing photorealistically rendered tasks.

Upgrading to OpenGL 2.0 enables MCAD designers to be more creative, design faster, and to create models that are more photorealistic than previously possible.

Randi Rost, director of developer relations for 3Dlabs, is the author of OpenGL Shading Language, published by Addison-Wesley. He led the 3Dlabs software team that drove the definition of the OpenGL Shading Language and produced the industry’s first implementation of it on 3Dlabs graphics hardware products. To contact Randi about this subject, send an e-mail c/o DE by clicking here.


Company Information

OpenGL 2.0
3Dlabs Inc., Ltd

LightWorks Archive
LightWork Design Ltd.

SolidWorks Corp.

About DE Editors

DE's editors contribute news and new product announcements to Digital Engineering. Press releases can be sent to them via DE-Editors@digitaleng.news.