Quantcast
Viewing latest article 19
Browse Latest Browse All 38

Game Works on Computer, but not on iPhone

Ok, I have been working incredibly hard on getting a script to work. This script however uses a depth mask shader. This shader works fine on the computer, but when I export it to the iPhone, the iPhone crashes when trying to render the depth mask. I have looked on the profiler and there is a slight increase in work load (.2ms/frame) but it is not noticeable. What could be causing the crash? I am almost positive I have worked with depth mask shaders before and made them run on the iPhone. The shader I am using for the depth mask is below. In Xcode, I get a a Exec_bad_access error and I also get another weird error: Unhandled Exception: System.NullReferenceException: Current language: auto; currently c++ The part of the code to handle the depth mask does use C#, but I have used c# elsewhere in my code and it has not made a difference. What is weird, is that this shader works on another application fine even on the iPhone. Is there anyway for me to debug the Xcode error and see what exactly has gone wrong in my unity script? Thanks for any help. Shader "DepthMask" { Properties { _Color ("Main Color", Color) = (1,1,1,1) } SubShader { Tags { "Queue" = "Geometry-101" } // Draw into the depth buffer in the usual way. This is probably the default, // but it doesn't hurt to be explicit. ZTest LEqual ZWrite On // Don't draw the RGB colour channels, just the alpha channel. This means // that nothing visible is drawn. Ideally, I would have liked to set ColorMask // to draw nothing at all, but it doesn't seem to be possible to say anything // like ColorMask None. ColorMask A // Do nothing specific in the pass: Pass { // Turn off lighting, because it's expensive and the thing is supposed to be // invisible anyway. Lighting Off Color [_Color] } } FallBack "Diffuse", 1 }

Viewing latest article 19
Browse Latest Browse All 38

Trending Articles