- Home /
texture/mesh/shader problem on Android
Hi everybody, I got a really strange drawing problem on my android devices. You can see the problem on this video link : http://youtu.be/sb20BbitsOI
As you can see there is some clipping on my screen on Android device, here it's in the editor for Android build but I've got the same problem on my devices. My project is already done for ios & PC/MAC and I never encountered this problem on others OS :/. Someone got an explanation ?
I try to compressed my texture in those mod : DXT1 RBG / DXT5 RGBA / Automatic compressed / RGBA32 and the problem is still here. Maybe it's my shader but it's a mobile/Diffuse so I don't think this can be the problem é_è.
And I don't know why the mesh can create this problem ?
If someone got an idea or want more informations to answer me I'm still here ;)
Thanks in advance for your help
No the clipping part I circled them with the mouse. What do you mean by creamy-white part ? This clipping is really annoying cause we can see it everywhere on mesh junction :/
On mesh junction you can see some blink. I think it's a Z-Depth problem when 2 meshs got their points really close one from another. But I really don't know why é_è. Here an other example of what I say : http://uppix.net/e/6/2/1ba9f1ed0089172dac3500bdb65f8.png
I just can't :).
First of all I'm not graphist ;D.
Second : Some parts of races are procedurally generated so I can say match exactly at this point or this point.
Third : I've no problem on others OS / Device. This only happen on Android and I've really no idea of why :x
$$anonymous$$aybe I can try to create a new shader like $$anonymous$$obile/Diffuse but with forcing Z-Depth testing to anoter.
Answer by SarperS · Nov 02, 2012 at 09:52 AM
Try increasing the near clipping plane value of your main camera. Below is from the Unity manual;
If you are experiencing depth artifacts (surfaces close to each other flickering), try setting Near Plane to as large as possible.
I try too enlarge the near plane but seems change nothing. I currently revert all my texture too initial settings -_-.
Then I gonna retry with primary settings and check. If it's correct nothing, I gonna try with this tutorial : http://www.burgzergarcade.com/tutorials/game-engines/unity3d/unity-ios-shaderlab-tutorial-10-2-offset $$anonymous$$aybe this can help me to find where is this naty problem :)
I gonna try now. The revert is over and the problem seems still here. I check with the far plan closer but the editor want it like this so I don't this can be a viable solution but I gonna try.
Edit : I define my near plane to 0.1 and far plane to 500 and this doesn't work either :/
I try with the shader and the offset but it's a viable solution as I expected :/ cause when you have 2 meshs with Shader offset parameter the conflict is still here :/.
I can't redo the meshs, trilinear texture change nothing, Texture parameters change nothing, Camera no either, ... really weird case but actually no solution from my side
I take a new screenshot, if someone can explain me how to correct this. I can give you more screenshot and explanation on what I've done or how my elements are configured if needed.
So, to close this topic I can say thanks to Sarper Soher cause scale the Znear of the camera to 1 cause it was to 0.01 solve my problem !
Thanks again :)
Answer by Michael CMS · Nov 02, 2012 at 09:57 AM
Hello,
If you are refering to the flickering it looks like z Fighting. Since you said you tried using DXT I take it you are using a Tegra android device ?
The tegra devices have a limit of a 16 bit depth buffer so you cannot solve this by increasing the depth buffer size.
What you can do :
alter the geometry a bit so vertices are a bit farther away from each other
bring closer the far plane
Another test I encourage you to do is to see if the flicker appears on a Galaxy S (it has PVR GPU , similar to iPhone). If the flicker doesn't show on Galaxy S , then it's the Z Fighting problem I've described above.
I gonna revert all my textures to begin I probably too much alterate them.
Yes I test this on Android Tegra device. And using DXT texture was to optimize them for this sort of device. The game probably doesn't work on a Galaxy S device cause too much memory using :/. I know it's not really nice but when I picked up the project this was already like that é_è.
So I just test on Galaxy S2 and sup, at the office I just got this : Galaxy Tab 10.1, HTC One S, Nexus S & Galaxy S.
Answer by SarperS · Nov 02, 2012 at 03:40 PM
In the Build Settings Inspector, under the resolution and presentation tab, make sure the "Use 24 bit depth" is checked. Most Android devices use 16 bit depth buffer by default. This way Unity will try to force a 24 bit depth buffer.
I already try this and this is not resolve my problem :/ $$anonymous$$aybe I must do an answer or a comment with all the possibilities I already try ?
This maybe can help you to find my issue ^^