Xbox LIVE Indie Games

code sample details

Non-Realistic Rendering

Code Sample

Description:

This sample shows how to implement stylized, non-photorealistic rendering techniques, such as cartoon shading, edge detection, and a pencil sketch effect.

Sample Overview

The sample provides three specialized rendering techniques.

  1. Toon shading displays models using a banded lighting technique. Rather than the usual smooth gradients from light to dark, it uses just three discrete levels of brightness, with sudden transitions where the object goes from light into shadow.
  2. Edge detection adds black lines around the silhouette of the model.
  3. The sketch postprocess adds a pencil stroke pattern over the top of the scene.

Many graphical effects can be achieved by combining these techniques in various ways. For instance, a cartoon effect is created by using the toon shading and edge detection together, or a pencil sketch effect by combining edge detection with the sketch postprocess.



All content and source code downloaded from this page are bound to the Microsoft Permissive License (Ms-PL).

downloads

Framework

GS 4.0

Framework

GS 3.1

find education content
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG