PacktLib: 3D Graphics with XNA Game Studio 4.0

3D Graphics with XNA Game Studio 4.0

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Getting Started with 3D

Setting up a new project

The 3D coordinate system

Matrices

Loading a model

Drawing a model

Creating a Custom Model class

Creating a Camera class

Calculating bounding spheres for models

View frustum culling

Additional camera types: Arc-Ball

Additional camera types: chase camera

Example—spaceship simulator

Summary

Introduction to HLSL

Getting started

Assigning a shader to a model

Creating a simple effect

Texture mapping

Texture sampling

Diffuse colors

Ambient lighting

Lambertian directional lighting

Phong specular highlights

Creating a Material class to store effect parameters

Summary

Advanced Lighting

Implementing a point light with HLSL

Implementing a spot light with HLSL

Drawing multiple lights

Prelighting

Storing depth and normal values

Creating the light map

Drawing models with the light map

Creating the prelighting renderer

Using the prelighting renderer

Summary

Projection and Shadowing Effects

Projective texturing

Shadow mapping—drawing the depth map

Variance shadow mapping—soft shadows

Variance shadow mapping—generating shadows

Summary

Shader Effects

Fog

Normal mapping

Generating normal maps with Photoshop

Cube mapping: Making a sky sphere

Cube mapping: Reflections

Rendering sky boxes with Terragen

Creating a reflective water effect

Summary

Billboard and Particle Effects

Creating the BillboardSystem class

Drawing Billboards

Creating clouds with spherical billboarding

Non-rotating billboards

Particle effects

Particle fire

Particle smoke

Summary

Environmental Effects

Building a terrain from a heightmap

Multitexturing

Adding a detail texture to the terrain

Placing plants on the terrain

Adding the finishing touches

Summary

Advanced Materials and Post Processing

Advanced Materials

Post processing

Black and white post processor

Gaussian blur post processor

Depth of field

Glow post processor

Summary

Animation

Object animation

Keyframed animation

Curve interpolation

Building a Race Track from a Curve

Moving a car along the track

Hierarchical animation

Skinned animation

Loading a skinned model

Playing a skinned animation

Changing an animation's play speed

Model attachments

Summary

Index