PDA

View Full Version : Shader code in Logcat on Android then crashes my newly build APK



Ginxx009
01-08-2018, 11:24 PM
On my logcat it says



#version 100
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef SHADER_TARGET
01-09 11:34:55.899 23467-23515/? D/Unity: #define SHADER_TARGET 30
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_NO_DXT5nm
01-09 11:34:55.899 23467-23515/? D/Unity: #define UNITY_NO_DXT5nm 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_NO_RGBM
01-09 11:34:55.899 23467-23515/? D/Unity: #define UNITY_NO_RGBM 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef
UNITY_ENABLE_REFLECTION_BUFFERS
01-09 11:34:55.899 23467-23515/? D/Unity: #define
UNITY_ENABLE_REFLECTION_BUFFERS 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef
UNITY_FRAMEBUFFER_FETCH_AVAILABLE
01-09 11:34:55.899 23467-23515/? D/Unity: #define
UNITY_FRAMEBUFFER_FETCH_AVAILABLE 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_NO_SCREENSPACE_SHADOWS
01-09 11:34:55.899 23467-23515/? D/Unity: #define UNITY_NO_SCREENSPACE_SHADOWS 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_PBS_USE_BRDF2
01-09 11:34:55.899 23467-23515/? D/Unity: #define UNITY_PBS_USE_BRDF2 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef SHADER_API_MOBILE
01-09 11:34:55.899 23467-23515/? D/Unity: #define SHADER_API_MOBILE 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_HARDWARE_TIER2
01-09 11:34:55.899 23467-23515/? D/Unity: #define UNITY_HARDWARE_TIER2 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_COLORSPACE_GAMMA
01-09 11:34:55.899 23467-23515/? D/Unity: #define UNITY_COLORSPACE_GAMMA 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef UNITY_VERSION
01-09 11:34:55.899 23467-23515/? D/Unity: #define UNITY_VERSION 561
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef SHADER_STAGE_VERTEX
01-09 11:34:55.899 23467-23515/? D/Unity: #define SHADER_STAGE_VERTEX 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #ifndef SHADER_API_GLES
01-09 11:34:55.899 23467-23515/? D/Unity: #define SHADER_API_GLES 1
01-09 11:34:55.899 23467-23515/? D/Unity: #endif
01-09 11:34:55.899 23467-23515/? D/Unity: #define gl_Vertex _glesVertex
01-09 11:34:55.899 23467-23515/? D/Unity: attribute vec4 _glesVertex;
01-09 11:34:55.899 23467-23515/? D/Unity: #define gl_MultiTexCoord0 _glesMultiTexCoord0
01-09 11:34:55.899 23467-23515/? D/Unity: attribute vec4 _glesMultiTexCoord0;
01-09 11:34:55.899 23467-23515/? D/Unity: #line 440
01-09 11:34:55.899 23467-23515/? D/Unity: struct v2f_vertex_lit {
01-09 11:34:55.899 23467-23515/? D/Unity: highp vec2 uv;
01-09 11:34:55.899 23467-23515/? D/Unity: lowp vec4 diff;
01-09 11:34:55.899 23467-23515/? D/Unity: lowp vec4 spec;
01-09 11:34:55.899 23467-23515/? D/Unity: };
01-09 11:34:55.899 23467-23515/? D/Unity: #line 728
01-09 11:34:55.899 23467-23515/? D/Unity: struct v2f_img {
01-09 11:34:55.899 23467-23515/? D/Unity: highp vec4 pos;
01-09 11:34:55.899 23467-23515/? D/Unity: mediump vec2 uv;
01-09 11:34:55.899 23467-23515/? D/Unity: };
01-09 11:34:55.899 23467-23515/? D/Unity: #line 722
01-09 11:34:55.899 23467-23515/? D/Unity: struct appdata_img {
01-09 11:34:55.899 23467-23515/? D/Unity: highp vec4 vertex;
01-09 11:34:55.899 23467-23515/? D/Unity: mediump vec2 texcoord;
01-09 11:34:55.899 23467-23515/? D/Unity: };
01-09 11:34:55.899 23467-23515/? D/Unity: #line 20
01-09 11:34:55.899 23467-23515/? D/Unity: struct v2f {
01-09 11:34:55.899 23467-23515/? D/Unity: highp vec4 pos;
01-09 11:34:55.899 23467-23515/? D/Unity: mediump vec2 uv;
01-09 11:34:55.899 23467-23515/? D/Unity: };


And it's way too long . It looks like a shader code.

The device that i am using is Samsung Galaxy S7. On the emulator it's working perfectly well. Anyone who has an idea what's going on and why a shader code is appearing on my logcat.
By the way i have a code on my BuildEditor.cs cause i guess its affecting the crash??



//Setup Graphics for Android only!
QualitySettings.antiAliasing = 0;
Application.targetFrameRate = 30;
QualitySettings.vSyncCount = 0;

if(qualityLevel == 0){
QualitySettings.shadowCascades = 0;
QualitySettings.shadowDistance = 15;
} else if(qualityLevel == 5){
QualitySettings.shadowCascades = 2;
QualitySettings.shadowDistance = 50;
}

PlayerSettings.SetGraphicsAPIs (BuildTarget.Android, new [] {UnityEngine.Rendering.GraphicsDeviceType.OpenGLES 2});

Screen.sleepTimeout = SleepTimeout.NeverSleep;


Thank you anyone in advance if someone can give me some idea/solution on what going on :)

Ginxx009
01-09-2018, 12:29 AM
It's solved now . By using opengles3.0 and not opengles2.0 keeps my newly build app run smoothly and perfect on my device :o