---
title: "Enhancing Your Model's Visual Quality - Shading and Edges"
canonical: "https://help.twinfinity.com/space/HCFD/141099037/Enhancing%20Your%20Model's%20Visual%20Quality%20-%20Shading%20and%20Edges"
format: markdown
---
Looking to give your model a visual upgrade in the Twinfinity viewer? You're in the right place.
This section shares practical techniques that can significantly improve your model's visual appeal —
from simple tweaks to more advanced strategies — so you can add that extra touch of finesse to your
3D models.

## Applying contact shadows and outlines

A common problem when rendering models is that they can look a little flat and lifeless. This is
usually down to ambient lighting and the lack of shadows, which makes it hard to tell objects and
object edges apart. A quick way to fix this and improve the look and feel of a rendered model is to
enable SSAO and line shading.

SSAO stands for Screen Space Ambient Occlusion. It's a popular rendering technique used in 3D
computer graphics to add more realistic lighting and shading to a scene. SSAO simulates ambient
light being blocked by nearby objects, producing darker, more shadowed areas and creating contact
shadows between objects.

Line shading is a technique that highlights the edges of an object, making it easier for the eye to
understand what's being rendered.

**Before** — flat ambient lighting, hard to read object edges:

![Model rendered without SSAO or line shading](media://2d6445b5-fa28-4c0f-ac90-8fda6f189b5a)

**After** — SSAO contact shadows plus line shading on the edges:

![Model rendered with SSAO and line shading](media://04b42359-87ac-4bc0-978a-d755ee1fb7b9)

Together, these two techniques really improve the perceived visual quality.

### Setting up the pipelines

Both effects are post-process pipelines that you create and then attach as camera behaviours. Note
that these techniques do have an impact on performance.

```ts
import { BimApi, PostProcessEffects } from '@twinfinity/core';

// Line shading outlines object edges so the eye can read the geometry.
const lineShadingPipeline = PostProcessEffects.createLineShading(0.3, true);

// SSAO adds subtle contact shadows, introducing depth that makes the
// rendering look a lot better.
const ssaoPipeline = PostProcessEffects.createSSAOPipeline(16, 0.1, 16, 0.85, 1);

// The effects only take hold once attached as camera behaviours.
api.camera.attachBehavior(lineShadingPipeline);
api.camera.attachBehavior(ssaoPipeline);
```

See it in the playground: [SSAO and line shading](https://playground.twinfinity.dev/?pgId=visual-quality/ssao-and-lineshader).