Wednesday, May 22, 2013
9: Mixing 2D and 3D
Finally! The Skybox in the game is fixed since I have a little more time to actually work on the engine. The lines outlining the skybox would display in the game and I had to make sure they went away. Its tricky when the program is drawing 2d and 3d together on the same screen under the 'Draw Method'. Thanks to Shawn Hargreaves who provided the most efficient way to go in his blog post, I was able to fix my skybox.
When I was mixing 3D rendering with 2D objects using SpriteBatch, I noticed that my 3D graphics no longer drew correctly after I rendered sprites. All of the models triangles and polygons appeared to be disoriented and stretched leaving tons of gaps and holes. This is because the SpriteBatch changes several device renderstates to values that may not be appropriate for drawing in 3D.