ShaderX2: Shader Programming Tips & Tricks With Directx 9

Edited by Wolfgang F. Engel

Wordware Publishing, Inc.


e-book shop
ShaderX2:
Shader Programming Tips & Tricks With Directx 9

Preface
After the tremendous success of Direct3D ShaderX: Vertex and Pixel Shader Tips
and Tricks, I planned to do another book with an entirely new set of innovative
ideas, techniques, and algorithms. The call for authors led to many proposals from
nearly 80 people who wanted to contribute to the book. Some of these proposals
featured introductory material and others featured much more advanced themes.
Because of the large amount of material, I decided to split the articles into introductory
pieces that are much longer but explain a lot of groundwork and articles
that assume a certain degree of knowledge. This idea led to two books:
ShaderX2: Introductions & Tutorials with DirectX 9
ShaderX2: Shader Programming Tips & Tricks with DirectX 9
The first book helps the reader get started with shader programming, whereas
the second book (this one) features tips and tricks that an experienced shader
programmer will benefit from.
As with Direct3D ShaderX, Javier Izquierdo Villagrán (nurbs1@jazzfree.com)
prepared the drafts for the cover design of both books with in-game screen shots
from Aquanox 2, which were contributed by Ingo Frick, the technical director of
Massive Development.
A number of people have enthusiastically contributed to both books:
Wessam Bahnassi
Andre Chen
Muhammad Haggag
Kenneth L. Hurley
Eran Kampf
Brian Peltonen
Mark Wang
Additionally, the following ShaderX2 authors proofread several articles each:
Dean Calver
Nicolas Capens
Tom Forsyth
Shawn Hargreaves
Jeffrey Kiel
Hun Yen Kwoon
Markus Nuebel
Michal Valient
Oliver Weichhold
These great people spent a lot of time proofreading articles, proposing improvements,
and exchanging e-mails with other authors and myself. Their support was
essential to the book development process, and their work led to the high quality
of the books. Thank you!
Another big thank you goes to the people in the Microsoft Direct3D discussion
group (http://DISCUSS.MICROSOFT.COM/archives/DIRECTXDEV.html).
They were very helpful in answering my numerous questions.
As with Direct3D ShaderX, there were some driving spirits who encouraged
me to start this project and hold on through the seven months it took to complete it:
Dean Calver (Eclipse)
Jason L. Mitchell (ATI Research)
Natasha Tatarchuk (ATI Research)
Nicolas Thibieroz (PowerVR)
Carsten Wenzel (Crytek)
Additionally, I have to thank Thomas Rued from DigitalArts for inviting me to the
Vision Days in Copenhagen, Denmark, and for the great time I had there. I would
like to thank Matthias Wloka and Randima Fernando from nVidia for lunch at GDC
2003. I had a great time.
As usual, the great team at Wordware made the whole project happen: Jim
Hill, Wes Beckwith, Heather Hill, Beth Kohler, and Paula Price took over after I
sent them hundreds of megabytes of data.
There were other numerous people involved in this book project that I have
not mentioned. I would like to thank them here. It was a pleasure working with so
many talented people.
Special thanks goes to my wife, Katja, and our daughter, Anna, who spent a
lot of evenings and weekends during the last seven months without me, and to
my parents, who always helped me to believe in my strength.
—Wolfgang F. Engel

P.S.: Plans for an upcoming project named ShaderX3 are already in progress. Any

comments, proposals, and suggestions are highly welcome (wolf@shaderx.com).


About the Authors

Dan Amerson 
Dan graduated from North Carolina State University in 2001 with a bachelor’s
degree in computer science. During his undergraduate studies, he focused on artificial
intelligence research for automated camera control and positioning. After
graduation, Dan joined NDL in late 2001 to work on the NetImmerse and Gamebryo
engines. He works primarily on console rendering technologies and most
recently served as lead programmer for the Gamebryo shader demo Eturnum.

Marwan Y. Ansari (mansari@ati.com
Marwan is a member of the 3D Application Research Group at ATI Research. 
He received a master’s degree in computer science from the University of Illinois at
Chicago and a bachelor of science degree in computer science and mathematics
from DePaul University. Prior to moving to ATI’s 3D Application Research Group,
he worked on OpenGL drivers for Number Nine Visual Technology before joining
ATI’s Digital TV group. In addition to his image space contributions to ShaderX2,
Marwan has also contributed to Game Programming Gems 4 and spoken about
real-time video processing using shaders at the Game Developers Conference.

Kristof Beets (kristof.beets@powervr.com
Kristof took his first steps in the 3D world by running a technical 3D fan site,
 covering topics such as the differences between traditional and tile-based rendering
technologies. This influenced his electrical engineering studies in such a way that
he wrote his thesis about wavelet compression for textures in Direct3D, a paper
that won the Belgian Barco Prize. He continued his studies, obtaining a master’s
degree in artificial intelligence, while working as a technical editor for Beyond3D
and writing various technical articles about 3D hardware, effects, and technology.
As a freelance writer he wrote the “FSAA Explained” document for 3Dfx Interactive
to explain the differences between various types of full-screen anti-aliasing.
This document resulted in a full-time job offer at 3Dfx. Currently he is working as
a developer relations engineer for PowerVR Technologies, which includes
research into new graphical algorithms and techniques.

Flavien Brebion (f.brebion@vrcontext.com
Flavien has had a passion for video games since he got an Amstrad CPC at the age of 12. He still remembers typing in hundred-page listings just to see a small sprite appear on-screen. He studied computing science at the University of Nantes,
France, where he graduated with both bachelor’s and master’s degrees in 2000.
He has also done a lot of research and developed many small games and rendering
engines on his own. Currently he works at VRcontext, a virtual reality company
in Brussels, where he develops software designed to display industrial models
made up of millions of triangles. He works on amateur games and graphical
demos in his spare time, trying to get the most out of the new, powerful video

Chris Brennan (cbrennan@ati.com
Chris graduated with bachelor’s degrees in computer science 
and electrical engineering from Worcester Polytechnic Institute in 1997 and joined Digital Equipment
Corp.’s Workstation Graphics group doing hardware design and verification.
When Digital died, Chris joined ATI as a 3D ASIC designer for the Radeon line of
graphics chips and then moved over to the 3D Application Research Group where
he tries to get those chips to do things that were not originally thought possible.

Kevin Buchin 
Kevin received his master’s degree from Hasso Plattner Institute for Software
Engineering in Potsdam, Germany, in 2003. He wrote his thesis on real-time
non-photorealistic terrain rendering. He has studied math, logic, and computer
science in Muenster, Germany, and Leeds, England, and is involved in the 3D
rendering engine VRS (www.vrs3d.org
and the 3D-map software system LandExplorer (www.landex.de).

Aaron Burton (aaron.burton@powervr.com)
Aaron has been a developer relations engineer at PowerVR Technologies since he
received his Honours degree in information systems engineering in 1998. His
first computer was a VIC 20, though his fascination for 3D graphics began with
the Atari ST. At PowerVR he has been able to indulge this interest by developing
a variety of demos, benchmarks, and debug/performance tools, and supporting
developers in creating faster and better games. When he’s not climbing, he
spends his spare time working on ray-tracing and real-time 3D demos.

Dean Calver
Games are fun! Dean figured that out at age 2 and has spent the ensuing years
working on how to make better games. For the last seven years, people have even
paid him to do it. Having no real preference for console or PC has meant a mixed
career switching between them for every project. Professionally, he has worked
on a war game, racing games, an X-COM style game, arcade classic updates and
the port of Silent Hill 2 to the PC. 
He is currently working on an Xbox RPG called Sudeki at Climax Solent.

Nicolas Capens (sw-shader.sourceforge.net)
Nicolas is a master’s student in civil engineering in computer science in Ghent,
Belgium. He became interested in graphics programming after discovering some
Quake mods, and he quickly learned C++ and x86 assembly by himself. His main
interest is software rendering and optimization. For more than two years he has
been developing his own software renderer in his spare time. He is currently
focusing on implementing shader emulation using the MMX and SSE instruction
sets and dynamic code generation.

Francesco Carucci
Francesco has been a professional game programmer for three years and
currently works on Black&White 2 for Lionhead Studios. He studied graphics
programming-related subjects at university for five years before that. His passion
for video games and 3D graphics help him spend many sleepless nights after long
days of writing shader code.

Roger Descheneaux
Roger has been working on 3D graphics since the late 1980s, and he has a vaguely
uncomfortable feeling that he should somehow be better at it by now. In 1991 he
graduated to working on 3D graphics device drivers for IBM. The first driver he
worked on was for a five-card graphics solution that sold for $30,000 and couldn’t
do texture mapping. The graphics hardware is slightly faster and somewhat
cheaper these days. He currently works on OpenGL device drivers for ATI
Research in Marlborough, Massachusetts, for graphics chips that can definitely
do texture mapping.

Sim Dietrich
Sim manages the U.S. Technical Developer Relations team at nVidia Corporation.
Sim has written chapters for Game Programming Gems 1 and 2 and served as editor
of the Graphics Display section of Gems 2. He was a key contributor to the
CgFX effort, bringing real-time shaders to Max, Maya, and SoftImage for the first
time. Sim’s interests include new shadow techniques and improving graphics
workflow through efforts like Cg and CgFX.

Wolfgang F. Engel (wolfgang.engel@shaderx.com)
Wolfgang is the editor of ShaderX2: Introductions & Tutorials with DirectX 9, the
editor and a co-author of Direct3D ShaderX: Vertex and Pixel Shader Tips and
Tricks, the author of Beginning Direct3D Game Programming, and a co-author of
OS/2 in Team, for which he contributed the introductory chapters on OpenGL and
DIVE. He spoke at GDC 2003 and at Vision Days 2003 in Copenhagen, Denmark.
He has published articles in German journals and on www.gamedev.net,
www.gamasutra.com, and his own web site, www.direct3d.net. During his career
in the game industry he built up two small game development units.

Tom Forsyth (tomf@muckyfoot.com)
Tom has been obsessed by 3D graphics since seeing Elite on his ZX Spectrum.
Since then he has always tried to make hardware beg for mercy. Tom has written
triangle-drawing routines on the Spectrum, Sinclair QL, Atari ST, Sega 32X, Saturn,
Dreamcast, PC, GamePark32, and Xbox, and he’s getting quite good at them
now. Tom’s coding past includes writing curved-surface stuff for Sega and graphics
drivers for 3Dlabs. Currently he works in Guildford, England, at Mucky Foot
Productions, where past projects include Urban Chaos, StarTopia, and Blade2.

Eli Z. Gottlieb
Eli is a self-taught programmer attending ninth grade at Bethlehem Central High
School in Delmar, New York.

Matthew Halpin
Matthew started programming before he was 10 and has continued to hold an
interest in the areas of graphics and physics. Starting with 2D vector and sprite
rendering, he quickly moved onto software 3D rendering and later 3D hardware
accelerated rendering combined with rigid body and particle physics systems. He
has been working in the games industry since receiving a BA in computer science
from Cambridge University.

Shawn Hargreaves
After finishing a degree in music, Shawn has been writing games for the last six
years, most recently as lead programmer on Climax’s MotoGP bike racing game.
Having started out coding 2D graphics by hand in DOS (where he created the
then spending time on the N64 and PS2, he is still in awe of the sorts of things
that are possible with programmable shaders on Xbox and modern PC cards.

Evan Hart
Evan is a software engineer with ATI’s Application Research Group where he
works on technology evangelism and adoption. He is a graduate of Ohio State University.

O’dell Hicks
O’dell has been a professional game programmer since 1998 and a hobbyist several
years longer than that. He has done work on both the PC and Xbox. One day
he hopes to finish a game that he is working on by himself in his spare time. His
web site can be found at http://odellworld.com/.

Oliver Hoeller
Oliver currently works as senior engine programmer at Piranha Bytes, which
developed the RPGs Gothic I and II. He started programming at age 10 on his
Commodore VIC20, working his way through 6502(VIC20), 6510(C64), and
68000(Amiga) Assembler. His first game project was with 15, a jump and run
game named Platou (Kingsoft, C64). He was an active member of the German
demo scene in the ’80s and early ’90s. After a detour—during which he developed
music software, created a security program, and worked as a consultant for
web services—Oliver returned to his roots and developed his first 3D engine
(Warrior Engine, 1995-98). He was lead programmer and director of development
at H2Labs/Codecult and was responsible for development of the Codecreatures game system.

Takashi Imagire
Takashi has been a professional game programmer for five years, mainly working
with the PlayStation and PlayStation2. Currently, he is programming real-time 3D
graphics in his spare time, while focusing on the newest shader technology. A
number of articles and demos on shader programming can be found on his web
site at http://www.t-pot.com/. His goal is to publish his demos immediately after
the release of new shader technology.

John Isidoro
John is a member of the 3D Application Research Group at ATI Technologies and
a graduate student at Boston University. His research interests are in the areas of
real-time graphics, image-based rendering, and machine vision.

Greg James
Greg is a software engineer with nVidia’s technical developer relations group
where he develops tools and demos for real-time 3D graphics. Prior to this, he
worked for a small game company and as a research assistant in a high-energy
physics laboratory. He is very glad to have avoided graduate school, and even happier
to be working in computer graphics, which he picked up as a hobby after his
father brought home a strange beige Amiga 1000.

Jeffrey Kiel
Jeff started his work in graphics as an undergrad at the University of North
Carolina doing volume rendering research. After a stint in the corporate world, he
moved on to work at Interactive Magic as a lead programmer on Destiny (one of
the first 3D strategy games), iF18, and WarBirds. Then he joined Sinister Games
to work on Shadow Company (3D squad-based strategy game) and the Dukes of
Hazzard I and II on PS1. Jeff returned to his passion for graphics by joining nVidia,
where he has worked on a couple of 3D engines, incorporating shader technology
into real-world applications. His shader experience covers standard transform/
lighting/shading, special effects, mesh animation, and particle systems.

Shaun Kime
Shaun is a software engineer at NDL where he is the lead developer on the 3ds
max tools pipeline. Prior to working at NDL, he worked on the Mimesis project at
North Carolina State University doing research on integrating narrative planning
into virtual worlds. When he isn’t at work, he can be found reviewing local pubs at

Jakub Klarowicz
Jakub is an engine programmer at Techland where he works on all low-level
aspects of game engine development. His biggest interest is, of course, real-time
3D graphics. He received an MS in computer science from Wroclaw University of
Technology in 2001, and has been programming computers since he was 10. Jakub
always wanted to push hardware to its limits so he started learning assembler
while his friends were still playing games. In his work with 3D graphics, Jakub has
gone all the way from software rendering to shader programming. He has been
playing with hardware-accelerated rendering for five years, using Glide, OpenGL,
and Direct3D. For the last three years he has worked with 3D graphics professionally.

Jesse Laeuchli
Jesse is a self-taught programmer who now makes his home in Budapest, Hungary.
As the child of a Foreign Service officer, he has lived in such places as China,
Taiwan, Africa, and Saudi Arabia. He has written for several computer magazines,
books, and web sites, and is also an avid epee fencer. His web site is www.laeuchli.com/jesse/.

Sylvain Lefebvre
Sylvain is a Ph.D. student in the iMAGIS team at the French National Institute
for Research in Computer Science, working on the rendering of natural scenes.
He is also interested in many aspects of game programming and real-time graphics.
He is currently focusing on developing new approaches with vertex and pixel
shaders to handle the complexity of natural scenes. His home page is at http://www.aracknea.net.

Jean-Sebastian Luce
Jean-Sebastian has been a professional game programmer specializing in computer
graphics for three years in the Nadeo studio where he worked on the games
Virtual Skipper 1 and 2. He is currently working on improving their graphic
engine quality by using more complex shaders for the recent games TrackMania
and Virtual Skipper3. He has also studied applied mathematics, computer science,
and image synthesis in a French National Institute (ENSIMAG).

Dean Macri
Dean is a software engineer with Intel Corporation where he works with software
developers in optimizing the processor-specific aspects of their titles. He wrote
his first graphics application, a line and circle drawing program, in TMS9900
assembly language in 1984 on a Texas Instruments 99/4A. Since then he’s been
hooked on graphics and programming, majoring in computer science as both an
undergraduate and a graduate student. Starting in 1992, he spent five years developing
high-speed assembly routines for 2D graphics transition effects at a multimedia
kiosk development company. In 1998 he joined Intel where he continues to
evangelize the benefits of new processors and technologies to software developers
and provide their feedback to the processor architects.

Jason L. Mitchell (JasonM@ati.com)
Jason is the team lead of the 3D Application Research Group at ATI Research,
makers of the Radeon family of graphics processors. Jason has worked with
Microsoft on the Microsoft campus in Redmond for several years to define key
new Direct3D features. Prior to working at ATI, Jason did work in human eye
tracking for human interface applications at the University of Cincinnati, where he
received his master’s degree in electrical engineering in 1996. He received a
bachelor’s degree in computer engineering from Case Western Reserve University
in 1994. In addition to this book’s article on advanced image processing, Jason
wrote about HLSL programming in ShaderX2: Shader Programming Tips & Tricks
with DirectX 9, and has written for the Game Programming Gems books, Game
Developer magazine, Gamasutra.com, and academic publications on graphics and
image processing. He regularly presents at graphics and game development conferences
around the world. His home page can be found at http://www.pixelmaven.com/jason/.

Ádám Moravánszky
Ádám is a recent graduate of the Swiss Federal Institute of Technology. After finishing
his thesis in the field of real-time 3D graphics, he co-founded NovodeX
(www.novodex.com), a company providing game physics middleware, where he is
the chief software architect.

Christopher Oat
Christopher is a software engineer in the 3D Application Research Group at ATI,
where he explores novel rendering techniques for real-time 3D graphics applications.
His focus is on pixel and vertex shader development for current and future
graphics platforms. Christopher has contributed as an original member of the
RenderMonkey development team and as a shader programmer for ATI’s demos
and screen savers. He has been published in Game Programming Gems 3 (Charles
River Media, 2002) and Direct3D ShaderX: Vertex and Pixel Shader Tips and Tricks
(Wordware, 2002). Christopher is a graduate of Boston University.

David Pangerl
David’s addiction to computers and games started early in his life, and the vision
to create virtual worlds continues to be a strong force in his life. He has been
involved in the production of several games, including Crash, Casanova, Hitchcock,
Hannibal, and most recently Mistmare. His main interests are computer
graphics, artificial intelligence, and compilers.

Kurt Pelzer
As a senior programmer at Codecult, Kurt developed several real-time simulations
and technology demos built on CC’s high-end 3D engine Codecreatures
(e.g., a launch demo for nVidia’s GeForce4 Ti generation and the well-known
Codecreatures-Benchmark-Pro). He designed the innovative fx systems of
Codecreatures and was involved in creating a simulation of the Shanghai
TRANSRAPID track for SIEMENS AG. Kurt also worked on Piranha Bytes’ PC
game Gothic and the top-selling Gothic II—which were named RPG of the Year in
Germany in 2001 and 2002. In prehistoric times Kurt started programming on
C64 and Atari’s ST; later on he studied mathematics, always focusing on computer
graphics. When he’s not scribbling down equations or reading the book of
seven seals, Kurt works at Piranha Bytes to guarantee a high level of visual quality
for the company’s future products.

Emil Persson
Emil recently graduated from Luleå University of Technology in Northern Sweden
after studying computer science and engineering. Over the years Emil has
gathered experience from early software rendering attempts to advanced techniques
in the Glide, OpenGL, and Direct3D APIs. His web site at http://esprit.campus.luth.se/~humus/ focuses on real-time 3D graphics. In the future you’ll
probably find Emil working as a game developer working on the next generation of game engines.

Tim Preston
Tim is a software engineer working on the Direct3D sections of the Gamebryo
game engine at NDL. He graduated from Princeton University in 1997 with a
degree in chemistry and a desire to do pretty much anything but chemistry. He
went to the University of North Carolina for a master’s in computer science,
where he did a lot of molecular modeling work that led to an interest in 3D graphics.
When he graduated in 1999, the game industry was a good match for his experience
and his goal of not doing anything too important.

Maurice Ribble
Maurice graduated in 2001 from the Milwaukee School of Engineering with a
bachelor’s degree in computer engineering. During his junior year he had the
opportunity to take part in a summer internship at Los Alamos National Labs. He
was somewhat disappointed that other people worked on million-dollar workstations
while he worked on consumer-level hardware, but after writing an application
that performed lighting calculations for volume textures on first-generation
consumer fragment shader hardware, he realized that consumer-level hardware
was in for exciting changes, and he wanted to be part of the action. He currently
works on the OpenGL device driver team at ATI Research.

Guennadi Riguer
Guennadi is a software developer at ATI Technologies, where he is helping game
engine developers to adopt new graphics technologies. Guennadi holds a degree
in computer science from York University and previously studied at Belorussian
State University of Computing and Electronics. He began programming in the
mid-80s and worked on a wide variety of software development projects prior to joining ATI.

Thomas Rued (rued@digitalarts.dk)
Thomas started his programming career at the local mall in 1983, doing small
graphics programs in BASIC until an angry salesperson turned the computer off
and he had to start all over. Later he programmed multimedia programs for
InterVision in assembler and Pascal. Then he decided that education was in order
and earned a degree in computer science. He moved on to Interactive Vision for
several years, where he was a senior software engineer and worked on 3D applications
plus the in-house frameworks for game development using C++ and
DirectX. Currently Thomas works at Digital Arts (www.digitalarts.dk) where he
focuses on high-end 3D visualization stuff in real time using modern 3D hardware.
In his spare time he is the co-coordinator of the Danish IGDA chapter.

Scott Sherman
Scott is a software engineer at NDL where he is the lead on the Xbox version of
their graphics engine. After receiving degrees in physics and electrical engineering,
a short stint in the hardware side of the computer industry led to doing on-air
statistics and scoring systems programming for sporting event broadcasts. Once
the excitement of live television wore off, he moved over to the field of game programming,
and is currently focused on real-time 3D graphics.

Peter-Pike Sloan
Peter-Pike currently works on D3DX at Microsoft. Prior to that he worked in the
Microsoft Research Graphics Group, the Scientific Computing and Imaging group
at the University of Utah, PTC, and Evans & Sutherland. His primary research
interests revolve around interactive graphics techniques. Most of his publications

Like just about everyone else, Marco started programming way back on a C64.
After buying a PC just so he could play Doom, he learned about computer graphics.
He started his professional career as an engine programmer at Codecult Software,
working on the Codecreatures Game Development System and the
Codecreatures Benchmark Pro. After receiving his diploma in computer science,
and a short walk on the wild side as a freelance software developer, he’s now
working in the training and simulation department at Munich-based Krauss-Maffei Wegmann.

Natalya Tatarchuk (Natasha@ati.com)
Natalya is a software engineer working in the 3D Application Research Group at
ATI Research, where she is the programming lead for the RenderMonkey IDE
project. She has worked in the graphics industry for more than six years, working
on 3D modeling applications and scientific visualization prior to joining ATI.
Natalya graduated from Boston University with a bachelor’s degree in computer
science, a bachelor’s degree in mathematics, and a minor in visual arts.

Nicolas Thibieroz (nicolas.thibieroz@powervr.com)
Like many kids of his generation, Nicolas discovered video games on the Atari
VCS 2600. He quickly became fascinated by the mechanics behind those games,
and started programming on C64 and Amstrad CPC before moving on to the PC
world. Nicolas realized the potential of real-time 3D graphics while playing Ultima
Underworld. This game inspired him in such a way that both his school placement
and final year project were based on 3D computer graphics. After obtaining a
bachelor’s degree in electronic engineering in 1996, he joined PowerVR Technologies
where he is now responsible for developer relations. His duties include supporting
game developers, writing test programs and demos, and generally keeping
up to date with the latest 3D technology.

Alex Vlachos (http://alex.vlachos.com)
Alex is a staff engineer in the 3D Application Research Group at ATI, where he
has worked since 1998 focusing on 3D engine development as the lead programmer
for ATI’s Demo Team. He developed N-Patches (a curved surface representation
introduced in Microsoft’s DirectX 8), also known as PN Triangles, and
TRUFORM. He has published in Game Programming Gems 1, 2, and 3, ACM
Symposium on Interactive 3D Graphics (I3DG), and Direct3D ShaderX: Vertex and
Pixel Shader Tips and Tricks. He has presented at Microsoft Meltdown Seattle and
UK, I3DG, GDC, and GDC Europe. Alex is a graduate of Boston University.

Daniel Wagner (daniel@ims.tuwien.ac.at)
Daniel has been fascinated by programming computer graphics since he got his
first PC in 1991. In 1995 he developed the software SimLinz for the Ars
Electronica Center (museum of the future) in Linz, Austria. During his study he
worked for Reality2, a company that created virtual reality software. After finishing
his master’s thesis, “EndoView: A System for Fast Virtual Endoscopic Rendering
and Registration” in summer 2001, he worked as a lead developer for
BinaryBee, a company developing arcade-style web games. Daniel is currently
working on his Ph.D. thesis on augmented reality at the Interactive Media Systems
Group at the Vienna University of Technology.

Arkadiusz Waliszewski
Arkadiusz holds a master’s degree in computer science from Poznan University of
Technology and is currently a software engineer in Poland. He started his adventure
with computer graphics when he got his first computer (Atari 65XE) and has
become addicted. Beside real-time computer graphics, he is also interested in
object-oriented programming and design. He likes good movies, dry wine, and big fluffy carpet slippers.

Maike Walther
Maike’s research interests lie in computational and cognitive aspects of computer
depiction. She has studied mathematics, logic, computer science, and psychology
at the universities of Muenster, Germany, and Leeds, England. Maike graduated
in 2003 from the Hasso Plattner Institute in Potsdam, Germany after writing her
master’s thesis on computer graphics and algorithms for real-time non-photorealistic
rendering of 3D city models. She is currently developing for the Virtual
Rendering System (www.vrs3d.org).

Oliver Weichhold
Oliver has been a programmer and developer on a number of projects, including a
software implementation of the Direct3D pipeline.

Carsten Wenzel (carsten@crytek.de)
Carsten has been passionate about computer graphics ever since he got a hold of
intros and demos for Amiga and PC. Although he’s never really been active in the
demo scene, it’s always been a big inspiration for him. As a 3D programmer at
Totally Games, he developed many of the pixel and vertex shaders used for special
effects in an Xbox game. At that time he also wrote a tech demo for nVidia’s
GeForce3. His latest demo, Meshuggah, was released in spring 2002, and he
received his master’s degree in computer science in December 2002. He currently works at Crytek.

Guillaume Werle (guille@free.fr)
Guillaume is a 26-year-old graphic engineer at Montecristo (www.montecristogames.com). 
He joined the R&D department team last year where he is working
on the next-generation 3D engine. In the game industry since 1998, he has done
two PlayStation games for Infogrames and one PC game for Montecristo. Despite
the little spare time he has, he is still an active demoscener (http://cocoon.planetd.net). His last demo, Raw Confessions, was nominated for the Demoscene
Awards (http://awards.scene.org/) in the “Best Demo” category and won the “Best Graphics” award.

Renaldas Zioma
Renald Zioma has been driven (mad) by computer graphics since he saw ZX
Spectrum. After learning assembly and writing a Tetris clone for his ZX, he
switched to PCs, finished school, wrote a couple of small non-commercial games,
gained experience with object-oriented programming and design while working at
a software development company, and received a bachelor’s degree in computer
science from Kaunas University of Technology. He has been working as a professional
game programmer for the last two years. Recently he finished a demo of a
3D fighting game based on real-time motion recognition for Interamotion, LLC. In
his spare time, he programs demos and games and organizes small demo/game
scene related events in Lithuania.


Screenshot

e-books shop

Purchase Now !
Just with Paypal



Product details
 Price
 File Size
 15,315 KB
 Pages
 729 p
 File Type
 PDF format
 ISBN
 1-55622-988-7
 Copyright
 2004, Wordware Publishing, Inc


Table of Contents
Preface vii
About the Authors ix
Introduction xix
Section I—Geometry Manipulation Tricks
Using Vertex Shaders for Geometry Compression 3
Dean Calver
Using Lookup Tables in Vertex Shaders 13
Carsten Wenzel
Terrain Geomorphing in the Vertex Shader 18
Daniel Wagner
3D Planets on the GPU 33
Jesse Laeuchli
Cloth Animation with Pixel and Vertex Shader 3.0 40
Kristof Beets
Collision Shaders 58
Takashi Imagire
Displacement Mapping 73
Tom Forsyth
Section II — Rendering Techniques
Rendering Objects as Thick Volumes 89
Greg James
Screen-aligned Particles with Minimal VertexBuffer Locking 107
O’dell Hicks
Hemisphere Lighting with Radiosity Maps 113
Shawn Hargreaves
Galaxy Textures 123
Jesse Laeuchli
Turbulent Sun 127
Jesse Laeuchli
Fragment-level Phong Illumination 131
Emil Persson
Specular Bump Mapping on Pre-ps_1_4 Hardware 149
Matthew Halpin
Voxel Rendering with PS_3_0 161
Aaron Burton
Simulating Blending Operations on Floating-point Render Targets 172
Francesco Carucci
Rendering Volumes in a Vertex & Pixel Program by Ray Tracing 177
Eli Z. Gottlieb
Normal Map Compression 185
Jakub Klarowicz
Drops of Water and Texture Sprites 190
Sylvain Lefebvre
Advanced Water Effects 207
Kurt Pelzer
Efficient Evaluation of Irradiance Environment Maps 226
Peter-Pike J. Sloan
Practical Precomputed Radiance Transfer 232
Peter-Pike J. Sloan
Advanced Sky Dome Rendering 240
Marco Spoerl and Kurt Pelzer
Deferred Shading with Multiple Render Targets 251
Nicolas Thibieroz
Meshuggah’s Effects Explained 270
Carsten Wenzel
Layered Car Paint Shader 293
John Isidoro, Chris Oat, and Natalya Tatarchuk
Motion Blur Using Geometry and Shading Distortion 299
Natalya Tatarchuk, Chris Brennan, Alex Vlachos, and John Isidoro
Simulation of Iridescence and Translucency on Thin Surfaces 309
Natalya Tatarchuk and Chris Brennan
Floating-point Cube Maps 319
Arkadiusz Waliszewski
Stereoscopic Rendering in Hardware Using Shaders 324
Thomas Rued
Hatching, Stroke Styles, and Pointillism 340
Kevin Buchin and Maike Walther
Layered Fog 348
Guillaume Werle
Dense Matrix Algebra on the GPU 352
Ádám Moravánszky
Section III — Software Shaders and Shader Programming Tips
Software Vertex Shader Processing 383
Dean P. Macri
x86 Shaders–ps_2_0 Shaders in Software 396
Nicolas Capens
SoftD3D: A Software-only Implementation of Microsoft’s Direct3D API 413
Oliver Weichhold
Named Constants in Shader Development 432
Jeffrey Kiel
Section IV — Image Space
Advanced Image Processing with DirectX 9 Pixel Shaders 439
Jason L. Mitchell, Marwan Y. Ansari, and Evan Hart
Night Vision: Frame Buffer Post-processing with ps.1.1 Hardware 465
Guillaume Werle
Non-Photorealistic Post-processing Filters in MotoGP 2 469
Shawn Hargreaves
Image Effects with DirectX 9 Pixel Shaders 481
Marwan Y. Ansari
Using Pixel Shaders to Implement a Mosaic Effect Using Character Glyphs 519
Roger Descheneaux and Maurice Ribble
Mandelbrot Set Rendering 526
Emil Persson
Real-Time Depth of Field Simulation 529
Guennadi Riguer, Natalya Tatarchuk, and John Isidoro
Section V — Shadows
Soft Shadows 559
Flavien Brebion
Robust Object ID Shadows 580
Sim Dietrich
Reverse Extruded Shadow Volumes 587
Renaldas Zioma
Section VI — 3D Engine and Tools Design
Shader Abstraction 597
Tom Forsyth
Post-Process Fun with Effects Buffers 614
Tom Forsyth
Shaders under Control (Codecreatures Engine) 625
Oliver Hoeller
Shader Integration in the Gamebryo Graphics Engine 631
Scott Sherman, Dan Amerson, Shaun Kime, and Tim Preston
Vertex Shader Compiler 650
David Pangerl
Shader Disassembler 667
Jean-Sebastian Luce
Index 675
Contents
vi













  ●▬▬▬▬▬❂❂❂▬▬▬▬▬●
●▬▬❂❂▬▬●
●▬❂▬●

═════ ═════

Previous Post Next Post