Friday, February 8, 2013

8. How Textures Look As of Now

       Welcome back gamers to this new update on the Cyclone Game Engine. I am attempting to create a first person shooter using my game engine, that is built upon the XNA Framework. The following screenshots do not represent final in-game footage! They are just for demonstration purposes to show how a slightly finished map would look as of right now in a game created using the Cyclone Game Engine. Textures helps add realism to the game world. I needed to use as much real world references as possible, so to help save me time finding texture images, I came across a website called CG Textures. The fully textured scene is from a tutorial I found online utilizing 3D Studio Max to help me save time and was used in a ray-tracing demonstration. I have not applied any normal maps yet. With that said, once I finish programming the normal mapping processor and some other things, the textures will appear less flat and more 3D. Click on the following images for better quality. 

M4A1 with a custom acog scope

       At this stage, shadows have not been implemented just yet. I recently got a few sample programs working with shadows implemented. I am trying to improve them through filtering techniques. The edges of the shadows are too "blocky" as of now. So I am working on softening the shadows to reduce their aliased appearance. 

Zoom / Aim-Down-Sights

       For now, I created a "cheap" zooming effect by changing the Field-Of-View member of the camera's view frustum. This is usually set to around 45-60 degrees. I played around with this some until I got the effect I wanted.

Aim-Down-Sights is working for the most part but the animation for it needs more work. As of right now, it is a program animation and it gets off-centered while moving. 

       It took me a while to texture and model everything up to this point in the images above. The screenshots above were of models that I created from real world references in Autodesk Maya. As you can see, the images above were not fully textured and modeled. So to help me save time, I found a tutorial online of how to model and texture a scene in 3D Studio Max. After the final stages of texturing was complete, I exported the scene into .fbx models and imported them into Autodesk Maya.

       To save time, the engine for now can essentially use a modeling program as its level editor. The engine tracks where the models are located and positioned in Model Space in an object editor like Autodesk Maya or 3D Studio Max, and displays them in-game exactly how you had them placed in Maya or 3D Studio Max. Just to be clear, the engine does not necessarily create all of this; the artists model and texture everything. The engine simply renders it all in real-time in the game. Later the game engine will make the scene look better because it will handle different lighting and texture mapping techniques. I hope to later add parallax mapping to the bricks and deferred rendering.

Roads Work-In-Progress Pic1

Roads Work-In-Progress Pic 2

The following screenshots below shows the final in-game screenshots. 

       Unfortunately, the gun and hands are not textured yet. I realize this may make the final result look a little less "professional" but this is simply a starting point. 

       Majority of the textures were edited and touched up in Photoshop to help with overall quality. Because the XNA Framwork HiDef Profile only supports images with a DXT Compression of 4, I had to re-scale the images in Illustrator and convert them into a vector so that they would not get pixel-ated. I explain more below.

       I am pushing the engine to run more textures while taking up less memory at the same time. Although this map is small, it has a lot of textures in it. Too many textures as well as draw calls started to slow down the frame rate, making the game run slightly slower. So to help performance, many of the models used the same textures which somewhat helped the game run better. Although the game performance is fine on PC, there are many things hurting performance on Xbox 360 preventing it from running at 60 frames per second. Later, I will work on ways to optimize it so that it runs better on Xbox 360 and reduce my draw calls.

       For now, the fence wires are mostly just textures instead of actual polygons. This is done to help save memory when processing but eventually I will model the fence wire once I am confident the engine is further optimized and its performance it up to par.

       The ground textures are coming along nicely. Again, there are no normal maps yet. Normal mapping is used to add details without using more polygons to the actual 3D model. The normal mapping processor I am working on right now once I get it working will hopefully greatly enhance the details. Right now, the textures appear too flat, but its a good start. Once I get the different mapping systems working, the textures will appear more 3 dimensional and have greater detail than the current textures.

I pulled the gun model back and added an iron sight to it. I am debating on what textures I am going to use for the scar gun model. 

Texture Problem
       One major game error I as well as many other game developers encountered after compiling our 3D models in our XNA game projects is the texture size. When using the HiDef profile, XNA uses DXT4 (DXT compression of powers of 4 for textures. If you are using the Reach profile in XNA, for Windows Phone for example, it uses DXT2 (DXT compression of powers of 2 for textures).

When I added my model to my content and ran the program I get the following error:

Invalid texture. face 0 is sized 522X360 , but textures using DXT compressed formats must be multiples of four

       The dimensions of my texture image was not multiples of four, which is exactly what it states. I fixed this by simply resizing the texture. A simple but sort of lazy route I took to fix this error was by importing the texture into Adobe Illustrator to convert the file into a vector image. I did this in order to avoid pixelation. Then I re-scaled the width and height of the texture by making sure each side was divisible by four (should be ideally powers of two). The HiDef profile however adds full support for non-power-of-two textures. You want to keep the texture image as close to its original size as possible so that it does not appear too stretched on the 3D model. Also, I recommend using an editor like GIMP to get a clean scale that does not look too weird so to speak. You can learn more about texture compression and why it is important for games here. For the most part, it helps improve memory. This day in age, games are utilizing high-definition texture files which can take up a lot of memory, so compression can come in handy. 

       Just to be reiterate, this is simply a demonstration of what a mostly finished textured map in the Cyclone Game Engine looks like at the moment. This is not an actual game and the screenshots does not represent final in-game footage. This is just a placeholder. Early on, many gamers asked me where were all the textures. Texturing will take place during the final stages of development. Right now I have to work on more important things like physics, artificial intelligence, performance optimization and gameplay functionality. I am not necessarily making a game targeted or tailored towards the Battlefied and Call of Duty crowd. Sorry for the slow progress updates. I haven't had much time to work on this. Thanks for reading and I greatly appreciate your support. Also, if you found this blog post helpful, please comment below. 

No comments:

Post a Comment