Archive for the ‘Technology’ Category

2.5.1 Webplayer Preview

With Unity 2.5.1 quickly wrapping up development, the last item on our to-do list is verifying webplayer compatibility.  As a team we do systematic testing on a broad range of weplayers.  However, we really want 200% confidence instead of a measly 100%.  So we’re asking for a little help — from you!

If you want to help make Unity 2.5.1 a flawless release, there are two simple things you can do.

1) Auto-update to the 2.5.1 webplayer plugin by visiting this Auto-Update test page.

2) Go play as many webplayers as possible.  Your own or someone else’s, published or unpublished, anything you can find.

Every game you play should look and behave exactly the same as it did before the update.  In fact, if you see any differences (or problems) at all, write us an email at support@unity3d.com.  Include the url of the problematic webplayer, and the OS, browser, and graphics card you’re using.  It’s best to let us know right away so we can fix it immediately!

We already know the Unity community is amazing, and this is your chance to actively participate along with the development team to ship a new version.  Rock ‘n roll, and send your pre-release 2.5.1 webplayer bugs to support@unity3d.com!

iPhone 1.0.3 to the Rescue

iphone-os3

If you’re using compressed audio in your iPhone game, then you should grab Unity iPhone 1.0.3. It is a hot fix release with a single purpose – to improve performance of a compressed audio playback under the iPhone OS 3.0.

Now some technical bits. Previously we have been using the AmbientSound as an audio session category. The AmbientSound category respects silent switch and allows single compressed audio to be played via dedicated hardware decompressor. However since introduction of the iPhone OS 3.0 meaning of the AmbientSound slightly changed. Now this category allows multiple compressed audio sounds to be played, but all of them are decompressed on CPU!

That is not a big deal if you have game without CPU intensive tasks or completely GPU bound game. Otherwise performance may suffer. Instead iPhone OS 3.0 introduced a new audio session category called AmbientSoundSolo which behavior is more like an AmbientSound under the OS 2.x. That is what we need!

Unity iPhone 1.0.3 will detect OS version at the run-time and will pick audio session category for you. It is important to know that this process does NOT require you to explicitly compile for newer OS version. You should use the OS 2.x as a compile target still – it will guarantee wider audience for your game.

iPhone 3G S is Hot!

iphone3gs1

First, lets see what is inside new iPhone 3G S. Number of technical sites wrote reviews already (mostly based on well educated guess since real hardware is out of reach for most), so I will be brief:

  • New and shiny ARM Cortex-A8 as main CPU running at 600MHz. New chip maintains 100% backwards compatibility with older ARM1176 chips powering original iPhone family – so no worries here.
  • New PowerVR SGX chip serving as GPU. SGX family is a huge leap over MBX Lite which we saw in original iPhone. It is faster, has pixel and vertex shaders and supports a bunch of features you would normally get only on your desktop GPUs. It comes with OpenGL ES 1.1 and OpenGL ES 2.0 support too.
  • New NEON™ SIMD unit which is a fantastic addition to help in number crunching operations such as mesh skinning.
  • Double the L1 cache size and introduced L2 cache – this means speed.

All this is great great of course, but how could we help to reduce the complexity while supporting full spectrum of old and new devices? Thanks to the desktop origins of Unity engine, we have solved part of this problem even before iPhone was introduced. In order to harness wild variety of Macs and PCs with different GPUs Unity implemented mechanisms to determine capabilities of the graphics device and fallback to less demanding shaders at run-time.

You can learn more about SubShaders and Fallbacks here:

http://unity3d.com/support/documentation/Components/SL-Shader.html

Different graphic cards have different capabilities. This raises an eternal issue for game developers; you want your game to look great on the latest hardware, but don’t want it to be available only to those 3% of the population. This is where subshaders come in. Create one subshader that has all the fancy graphics effects you can dream of, then add more subshaders for older cards. These subshaders may implement the effect you want in a slower way, or they may choose not to implement some details

I’m really looking forward for Unity iPhone 1.1 being released so we can concentrate on adding OpenGL ES 2.0 support to Unity. Meanwhile you will be able to enjoy 8 texture combiners in a single pass available on the new iPhone 3G S devices.

We wrote a number of hand optimized assembly routines to speed up calculations on VFP coprocessor for Unity iPhone 1.1. For example skinning is now several times faster and significantly outperforms GPU! We’re going to continue this trend by harnessing NEON™ capabilities for iPhone 3G S.

One more thing I want to share with you – we have not seen the actual iPhone 3G S device yet. For better or worse, Apple have been really secretive. Right now we’re looking forward to get the devices from the first batch of publicly available ones. That should allow us to implement and test new features ASAP. Meanwhile we’re working close with Apple to verify existent content works fine on iPhone 3G S.

Fixed function T&L in vertex shaders: implemented

Unity roadmap blog post said:

Currently Unity mixes the fixed function pipeline for vertex lit objects and vertex shaders for pixel lit lights. On Direct3D this creates some rendering artifacts on very close or self intersecting surfaces. We want to end this by implementing a full fixed function emulator in vertex shaders. You won’t have to do anything, it will just work!

Well, the good news is that we have done it, and it is definitely coming in Unity 2.6!

It is funny, because the problem seems like a simple one: “there are double-lighting artifacts on close surfaces”. The solution, however, is “we need to implement whole fixed function pipeline manually”, which involves combining shader assembly fragments, doing register allocations, packing vertex pipeline state into bits and other low level hacking.

In other words, it required quite a bit of thinking and implementation effort, so I decided to write up a technical report on how we solved it. If you’re a graphics programmer or love programmer speak or just have nothing better to do: here’s the report.

Resources everyone should see

Platform TutorialI think there are a lot of resources that are important but people might not have seen or skipped over it. So I am putting up a list of the most overlooked but important resources.

Getting started
The best way to get started if you know nothing about Unity is to go through the 3D Platform Tutorial. With this in-depth tutorial you can learn how to make a 3rd person platform game in Unity, but at the same time you will learn all the basics of Unity that will give you a head start when creating your own game.

Unity Locomotion system
If you are doing a lot of character animation in your game, you must check this out. Rune’s Locomotion system was presented at GDC 2009 in a fully packed session. The great thing about it is that it does stylized IK, meaning that it uses the existing animations to do good looking motions and only minimally adjusts them to place feet on the ground etc. It also scales really well, you can start out with a simple walk cycle and it will automatically synthesize sidestep / run / backwards animations for you. If you provide more animations the animations will simply look better.

Get the project folder here

Watch the Unite 2008 talk here.

Visual Studio Integration
In our roadmap we announced Visual Studio integration for Unity 2.6. However you can already use Unity with Visual Studio very well. Lucas Meijer has a blog post on how to create Visual Studio projects from a Unity Project folder automatically here.

Shaders
Amir’s Unite 2008 Shader talk is the defacto best tutorial on building shaders. He reshot the session into a 2 hour talk so he could go through all the details.

Customizing the asset pipeline
Lucas is really into tightly controlling the asset pipeline and automating every single bit. Fortunately Unity is very extendable, so he has a lot of places where he can plug in. Watch the talk here.

Matthew’s Physics Talk at Unite 2008
I generally love hearing Matthew’s talks. Got to love the pictures. This year on car physics was very useful.

Unity GUI
Nich’s Unite 2007 talk on how to create your own GUI controls is still very relevant.

The wizkid Forest talks about particles
Forest Johnson, a (then) 15 year old kid single handedly programmed the Avert Fate demo, he did some awesome particle effects too and then gave a kickass impromptu particle talk at Unite 2007.

Rune on dynamic walking

Rune on dynamic walking

Amir on shaders

Amir on shaders

Lucas on pipeline

Lucas on pipeline

Matthew on physics

Matthew on physics

Forest on particles

Nich on Unity GUI

Forest on particles

Forest on particles

Blogs about Unity:
The Flashbang guys have an awesome blog about Unity, that contains deep technical information that sometimes even I didn’t know about.

Lucas has a great blog about Unity with a lot of very useful information.

Somebody made  a site collecting video tutorials about Unity.

Unity Roadmap

Woah my first blog post! And I am going to dive right into the roadmap. This time we are taking a look at what is coming up in the near future.

Unity 2.6

Unity 2.6 is our next big release in the Unity 2.x series (And will be available as a free upgrade). We are planning to release Unity 2.6 sometime later this summer. Here’s some of the things to come:

Read the rest of this entry »

Unity iPhone Roadmap

Whooosh! First release candidate of Unity iPhone 1.0.2 just went out to our beta testers. It’s a good time now to overview our planned releases and directions we will be taking in the near future.

Unity iPhone 1.0.2. Based on custom builds we’ve been sending to devs in need, this release will address engine memory leaks and fix other outstanding issues:

  • Physics and audio related memory leaks
  • Asset leaks while reloading scenes
  • .NET sockets and threads
  • Compressed audio related issues
  • Stripping away too much of GUI components
  • Occasional crashes in AOT compiler
  • Support for both portrait and landscape splash screens

Next will be Unity iPhone 1.5. Since the release of 1.0.1 we’ve been working on a number of performance and memory optimizations. Most of the work on 1.5 is finished already and we’re doing an internal bug fixing round before it goes to beta testers too. Along with optimizations this release will include number of important features such as:

  • Binding custom ObjectiveC/C++ functions to C#/Javascript
  • Native on-screen keyboard support and interoperability with Unity GUI
  • Movie playback support
  • Performance optimizations:
    • significant C#/Javascript performance improvements
    • general rendering loop optimizations resulting in less OpenGLES state changes and less CPU work per object
    • number of internal routines were rewritten using VFP coprocessor assembly
    • way much faster mesh skinning utilizing VFP
    • batching small objects, given that they share same material, into single draw call
  • General distribution size optimizations which allows applications below 10Mb
  • Number of significant memory footprint optimizations

We don’t have strict versioning past 1.5 yet. Some of the following features will end up in the next big release and some might find a way to sneak into 1.5:

  • Compressed audio streaming directly from disk
  • 3.0 downloadable content
  • 3.0 bluetooth networking
  • GPS/Location support
  • Vibration support
  • Post-processing and render-targets support
  • Terrain support
  • Per-pixel DOT3 lighting support for skinned meshes
  • Reduce load times
  • Reduce distribution size even further
  • Improve GarbageCollector collection patterns to reduce spikes
  • Prepare a pack with iPhone optimized shaders

Update: Unity iPhone 1.0.2 is released.

Update: Unity iPhone 1.5 is released

New Animation timeline

With 2.5 out the door, I finally got some time to work on new features. I love that part – to me new features are so nice – the first couple of weeks always feels like you’re the world’s fastest coder (after that, reality sets in and you actually have to make it work in real life – even for corner cases).
Rune and I are busy on the new animation timeline. (Actually, I’m stealing his thunder – he’s doing the real work while I’m just mocking up in Photoshop and spreading general confusion) We’re basically going for a complete rewrite that gives you control over all curves with key editing, tangent dragging, the works. – have a look at what we’re thinking:

Timeline shot

Upcoming 2.6 timeline WIP

I’m really excited about this. I’m thinking that it should be able to require a lot less scripting work for a bunch of stuff. It will also support material animation (so you can actually just make some curves for a UV scroll – instead of having to code the thing from scratch).

Hardware of the casual gamer, launched

Almost a month ago I said we’re preparing reports of Unity Web Player hardware statistics.

Well, here they are: unity3d.com/webplayer/hwstats

Operating system versions, desktop resolutions, graphics driver versions, shader models, memory sizes and some more. All broken down by quarter so some sort of “trends” can be seen (sure, changes can be caused by general hardware change or simply different people groups playing different games).

Enjoy!

Hardware of the casual gamer

Pretty much everyone knows Valve’s hardware survey – it’s a very valuable resource that shows what hardware the typical “hardcore PC gamer” has (that is, gamers that play Valve’s games).

However, the “casual gamer”, which is what Unity games are mostly targeted at, probably has slightly different hardware. “Slightly” being a very relative term of course.

Lo and behold – we have a glimpse into that data.
Read the rest of this entry »