Senior Production – Week 9

It’s been a while since I have had a chance to update my blog since the last few weeks have been interesting. Two weeks ago I attended GDC so I will update for that in the week 7 post eventually. The following week was break, but I was pretty dead for the first few days after getting back from GDC and PAX East. PAX was kind of a letdown compared to other years for various reasons. The last several days of break I was mostly focused working on implementing voxel traced global illumination in my engine as a side project for Console Programming.

On to this past week. We’ve been doing a lot of work to prepare for the alpha milestone. Unity 5 was released for free to (mostly) everyone over the week I was at GDC so I worked on porting our game to Unity 5, adjusting and implementing various visual effects, and optimizing the fog a bit more. Luckily most of the differences from Unity 4.6 to 5 were graphical and there were no major headaches involved in upgrading.

Honestly I’m still a big Unreal Engine 4 fanboy, but it’s nice to be able to work with some more physically plausible shading. One thing that’s a big pain is that Unity 5 still does not have an easy way to implement an inverse square light falloff. I worked with the candles a lot in particular to tune the falloff to be somewhat more realistic. If Unity even gave direct control over the falloff of light, it would be useful. Instead it gives you intensity and a slider to dictate the maximum range of lights. Then the engine adjusts the falloff of the light to make it falloff to 0 intensity at the end its maximum range. This allows you to get some really physically implausible harsh falloffs if you have a short range with high intensity lights.

After updating the materials and shaders to work with the new physically based shading I think that the game looks a lot better in general. At least at night time it looks very good. I still need to tune it for daytime lighting, but that has taken lower priority since the player will only see daylight for a small percentage of the time they play.

I messed with animations some more to tune them and implement some of the new updated animations and character model. I had put in the character model earlier but the repository and Unity did not like it, and just left a blank model when others tried to download the game. Once I resolve the bugs with it I’m going to make it so that the zombies move relative to the player’s hands when they are held.

Overall the performance has improved by about 50% after tuning some things. I reduced the detail and number of samples through the fog volume by about half and was able to get it to maintain about the same level of quality this was the first 25% or so. The upgrade to Unity 5 improved the performance by about 25% as well. In the end we ended up going from around 12ms a frame to about 8ms a frame on lab computers. I realized at some point along the way that the fog should just be run as a screen space post process effect. This will probably allow me to blend the results of the fog pass more effectively with screen space effects such as SSAO. More importantly this will mean that I can apply the fog effect to all geometry in the scene in one pass cheaply. Right now I am not applying the fog to particles since they generally have a lot of overdraw and would have a significant cost.

Unity 5 personal edition has all of the screen space effects that Unity 4 pro had so I added a few of the screen space effects and tuned them. This was not really anything technically difficult. For the tuning of these effects subtlety was key. For most of them it’s hard to consciously notice them unless you flip them on and off, but they do make a very perceivable difference overall. First is the screen space ambient occlusion. This gives everything on the screen contact shadows and accentuates depth as a result. I added a bloom effect in order to show the brightness of the candles in comparison to the rest of the scene. I also added a very slight vignette effect.

Unfortunately there was not much which was technically challenging in the game this week. The major issues were all related to battling with Unity and the SVN repository to get everyone’s copy of the Unity project files on the same page.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>