Game Programming Class14

esse quam videri
Revision as of 03:43, 4 May 2009 by Jeff (talk | contribs)
Jump to: navigation, search

Animation Tutorial


Mixing 2D and 3D

I forgot to show you last week that the spritebatch draw code need to be modified slightly in order top mix 2D and 3D You need to use SaveStateMode.SaveSate is you don't explicitly order everything in you DrawCode. Saving states can be SLOOWWWWW and significantly reduce your performance http://blogs.msdn.com/shawnhar/archive/2006/11/13/spritebatch-and-renderstates.aspx.

spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState);

Lighting

The xna basic effect is a simple implementation of a HLSL effect.

HLSL is Microsoft's High level implementation of FFE Fixed Function Pipeline implemented in video hardware.</p> GPU Hardware does two things The vertexr shader runs first and is rasterized to 2D then the pixel shaders run.

  • Vertex Shader
  • Pixel Shader

Lighting Demo with Basic Effect IntroMeshLights.zip

HLSL

HLSL Demo

http://code.msdn.microsoft.com/HLSL

Creators Club Non Realistic Render

Lighting_basics

Per-pixel_lighting

SkyBox

Ziggyware

IntroMeshLightsSkyBox.zip

Sybox generator

http://www.planetside.co.uk/terragen/

http://www.stromcode.com/2008/03/30/building-an-xna-skybox-with-blender/