
+12
Under vurdering
Add support for PS4 + PSVita (not to be confused with PlayStation Mobile!)
The recent release claimed to add support for PSVita when it actually added support for PlayStation Mobile, a separate platform. Shaders created in ShaderForge still fail to compile for PSVita. The requirements for each platform are...
-=PSVita=-
-=PSVita=-
- UV fields in the vertex input struct (using TEXCOORD0 semantic) must be named 'texcoord', not 'texcoord0' as they are for PlayStation Mobile.
- v2f structures (output from vertex shader used as input to fragment shader) must be changed from POSITION to SV_POSITION. Note that a2v (application to vertex) structures should continue to use POSITION.
- Fragment shader output that writes colour must be changed from COLOR to SV_Target.
- Fragment shader output that writes depth must be changed from DEPTH to SV_Depth.
- Do not use "sample" as a variable name in shaders. This is a reserved word that will cause shaders to fail to compile.
Kundesupport af UserEcho
Rubén is right; vertexColor isn't accepted for PSVita either. I agree with you, Joachim - it really is a silly issue. I've started a discussion on the PSVita DevNet forums with the Unity devs about consolidating these naming conventions to be the same. My understanding is that the PSM and PSVita ports may have been handled by different teams, which would explain the discrepancies.
The PS4 changes shouldn't cause any conflicts, I don't think. In the PS4-friendly build of Unity, the HLSLSupport.cginc file it ships with contains definitions for mapping SV_Target/SV_Depth to the appropriate semantics. I'm not sure if those same changes are in the main branch of Unity. If not, maybe just add an option to the list of Target renderers, for those of us who are affected by it?
diffuseColor = DiffuseAndSpecularFromMetallic( diffuseColor, _Specular, specularColor, specularMonochrome );
And the error is Shader error in 'Custom/PlatformBaseS': Program 'vert', parameter of type 'half3' is a function output and does not permit argument of mismatching type 'float3' at line 267 (on psp2)