PSM Unity: Difference between revisions

From Vita Developer wiki
Jump to navigation Jump to search
m (enable rendering, disable enforced PRE)
Line 11: Line 11:


== PSM Development Assistant for Unity ==
== PSM Development Assistant for Unity ==
{| class="wikitable" style="font-size:small; text-align: center;border:3px ridge #123AAA;"
{| class="wikitable" style="font-size:small; text-align: center;border:3px ridge #123AAA;"
|-
|-
Line 42: Line 41:


== CPU  ==
== CPU  ==
 
The CPU has 3 hardware threads available to the application. <br />
The CPU has 3 hardware threads available to the application.  
Unity uses at least 2 (main and rendering), so creating more than one additional worker thread from managed  code is not likely to yield any additional benefit. <br />
Unity uses at least 2 (main and rendering), so creating more than one additional worker thread from managed  code is not likely to yield any additional benefit.  
But this of course depends on how the application itself is behaving. For example, a GPU-limited application might have plenty of CPU time to spare.
But this of course depends on how the application itself is behaving. For example, a GPU-limited application might have plenty of CPU time to spare.


== Graphics ==
== Graphics ==
 
PowerVR-based graphics core. Shaders are written in Cg. Textures are compressed using [[DXT]] or [[PVRTC]] (PVRTC is currently not supported by Unity).<br />
PowerVR-based graphics core. Shaders are written in Cg. Textures are compressed using [[DXT]] or [[PVRTC]] (PVRTC is currently not supported by Unity).
Screen resolution is 960 × 544.
Screen resolution is 960 × 544.


== Memory ==
== Memory ==
 
The physical memory available in the PS Vita is 256MB of system memory, and 128MB of video memory.<br />
The physical memory available in the PS Vita is 256MB of system memory, and 128MB of video memory.  
Not all of this is available to a "Unity for PSM" application - below is a breakdown of how much is reserved, for what, and how much is available to the application.
Not all of this is available to a "Unity for PSM" application - below is a breakdown of how much is reserved, for what, and how much is available to the application.


=== System Memory ===
=== System Memory ===
{| class="wikitable" style="font-size:small; text-align: center;border:3px ridge #123AAA;"
{| class="wikitable" style="font-size:small; text-align: center;border:3px ridge #123AAA;"
|-
|-
Line 79: Line 74:


=== Video Memory ===
=== Video Memory ===
{| class="wikitable" style="font-size:small; text-align: center;border:3px ridge #123AAA;"
{| class="wikitable" style="font-size:small; text-align: center;border:3px ridge #123AAA;"
|-
|-
Line 96: Line 90:
|-
|-
|}
|}
 
* The numbers above are theoretical limits. It's good practice to allow for a few MB of unused buffer space, to not run out of memory while running the application.
The numbers above are theoretical limits. It's good practice to allow for a few MB of unused buffer space, to not run out of memory while running the application.
* The memory listed as "Available to App" is used not only for scripts, but also for any kind of additional game data, such as meshes, physics/collision structures, etc.
The memory listed as "Available to App" is used not only for scripts, but also for any kind of additional game data, such as meshes, physics/collision structures, etc.


== Input / Output ==
== Input / Output ==
 
The PS Vita has these input / sensor capabilities, all which are available from a "Unity for PSM" application:
The PS Vita has these input / sensor capabilities, all which are available from a "Unity for PSM" application
* Directional input and × ○ □ △ buttons (digital)
 
* Left and right shoulder buttons (digital)
*Directional input and × ○ □ △ buttons (digital)
* Left and right analog sticks (x/y axis)
*Left and right shoulder buttons (digital)
* On-screen touch input + rear touch pad
*Left and right analog sticks (x/y axis)
* Compass / Gyro / Accelerometer / Location
*On-screen touch input + rear touch pad
* Front and rear camera
*Compass / Gyro / Accelerometer / Location
* Speaker and microphone
*Front and rear camera
*Speaker and microphone


== Runtime ==
== Runtime ==
 
Application code runs in a Mono 'sandboxed' environment where only managed (C# / UnityScript / Boo) code is allowed.<br />
Application code runs in a Mono 'sandboxed' environment where only managed (C# / UnityScript / Boo) code is allowed.
The Mono runtime uses Just-In-Time (JIT) compilation of application (user) scripts.
The Mono runtime uses Just-In-Time (JIT) compilation of application (user) scripts.


== Rendering ==
== Rendering ==
Unity for PSM reuses the same graphics driver used in the "Unity PS Vita" <br />
This ensures that a high-performance rendering path is available also with Unity for PSM.<br />
But the graphics driver behaves quite differently in one key aspect : A shader instance is only compiled when it's actually used, i.e. right before rendering the material from which it is referenced.


Unity for PSM reuses the same graphics driver used in the "Unity PS Vita"
This means that the classic fallback shader mechanism provided in Unity is not available on PSM. <br />
This ensures that a high-performance rendering path is available also with Unity for PSM.
An unsupported shader (a shader with a programming error, or otherwise fails to compile) will simply be replaced with the Default Shader,  which usually produce a pink color output (and the compilation error output written to the device log).
But the graphics driver behaves quite differently in one key aspect : A shader instance is only compiled when it's actually used -
Because this step can sometimes be computationally intensive, shaders already compiled are cached, and can be reused on subsequent application runs (provided the shader hasn't changed). One benefit of compiling shaders at runtime is that Unity for PSM also supports the older Unity "fixed function" shaders.
i.e. right before rendering the material from which it is referenced.
 
This means that the classic fallback shader mechanism provided in Unity is not available on PSM.  
An unsupported shader (a shader with a programming error, or otherwise fails to compile) will simply be replaced with the Default Shader,  
  which usually produce a pink color output (and the compilation error output written to the device log).
 
And because this step can sometimes be computationally intensive, shaders already compiled are cached, and can be reused on subsequent application runs  
(provided the shader hasn't changed).
 
One benefit of compiling shaders at runtime is that Unity for PSM also supports the older Unity "fixed function" shaders.

Revision as of 05:29, 27 July 2015

Unity-icon0.png

Unity for PSM is a runtime and development tools suite for the PlayStation®Mobile platform/business model.

Unity for PSM currently only runs on the PS Vita.

It's distinctively separate from the pre-existing "PSM SDK" . "PSM SDK" and "Unity for PSM" do not share tools or APIs.

PSM Development Assistant for Unity

Version PS VITA FW Category SFO Creation Date Hash MD5 Hash SHA1 Links Notes
1.00 3.00 gd November 26, 2013 md5:D207A1663E4778BE4CC8818506D05DE4 sha1:CD3A66939E2E4DBF698314921A49C13A66315C78 mega.co.nz -
1.01 3.01 gp - - - - -
1.02 3.10 gp - - - - -
1.03 3.12 gp - - - - -
1.04 3.15 gp - - - - -
1.05 3.15 gp July 12, 2014 md5:1FAA126521DFABFF9032EBB12F79D2CF sha1:A78E54CE19D7E015AE8D6684EF8E7F8866CD94B6 mega.co.nz -
1.06 3.30 gp October 17, 2014 md5:1673FA51A732347C4B8319986DB79BA3 sha1:D73875D9FFC51F61AD55E0C16C756C8071703AE6 mega.co.nz -

CPU

The CPU has 3 hardware threads available to the application.
Unity uses at least 2 (main and rendering), so creating more than one additional worker thread from managed code is not likely to yield any additional benefit.
But this of course depends on how the application itself is behaving. For example, a GPU-limited application might have plenty of CPU time to spare.

Graphics

PowerVR-based graphics core. Shaders are written in Cg. Textures are compressed using DXT or PVRTC (PVRTC is currently not supported by Unity).
Screen resolution is 960 × 544.

Memory

The physical memory available in the PS Vita is 256MB of system memory, and 128MB of video memory.
Not all of this is available to a "Unity for PSM" application - below is a breakdown of how much is reserved, for what, and how much is available to the application.

System Memory

Name Value
Physical Memory 256 MB
Reserved -8 MB
Available to "Unity for PSM" Available to "Unity for PSM"
"Unity for PSM" executable -32 MB
Buffers (sub-system allocations) -32 MB
Available to App 184 MB

Video Memory

Name Value
Physical Memory 128 MB
Reserved -16 MB
Available to "Unity for PSM" 112 MB
Buffers (screen and commands) -25 MB
Available to App 87 MB
  • The numbers above are theoretical limits. It's good practice to allow for a few MB of unused buffer space, to not run out of memory while running the application.
  • The memory listed as "Available to App" is used not only for scripts, but also for any kind of additional game data, such as meshes, physics/collision structures, etc.

Input / Output

The PS Vita has these input / sensor capabilities, all which are available from a "Unity for PSM" application:

  • Directional input and × ○ □ △ buttons (digital)
  • Left and right shoulder buttons (digital)
  • Left and right analog sticks (x/y axis)
  • On-screen touch input + rear touch pad
  • Compass / Gyro / Accelerometer / Location
  • Front and rear camera
  • Speaker and microphone

Runtime

Application code runs in a Mono 'sandboxed' environment where only managed (C# / UnityScript / Boo) code is allowed.
The Mono runtime uses Just-In-Time (JIT) compilation of application (user) scripts.

Rendering

Unity for PSM reuses the same graphics driver used in the "Unity PS Vita"
This ensures that a high-performance rendering path is available also with Unity for PSM.
But the graphics driver behaves quite differently in one key aspect : A shader instance is only compiled when it's actually used, i.e. right before rendering the material from which it is referenced.

This means that the classic fallback shader mechanism provided in Unity is not available on PSM.
An unsupported shader (a shader with a programming error, or otherwise fails to compile) will simply be replaced with the Default Shader, which usually produce a pink color output (and the compilation error output written to the device log). Because this step can sometimes be computationally intensive, shaders already compiled are cached, and can be reused on subsequent application runs (provided the shader hasn't changed). One benefit of compiling shaders at runtime is that Unity for PSM also supports the older Unity "fixed function" shaders.