2016-09-21 6 views
1

私はUnitysビルド> Samsung TVを使用してSamsung TV用のアプリを作っています。サムスンTVで材料を変更するとピンク色になります

私は、材料mainTextureをアトラスに、メッシュフィルタをuvをPackTexturesメソッドから与えられたuvに変更したプリミティブボックスがあります。私はサムスンのテレビでテストしたときにそれはすべての良い、エディタで正常に見える

  Texture2D[] allCubeTextures = new Texture2D[] { app.GetComponentInChildren<Image>().mainTexture as Texture2D, Resources.Load<Texture2D>("Black"), Resources.Load<Texture2D>("Black"), Resources.Load<Texture2D>("Black"), Resources.Load<Texture2D>("Black"), Resources.Load<Texture2D>("Black") }; 
      Texture2D textureAtlas = new Texture2D(2, 2); 
      Rect[] atlasUvs = textureAtlas.PackTextures(allCubeTextures, 200); 
      icon.GetComponent<Renderer>().material.mainTexture = textureAtlas; 
      Vector2[] uv = new Vector2[6 * 4]; 
      for (int i = 0; i < atlasUvs.Length; i++) 
      { 
       int j = i * 4; 
       uv[j] = new Vector2(atlasUvs[i].xMin, atlasUvs[i].yMin); 
       uv[j + 1] = new Vector2(atlasUvs[i].xMax, atlasUvs[i].yMin); 
       uv[j + 2] = new Vector2(atlasUvs[i].xMin, atlasUvs[i].yMax); 
       uv[j + 3] = new Vector2(atlasUvs[i].xMax, atlasUvs[i].yMax); 
      } 
      Mesh mesh = icon.GetComponent<MeshFilter>().mesh; 
      mesh.uv = uv; 

、しかし、箱はすべてピンク(彼らは壊れシェーダであるかのように)です。

アトラステクスチャにメインテクスチャを編集する前に、私はユニティの標準uvを使用しました。これはうまくいきましたが、私のアトラスが今それをどう扱うのではなく、すべての面にテクスチャがありました。これが私がそれがそれに関連していると思う理由です。

私はこのエラーの周りに私の頭を包み込むために、別の結果を持たないさまざまなシェーダで試しました。

Samsung TVがこのテクスチャの実装をサポートしていないことは間違いありませんか?

サムスンのテレビログ:私は私の問題は、多少に関係していると思う さらにいくつかの掘削を行った後:

Game_Main:209] GPlayer PFM Ver : (1001) 
Failed to create random directory /tmp/pulseaudio/pulse-XswsA4ySxtTi: Permission denied 
Mono path[0] = '/opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed' 
Mono config path = '/opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed' 
using 32 bit 
using 24 bit depth 
Renderer: 
Vendor: ARM 
Version: OpenGL ES 2.0 
GLES:  2 
GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_compressed_ETC1_RGB8_texture GL_EXT_compressed_ETC1_RGB8_sub_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_vertex_half_float GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_ARM_mali_program_binary GL_EXT_shader_texture_lod GL_EXT_robustness GL_OES_depth_texture_cube_map GL_KHR_debug GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_OES_mapbuffer 
OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level <OpenGL ES 2.0> ; Context handle 1073741825 
Initialize engine version: 5.4.1f1 (649f48bbbf0f) 
Failed to create random directory /tmp/pulseaudio/pulse-Ivi10nSJCUJP: Permission denied 
Failed to create random directory /tmp/pulseaudio/pulse-YonkWqDHH005: Permission denied 
Not enough permissions to set priority (must be root)Begin MonoManager ReloadAssembly 
Platform assembly: /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/UnityEngine.dll (this message is harmless) 
Loading /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/UnityEngine.dll into Unity Child Domain 
Non platform assembly: /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/User/Assembly-CSharp.dll (this message is harmless) 
Loading /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/User/Assembly-CSharp.dll into Unity Child Domain 
Non platform assembly: /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/User/UnityEngine.UI.dll (this message is harmless) 
Loading /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/User/UnityEngine.UI.dll into Unity Child Domain 
Non platform assembly: /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/User/UnityEngine.Networking.dll (this message is harmless) 
Loading /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/User/UnityEngine.Networking.dll into Unity Child Domain 
- Completed reload, in 0.133 seconds 
Platform assembly: /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/System.Core.dll (this message is harmless) 
Platform assembly: /opt/storage/usb/sda1/f0caae903700866889117406a674369e6e82bef3/resources/Data/Managed/System.dll (this message is harmless) 
-------- Shader compilation failed 
#version 100 
#extension GL_EXT_frag_depth : enable 
precision mediump float; 
uniform highp vec4 _ProjectionParams; 
uniform highp vec4 _ZBufferParams; 
uniform highp mat4 unity_CameraToWorld; 
uniform highp mat4 _NonJitteredVP; 
uniform highp mat4 _PreviousVP; 
uniform highp sampler2D _CameraDepthTexture; 
varying highp vec2 xlv_TEXCOORD0; 
varying highp vec3 xlv_TEXCOORD1; 
void main() 
{ 
    highp vec4 tmpvar_1; 
    tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0); 
    mediump vec2 tmpvar_2; 
    highp vec4 tmpvar_3; 
    tmpvar_3.w = 1.0; 
    tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z/xlv_TEXCOORD1.z)) * (1.0/((
    (_ZBufferParams.x * tmpvar_1.x) 
    + _ZBufferParams.y)))); 
    highp vec4 tmpvar_4; 
    tmpvar_4 = (unity_CameraToWorld * tmpvar_3); 
    highp vec4 tmpvar_5; 
    tmpvar_5 = (_PreviousVP * tmpvar_4); 
    highp vec4 tmpvar_6; 
    tmpvar_6 = (_NonJitteredVP * tmpvar_4); 
    highp vec2 tmpvar_7; 
    tmpvar_7 = (((tmpvar_5.xy/tmpvar_5.w) + 1.0)/2.0); 
    highp vec2 tmpvar_8; 
    tmpvar_8 = (((tmpvar_6.xy/tmpvar_6.w) + 1.0)/2.0); 
    tmpvar_2 = (tmpvar_8 - tmpvar_7); 
    mediump vec4 tmpvar_9; 
    tmpvar_9.zw = vec2(0.0, 1.0); 
    tmpvar_9.xy = tmpvar_2; 
    gl_FragDepthEXT = tmpvar_1.x; 
    gl_FragData[0] = tmpvar_9; 
} 
-------- failed compiling: 
fragment evaluation shader 
0:4: P0003: Extension 'GL_EXT_frag_depth' not supported 
0:6: P0004: High precision not supported, instead compiling high precision as medium precision 
0:38: L0002: Undeclared variable 'gl_FragDepthEXT' 
Note: Creation of internal variant of shader 'Hidden/Internal-MotionVectors' failed. 
WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Pass '' has no vertex shader 
WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Setting to default shader. 
UnloadTime: 4.557000 ms 
Unloading 4 Unused Serialized files (Serialized files now loaded: 0) 

Unloading 8 unused Assets to reduce memory usage. Loaded Objects now: 844. 
Total: 4.570000 ms (FindLiveObjects: 0.397000 ms CreateObjectMapping: 0.061000 ms MarkObjects: 3.410000 ms DeleteObjects: 0.691000 ms) 

Unloading 2 Unused Serialized files (Serialized files now loaded: 0) 

Unloading 94 unused Assets to reduce memory usage. Loaded Objects now: 1056. 
Total: 16.380001 ms (FindLiveObjects: 0.444000 ms CreateObjectMapping: 0.075000 ms MarkObjects: 3.665000 ms DeleteObjects: 12.190001 ms) 

[UnityLauncher] Stop Game 

編集 Textures loads in editor but not in standalone (appears pink) 私はかなりかかわらず、解決策を得ることはありません。プリフォーマットされたシェーダを選択するときには選択肢がありません。また、私は標準のシェーダーを使用しているので、これは問題ではないと思います。

編集2: さて、私はこの記事に出くわしたいくつかのより多くの研究の後:http://answers.unity3d.com/questions/939160/getting-pink-textures-in-build.html 私が常に含まシェーダに私のシェーダ(消灯/テクスチャ)を追加する必要がありそうです。しかし、これはピンクの代わりにボックスを白に変更するだけです。 Legacy/Diffuseと同じように、常にシェーダに含まれています。

+0

Samsung製の年は何年ですか?モデル番号は何ですか? – Programmer

+0

15と16の両方のモデルでテストされています。 – Sundanian

答えて

1

私は解決策を見つけました。

編集1のリンクに書かれているように、編集>プロジェクト設定>グラフィックスの両方のシェイダーを「常に含まれるシェーダ」に含める必要がありました。 その後、私の資産フォルダにShaderVariantを保存し、そのバリアントを "Shader Preloading"に追加する必要がありました。

+1

ニース。このような問題は解決策を見つけるのが難しいです。おめでとう! – Programmer

1

SamsungTVのログに次のような行があります。-------- Shader compilation failed Shaderがコンパイルに失敗し、ピンク色のものが正常に動作するようになりました。

シェーダはデバイス上でコンパイルしてもうまく動作しますが、他のシェーダではうまく動作しません。それは正常です。組み込みの標準シェーダを使用している場合は、SamsungTVデバイスをサポートするシェーダにサブシェーダを含めてください。あまりにもこの部分に

ご注意:私は見ることができるものから、

fragment evaluation shader 
0:4: P0003: Extension 'GL_EXT_frag_depth' not supported 
0:6: P0004: High precision not supported, instead compiling high precision as medium precision 
0:38: L0002: Undeclared variable 'gl_FragDepthEXT' 
Note: Creation of internal variant of shader 'Hidden/Internal-MotionVectors' failed. 
WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Pass '' has no vertex shader 
WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Setting to default shader. 

は、あなたのシェーダが宣言されていないその型の変数gl_FragDepthEXTにつながるGL_EXT_frag_depthと呼ばれる、サポートされていないライブラリを使用しています。

+0

私はUnlit/Textures、Legacy/Diffuse、Standard、Mobile/Unlit、Mobile Diffuseを試しました。すべてピンクですが、レガシー/拡散します。それは白です。 OPで書いたように、あなたが見たものを見て、さまざまなシェーダーでテストしました。 違う結果はありません。だから私の結論は、私のテクスチャーアトラスで何かでなければならないということです。私はちょうど何が見えないのですか? – Sundanian

関連する問題