Table of Contents: What Are Shaders and How Do They Work?
How matte does a fabric look? How does light reflect off varnished wood? Shaders describe these material properties in a rendering. For a convincing 3D visualization, geometry, materials, lighting, and composition must all work together. This overview explains the basics and shows what they mean for material and surface visualizations, product images, and interior scenes. You can find examples of our work in the 3D Render Studio.
What are shaders?
Shaders are programs used to calculate graphics data. In rendering, they determine, among other things, how surfaces react to light. Real-time graphics use programmable stages such as vertex and fragment shaders on the GPU. In offline rendering, materials are often built using nodes; depending on the renderer, calculations run on either the CPU or the GPU. Shaders are therefore not strictly limited to graphics cards. The technical fundamentals are explained in Khronos documentation on GLSL and Microsoft documentation on HLSL.
A CGI artist at Danthree Studio is reviewing fabric samples for a 3D visualization. Shaders play an important role in rendering realistic materials used in photorealistic renderings.
What are vertex shaders?
A vertex shader processes the vertices of a model. For example, it calculates their positions for display on the screen and passes additional data, such as texture coordinates, to the next stages. It does not determine the final color of each pixel on its own.
What are fragment shaders?
A fragment shader processes fragments generated during rasterization. It calculates color values and other output based on material parameters, textures, and, if applicable, lighting data. A fragment is not necessarily a finished pixel in the final image.
How do shaders work in 3D?
A simplified rasterization pipeline consists of the following steps: mesh, vertex shader, rasterization, fragment shader, additional tests, and image composition. Rasterization generates fragments from the projected surfaces. Textures and UV coordinates can assist in the calculation. This is an example of real-time graphics, not a general description of every rendering process.
Material editors in Unreal Engine and Unity help set up these calculations. Offline renderers such as Arnold, V-Ray, and Redshift also use material and node systems. A material combines shaders, parameters, and, if applicable, textures. The Unreal documentation on materials and the Unity documentation on the Lit Shader show different implementations.
Different types of shader maps for 3D models: normal map, diffuse map, specular map. Each of these maps serves a specific purpose in making a model's surfaces look realistic.
What role do shaders play in creating photorealistic 3D visualizations?
Physically Based Rendering (PBR) uses models of light behavior, such as for reflection, roughness, and energy conservation. This facilitates a realistic representation of materials under changing lighting conditions. However, it does not guarantee an exact match with a real product: material values, scale, lighting, and references must all align. A seminal technical paper on the subject is Physically-Based Shading at Disney. An example of its application from our work is the Barbas project, featuring fireplace images and a scroll story.
For furniture and interior design brands, visual language is just as crucial as the presentation of materials. Wood, fabric, stone, and metal should match the product; lighting, perspective, and interior design should align with the brand. This applies to living room renderings just as much as it does to bathroom visualizations and kitchen images.
A wooden leg of a 3D chair, created using PBR shaders. These shaders simulate realistic wood textures and surface materials in photorealistic 3D renderings.
What types of shaders are there?
The term "shader" is used in various contexts. Vertex and fragment shaders refer to technical processing stages; surface and volume shaders describe the rendering of materials. You'll often come across the following approaches:
Phong and Blinn-Phong: Classic lighting models that use a simplified method for calculating specular highlights. They are not complete physical material models, but they may be sufficient for certain real-time applications or stylized renderings.
PBR surface shaders: They describe properties such as roughness, metalness, reflection, or transmission using physically based parameters. The specific implementation depends on the renderer. For more information, see the glossary entry on Physically Based Rendering.
Shaders in ray tracing: Here, material properties are evaluated at the points where rays hit surfaces. Ray tracing is a rendering technique, not a type of material. It can also be used in real time. Our glossary on ray tracing explains the differences.
Volume shaders: They describe scattering, absorption, and, in some cases, intrinsic emission within a volume, such as fog, smoke, or steam. Light scattering beneath a solid surface, such as wax, is often described using a subsurface model within the surface material.
Nodes and OSL: These are ways to build or program shaders; they are not material types in their own right. Nodes visually link functions; Open Shading Language enables programmed shaders in supported renderers. The Arnold documentation on OSL provides an example.
A photorealistic 3D rendering of an upholstered bed with velour fabric, created using high-quality shaders. Shaders enable the realistic rendering of fabric textures and surface reflections.
What do the different texture maps in 3D shaders do?
Texture maps provide spatially varying values for a shader, such as color or roughness. With image textures, UV mapping often determines which area of the image appears on which surface of the model. Procedural textures and other projections can also work without manually unwrapped UVs.
Not every material requires every map. The key factors are the shader's inputs and the properties the product is intended to display:
Base Color: The base color of the material without baked-in lighting or highlights. How it is used for diffuse or metallic reflection depends on the material model.
Roughness: Describes microscopic roughness. It affects how sharp or broad reflections appear.
Metalness: In the Metallic Roughness model, this distinguishes between metallic and non-metallic behavior. Paint, coatings, and mixed surfaces require an appropriate material assignment.
Normal Map: Changes the direction of the surface normals for lighting calculations. This creates visible details without actually altering the geometry or its outline.
Displacement Map: Geometrically shifts the surface and can therefore also alter its silhouette. Alternatively, a height map can be used for bump mapping; in that case, it only affects the lighting calculation.
Specular and IOR: Depending on the material model, these describe reflection properties and the index of refraction. Such parameters can also be relevant in modern PBR shaders, not just in older specular-glossiness workflows.
Opacity and Cutout: Control opacity or cutout areas, such as perforated patterns. Refraction of light through glass also requires a suitable transmission and refraction model.
Emission: Describes self-luminous objects, such as displays. Whether and to what extent it illuminates the surroundings depends on the renderer and its settings.
Ambient Occlusion: Approximates occlusion in recesses and at contact points. It does not replace a full lighting calculation and should not result in double darkening.
When working with image textures, check the scale, alignment, seams, and distortions on the model. A tiling test only shows whether a texture image can be repeated along its edges. It does not replace either inspecting the material under light or comparing it to a reference. Our article on texture baking explains how to prepare texture information.
How do you choose the right shader?
When choosing a shader, the material, intended use, and available references are more important than having the longest possible list of effects. These five points will help you make an informed decision:
1) Material & use case
Upholstery, wood, stone, and metal react differently to light. A coat of paint requires different settings than brushed metal. For real-time applications, the target device and desired frame rate limit the complexity of the materials; for rendered product images, however, the available rendering time is the primary consideration.
A close-up of a modern chair rendered using PBR shaders to achieve realistic material and texture representation in 3D. PBR shaders are essential for physically based rendering.
2) Renderer & Pipeline
A material cannot always be transferred between renderers without modification. Check the supported shaders, texture channels, color spaces, and export formats. The Unreal Engine material basics and the Unity HDRP Lit documentation explain which parameters each application expects.
3) Lighting & brand identity
Evaluate materials under reproducible lighting conditions and then within the intended scene. HDRI environments, area lights, and IES light profiles each serve different purposes. The render engine, color management, and output also influence the result. The visual style emerges from this interplay, not from the shader alone.
4) Performance & scaling
For product variants, reusable materials and traceable versions are helpful. For real-time viewers, you must check supported material channels, texture sizes, and target devices. A glTF or GLB export does not automatically preserve every function of an offline shader.
5) Team & experience
Working with materials involves observation and comparison: In which direction does the weave run? How wide is a reflection? What does the surface look like up close? Our CGI team combines this understanding of the product with the design of lighting, perspective, and branded environments.
Conclusion: What are shaders, and what do I need them for?
Shaders determine how materials are rendered. To create compelling product images, the geometry, textures, lighting, and color management must also be just right. We tailor digital materials to your references and incorporate them into product images, interior scenes, and animations. We’ll determine the necessary requirements based on your product and its intended use.
Two CGI artists from Danthree Studio are working together on photorealistic shaders for a 3D visualization. Shaders play a central role in rendering realistic surfaces in 3D computer graphics.