Free Sample
+ Collection

3D Graphics with XNA Game Studio 4.0

Sean James

A step-by-step guide to adding the 3D graphics effects used by professionals to your XNA games.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849690041
Paperback292 pages

About This Book

  • Improve the appearance of your games by implementing the same techniques used by professionals in the game industry
  • Learn the fundamentals of 3D graphics, including common 3D math and the graphics pipeline
  • Create an extensible system to draw 3D models and other effects, and learn the skills to create your own effects and animate them


Who This Book Is For

This book is mainly written for those who are familiar with object oriented programming and C# and who are interested in taking 3D graphics of their XNA games to the next level. This book will be useful as learning material for those who are new to graphics and for those who are looking to expand their toolset. Also, it can be used by game developers looking for an implementation guide or reference for effects or techniques they are already familiar with.

Table of Contents

Chapter 1: Getting Started with 3D
Setting up a new project
The 3D coordinate system
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
Chapter 2: 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
Chapter 3: Advanced Lighting
Implementing a point light with HLSL
Implementing a spot light with HLSL
Drawing multiple lights
Storing depth and normal values
Creating the light map
Drawing models with the light map
Creating the prelighting renderer
Using the prelighting renderer
Chapter 4: Projection and Shadowing Effects
Projective texturing
Shadow mapping—drawing the depth map
Variance shadow mapping—soft shadows
Variance shadow mapping—generating shadows
Chapter 5: Shader Effects
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
Chapter 6: Billboard and Particle Effects
Creating the BillboardSystem class
Drawing Billboards
Creating clouds with spherical billboarding
Non-rotating billboards
Particle effects
Particle fire
Particle smoke
Chapter 7: Environmental Effects
Building a terrain from a heightmap
Adding a detail texture to the terrain
Placing plants on the terrain
Adding the finishing touches
Chapter 8: Advanced Materials and Post Processing
Advanced Materials
Post processing
Black and white post processor
Gaussian blur post processor
Depth of field
Glow post processor
Chapter 9: 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

What You Will Learn

  • Understand the fundamentals of 3D graphics and math.
  • Create a flexible framework for building games
  • Learn how to implement some of the most common and uncommon graphics techniques such as lighting and animation, using the XNA Framework.
  • Work with HLSL and shaders.
  • Create an architecture rendering and creating special effects.
  • Improve your games with optimization techniques.

In Detail

XNA is a very powerful API using which it's easy to make great games, especially when you have dazzling 3D effects. This book will put you on course to implement the same 3D graphics used in professional games to make your games shine, and get those gamers addicted! If you think 3D graphics is something that limits your games, then this book is for you.

3D Graphics with XNA Game Studio 4.0 is a step by step companion to implement the effects used in professional 3D games in your XNA games. By the time you're done with this book your games would have eye-catching visuals and 3D effects.

The one thing that can make or break a game is its appearance; players will mostly be attracted to a game if it looks good. With this book you will create your 3D objects and models and make them look more interesting by using shadowing and lighting techniques, and make them move in nasty ways using animation. Want to create realistic terrians for your games? Need some place for your 3D models to engage in battle? This book will enable you to do all that and more, by walking you through the implementation of numerous effects and graphics techniques used in professional games so that you can make them look great.


Read More