Unity 4.1

Unity 4.1 brings you new features such as:

  • A more powerful Memory Profiler
  • AirPlay support
  • Mecanim updates
  • Shader updates
  • Allegorithmic Substances for mobile

Read the release notes for the full list of new features and updates.

Features

  • Profiler: Memory profiler makes it posible to view a snapshot of currently loaded game objects and assets, and shows the reason why an object is in memory. Memory usage of a player can also be viewed by connecting to the player from the editor.
    • Simple vs. Complex view type dropdown button in the memory area.
  • Substance: Procedural textures are now supported at runtime on iOS and Android (ARM v7a only, NEON needed for optimal performance).
  • Mecanim: 2D Blend Nodes for Blend Trees. 2D Blend Nodes are like regular blend nodes except you can blend based on two float parameters instead of one. Supported 2D blend types are Simple Directional, Freeform Directional, and Freeform Cartesian.
  • Graphics: Custom Material Editors! A shader can have CustomEditor keyword which points to an editor class that derives from MaterialEditor. This is useful for setting per material shader keywords from the UI.
  • Graphics: Per-material shader keywords. You can now set shader keywords on a per material basis. This allows for less work maintaining shaders and turning on and off parts of a shader with keywords.
  • iOS: full multi-screen support (AirPlay). Look for added Display class for an array of connected displays (only iOS is properly implemented now - all other platforms will have only one display in there).
  • Mac OS X Standalone: added GameCenter support.
  • Graphics: Rendering with shader replacement now supports lighting. If you render a camera with a replacement shader, the camera will pick the shader that corresponds to the current camera rendering path (forward / deferred / vertex lit).
  • Graphics: Camera.SetTargetBuffers added, allowing you to set buffers to draw to from RenderTexture or from screen; or to share depth buffer between different cameras.
  • Added Transform.hasChanged flag that can be used to check if the transform's position/rotation/scale has been altered since the last time hasChanged was set to 'false'.
  • Audio: Added scripting API support for sample-precision stitching of audio clips and synchronized DSP effects (AudioSettings.dspTime, AudioSource.PlayScheduled, AudioSource.SetScheduledStartTime, AudioSource.SetScheduledEndTime)
  • Editor: Console can now be filtered by Errors, Warnings, and Logs.
  • Shadows: Hardware shadow map filtering on capable mobile platforms (EXT_shadow_samplers; most recent iOS devices, very few Android devices yet). Makes shadow edges look a bit nicer, at some performance cost (used only when Light has shadows set to "Soft").
  • Mecanim: API for recording.
  • Mecanim: Can now change AnimatorController at runtime.

Improvements

  • Android: Added caching of shader binaries for faster load time, if available in the GLES driver (GL_OES_get_program_binary extension).
  • Android: Propagation of native crashes (callstack etc.) to the Google Play Error Reporter. This include native plugins and script callstacks.
  • Android: Added multiple render target support on NVIDIA (GL_NV_draw_buffers and GL_NV_fbo_color_attachments).
  • Audio: Added AudioSource.ignoreListenerPause to enable playback of sounds in menus and editor extensions while AudioListener.pause=true
  • Audio: It is now possible to query play position and Microphone read position from a different thread than the main thread. This can be used to lower the latency of processing microphone input, by adaptively regulating playback speed.
  • Editor: Scene view can be set to render with shader replacement, SceneView.SetSceneViewShaderReplace.
  • Editor: CustomEditors can now optionally apply for subclasses of the class they're editing. Use [CustomEditor(typeof(MyClass), true)] to also make a custom editor work for MyClass' children
  • Editor: Confirmation for losing prefab connection now only comes up once when dragging multiple child objects out of a prefab.
  • Editor: Display Unity version in Project Wizard dialog title.
  • Editor: Files with the FNT extension will now be imported as TextAssets (before they were of unknown type).
  • Editor: It's now possible to move MonoBehaviours from one game object to another via drag & drop.
  • Graphics: Added depth parameter to GL.Clear, for cases when you want to clear depth buffer to non-1.0 value.
  • Graphics: Added SystemInfo.maxTextureSize.
  • Graphics: ARGBHalf, RGHalf, RHalf, R8 render texture formats supported on modern OpenGL & OpenGL ES 2.0 devices.
  • Graphics: Improved handling of non-power-of-two texture sizes.
    • On most platforms, a NPOT-sized texture without mipmaps and with Clamp wrapping mode will be actually represented as NPOT size texture on the GPU. This lowers memory usage and greatly improves loading times for NPOT texture sizes.
    • NPOT-sized uncompressed textures with mipmaps are faster as well, if the GPU supports arbitrary texture sizes (most modern PC GPUs do).
    • Added SystemInfo.npotSupport.
  • Input: You can now control which layers get OnMouse* events via Camera.eventMask. Setting it to zero turns off the mouse events, improving performance.
  • Installers: New icons and other artwork for OS X installers.
  • iOS: "iPhoneBundleIdentifier not set up" demoted to warning.
  • iOS: Device physical architecture is reported more accurately, though in lowercase (like 'armv7s').
  • iOS: Info.plist now will be appended instead of overwriting it.
  • iOS: Minor PhysX performance improvements.
  • iOS: Total amount of physical memory is reported more accurately.
  • Linux: Associate project icon with player window.
  • Linux: Implement nographics batch mode.
  • Linux: Statically link libstdc++ for greater compatibility with older installations.
  • Mecanim: AssetBundles work with Mecanim.
  • Mecanim: Ability to drag States and StateMachines into sub StateMachines.
  • Mecanim: Mirror and Cycle offset available on States and BlendTree leafs (no need to duplicate animation for mirroring anymore).
  • Mecanim: Allow multi-editing of Animator components.
  • Mecanim: Context menu to delete States and StateMachines.
  • Mecanim: Copy Paste of State/StateMachine also copies missing parameters.
  • Mecanim: Transitions are only reorderable in the context of a State.
  • Profiler: It is now possible to connect to a player by manually typing the IP of the device where the player is running - in case of multiple players on the same IP, it will connect to the player listening on the lowest port (which is randomly assigned).
  • Resources.UnloadUnusedAssets() has been rewritten. It is around 4x faster than in Unity 4.0 and works much better in a game that streams levels in and out. The unloading is now using precise garbage collection (previously it was based on Mono's built-in GC, which is conservative). Fixes strange corner cases with the old system, where in the worst case it could reload prefabs from disk during unloading.
  • Shaders: Added SubShader tag "ForceNoShadowCasting". When this tag is present, no shadows will be cast from this object, even if shader has a shadow caster pass somewhere.
  • Shaders: Sampler precision support for mobile, you can use sampler2D_half, sampler2D_float, samplerCUBE_half, samplerCUBE_float types which will translate into mediump & highp samplers for GLES2.0.
  • Shaders: Shaders will now use the shadow caster pass of the selected subshader if a shadow pass exists. If no shadow pass exists it will fallback to the default shadow pass.
  • Substance: decrease the memory overhead of Substance instances created at runtime.
  • Substance: If present, the more user friendly input "labels" are displayed in the Inspector instead of the input "names".
  • Substance: Input groups and HSL adjustments are now presented as foldouts in the Inspector.
  • Substance: Less code is embedded in the various Unity players.
  • Substance: lower memory consumption when dealing with multi-graph Substances.
  • Substance: New "Use caching" load behavior for Substances (textures are written to disk/flash after being generated and are reloaded from there at subsequent app/game launches).
  • Substance: On mobile platforms "Compressed" Substance textures are now compressed at runtime to DXT or PVRTC if supported by the GPU.
  • Substance: Procedural textures can now be read in the runtime API (ProceduralTexture.GetPixels32). Substances must be set to RAW and have the isReadable property set for GetPixels32 to work.
  • Substance: Updated Substance engines for all platforms (faster rendering, better threading, lower memory consumption).
  • Substance: XML presets can now be read from / applied to substances in the runtime API.

Changes

  • Audio: AudioSource.Play(offset) is now considered deprecated. It will still work as before, but will output a warning. Instead, users are encouraged to use AudioSource.PlayDelayed(delay) which takes a delay parameter in seconds instead of a sample count in the arbitrarily chosen 44100 reference rate that was used previously.
  • DestroyImmediate is no longer allowed to be called from within animation events.
  • Editor: Removed buttons in Console window for Open Editor Log and Open Player Log (on OS X) and put them into the custom menu for the Console instead (accessed through the upper right corner of the window).
  • iOS: Changed how VRAM amount is estimated and reported, now it is 1/4 of total physical memory.
  • iOS: Keyboard handling extracted to trampoline.
  • Mecanim: Avatar body and skeleton mask has been merged into AvatarMask to simplify the workflow. Any created object of type AvatarBodyMask or AvatarSkeletonMask should be converted to AvatarMask. Any AvatarSkeletonMask set into a layer mask would be lost, you need to manually re assign the mask.
  • Mecanim: CycleOffset is set automatically to 0.5 for clips that are being mirrored in States/BlendTrees.
  • Mecanim: In model importer animation tab for humanoid clip, the option Keep Additionnal bone has been removed since you can now choose wanted transform in the Avatar mask.
  • Static batching no longer supports generating triangle strips.
  • UnityEngine.dll and mscorlib.dll are no longer accepted as assets.

Fixes

  • Android/iOS: Updated PrefetchSocketPolicy() to return true instead of throwing an exception.
  • Android: Added local ref cleanup code to AndroidJNI to support more user based local refs per frame.
  • Android: Added manifest flags to avoid multiple instances of the same application.
  • Android: Added the ability to pass null arguments through the JNI bridge.
  • Android: Added workaround for "Could not reserve enough space for object heap" error.
  • Android: Added workaround for Tegra shader compiler bug when texture samplers are not reported.
  • Android: Fixed "Unity Remote" accelerometer input.
  • Android: Fixed a crash when returning to main Activity after downloading an OBB, when using development player.
  • Android: Fixed an issue where async updates of the TouchScreenKeyboard.text property would void any input from the keyboard.
  • Android: Fixed an issue where huge switch case statements could crash/yield the wrong result.
  • Android: Fixed an issue where the application would consume a significant amount of cpu even though the application was paused.
  • Android: Fixed an issue where the wrong activity might get launched by the editor.
  • Android: Fixed an issue where webcam textures would take over the entire screen on JB devices.
  • Android: Fixed an issue with missing features/permissions in the AndroidManifest.
  • Android: Fixed cpu detection, some devices reported more cores than was actually present.
  • Android: Fixed error message when current build is aborted by the user.
  • Android: Fixed issue on Adreno with skinning on gles11.
  • Android: Fixed loading data on devices where /data/app is symlink'd.
  • Android: Fixed problem with status bar being hidden even though 'Status Bar Hidden' was unchecked.
  • Android: Fixed Touch.fingerId discrepancy before and after an application has been paused/resumed.
  • Android: Fullscreen video now respects lights-out mode.
  • Android: Made sure correct screen resolution is set before Awake is called on scripts.
  • Android: Touches outside TouchScreenKeyboard no longer result in a cancelation event.
  • Android: TouchScreenKeyboard.text is now set to initial value on cancel.
  • Audio: Fixed deadlock in IT playback code.
  • Audio: Replacing the AudioClip on an AudioSource no longer affects playback speed if the clips have different sampling rates.
  • Audio: Sounds started by PlayOneShot are no longer stopped by Play.
  • Documentation: Fixed documentation of MonoBehavior stating Awake() is not called for disabled behaviours.
  • DX11: Fixed render-to-cubemap (including point light shadows) on DX10.0 level GPUs.
  • Editor: Project Browser.
  • Fixed so valid drag and drops in second column removes the drag label (OSX issue only).
  • Center preview when framing. This also makes it a better experience when changing preview size, since the selected item does not jump vertically.
  • Editor: Asset name are no longer allowed to be empty.
  • Editor: Ensure selection is framed in Object Picker when showing.
  • Editor: Fix a regression when GUI could be rendered in the wrong spot in deferred mode.
  • Editor: Fix file names for web players, if they project name contains a period ('.') character.
  • Editor: Fix that Object Picker showed script assets for MonoBehavior references.
  • Editor: Fixed all known issues with the results of "Generate Lightmap UVs" being different on Windows vs. Mac.
  • Editor: Fixed crash when loading fonts from asset bundles in editor.
  • Editor: Fixed scene view "Rendering Paths" visualization mode (got broken in 4.0).
  • Editor: Fixed text mode serialization of ProjectSettings
  • Editor: Fixed using asset folders with only 16-bit Unicode characters in their file names on Mac OS X.
  • Editor: Hitting Enter on an empty "open project" window will no longer crash the editor.
  • Editor: Immediate mode GUI windows closed during the Layout event will no longer crash the editor on Windows.
  • Editor: Import package window will now open to the last directory instead of the projects root.
  • Editor: Scripts will now receive an Update after they get recompiled and re-enabled.
  • Editor: Scripts will now receive Update events as the Game window is being resized.
  • Editor: The build player window will now default back to the active build target.
  • Fix crash when using an invalid Mesh on a SkinnedMeshRenderer
  • Fix mesh compression of skinned mesh bone weights.
  • Fixed "Out of memory" error when importing empty movie file.
  • Fixed bug in the Cache Server where it runs out of memory when uploading a lot of files to it and the disk speed is very slow.
  • Fixed crash during asset creation for scenes that do UnloadUnusedAssets() from within editor scripts.
  • Fixed crash when calling Mesh.GetTriangleStrip() on an empty submesh.
  • Fixed division-by-zero in keyframe reduction for empty clips.
  • Fixed division-by-zero in Quaternion.RotateTowards() when angle between quaternions is zero.
  • Fixed outputs from previous asset import not being cleared upon failed import.
  • Fixed TextureImporter Inspector to save settings correctly when disabling the platform overrides.
  • Graphics: Fix issue when calling Camera.Render () from an image effect. Validation now takes place to ensure that the camera you are calling Render on is not the currently rendering camera.
  • Graphics: Fixed error messages with a skewed camera matrix (also coming to 4.0.1 soon).
  • Graphics: Fixed multiple point light shadows not quite working in forward rendering.
  • Graphics: Fixed rare crash with richly formatted text rendering.
  • Graphics: Fixed shadow casting of Line & Trail Renderers.
  • Graphics: Respect Hard Shadows Only quality setting in Deferred rendering.
  • iOS: Fix WWW class to handle all 2xx HTTP status codes as successful.
  • iOS: Fixed an issue with native plugin inclusion when file name contains '~' symbol.
  • iOS: Fixed Camera.SetTargetBuffers issue on dx (it was considered to be rendering on screen always).
  • iOS: Fixed log output to device console when Xcode is not attached and device is running iOS 6.0 or later.
  • iOS: Fixed rare crash when acceleration events were delivered simultaneously from concurrent threads.
  • iOS: Fixed view stretching after device unlocking.
  • iOS: Main display rendering resolution can be changed correctly through both new and old API (fix for known issue).
  • License: Fixed issue with license expired errors on trials which were not yet expired.
  • Mac OS X Standalone: Fixed fullscreen mode bugs on OS X 10.6
  • Mecanim: Fix root motion when you have a CharacterController disabled, now the Animator should correctly apply the root motion to your GO when the CharacterController is disabled.
  • Mecanim: Fixed @ conventions for Humanoid animations.
  • Mecanim: Fixed character orientation not being correct on some assets.
  • Mecanim: Fixed crash when BlendTree child node as a 0 speed.
  • Mecanim: Fixed crash when deleting certain Sub StateMachine.
  • Mecanim: Fixed crash when editing a playing animation in DCC while game is playing.
  • Mecanim: Fixed deletion of multiple Transitions.
  • Mecanim: Fixed DeltaPosition/Rotation with generic animation.
  • Mecanim: Fixed Generic animation loosing root motion on additionnal masked layer.
  • Mecanim: Fixed mouth of character opening during Mirror.
  • Mecanim: Fixed revert button not working in Avatar setup tool.
  • Mecanim: Fixed spinning wrist on some retargeted animation.
  • Mecanim: Fixed State timing being wrong when editing Animation Start/Stop time.
  • Mecanim: Fixed undo of Parameter deletion.
  • Mecanim: Fixed warning when using ApplyRootMotion with Kinematic RigidBodies.
  • Mecanim: Generic Avatars do not show Configure button.
  • NavMesh: Fixed issue where agents isPathStale flag was not set correctly when changing walkableMask or navmesh layer cost.
  • NavMesh: Fixed issue where OffMeshLinks would sometimes wrongly generate two-way instead of one-way links.
  • NavMesh: Fixed issue where setting an invalid path on agent would return true.
  • Physics: Fix CharacterController.bounds.
  • Shaders: Fixed various issues in HLSL->GLSL shader translator; most notably nested loops now work properly.
  • Shuriken: Fixed a memory leak (also coming to 4.0.1 soon).
  • Shuriken: Fixed angular velocity setting range being clamped to 0..1.
  • Shuriken: Fixed crash on a particle system without a particle renderer.
  • Shuriken: Fixed wrong Shape in presence of parenting with scale (also coming to 4.0.1 soon).
  • Substance: Baking substances textures on X360 is fixed.
  • Substance: Fixed "Export Bitmaps".
  • Substance: isLoadTimeGenerated can be set again.
  • Substance: When baking compressed textures for iOS, only square PVRTC textures are baked.
  • Substance: when updating projects from older versions, substances should now have all their parameters displayed in the inspector.
  • Terrain: Fixed too dark unlit side in tree creator billboard shaders.
  • Time.deltaTime is now correctly set to 0 when starting up with Time.timeScale=0.
  • Web Player: Fix using WWW class in use cases where yield is never called on the WWW instance.
  • Web Player: Web player channels can now be used to downgrade a channel if a newer version then intended had been downloaded
  • Webplayer: Maximum bound socket count is now 50, addresses security issue.
  • Windows: Fix crash when hitting "Quit" in standalone player configuration dialog.
  • Windows: Fixed rare crash of standalone players when exiting back to desktop.
  • Xbox360: Fixed crash when calling Application.Quit in scenes containing XMA encoded AudioClips.

Upgrade Notes

  • If your project uses shader replacement it will now by default use the camera settings for which render path to use. If the replacement shader you use does not support the given render path then the object will not be rendered. If you are using a simple (non-surface) shader for your shader replace set the replacement camera to forward rendering mode.
  • When using shader replacement image effects will now be applied to the resultant render output.
Unity 4.0.1
Unity 4.1.2