- Home /
Mobile bump performance
Hello! I am trying to define a workflow for the creation of assets but I don't want to make a lot of assets that look more or less good and then realize they totally kill performance on our target platform which is iPhone and Android.
Right now I really like what you can do with normal maps, and the game we are trying to create will be more or less a puzzle of objects (~150 triangles each) floating on the air. There will be a fixed number of these objects that repeat on each level, say 5 or 6 different ones repeated 6 times or so, that way I wouldn't be using that many different textures. One light should suffice, and maybe lineal fog?
The question is, can I get away with using normal maps on most of these objects? or even on a few of them? How would it compare on the ipad, iPhone 4 and 3Gs? I heard horrors about using normals on mobile but I still have a hope it can be done :). I would only be using mobile bump materials without specular.
thanks in advance
Answer by Jessy · Jan 28, 2012 at 02:18 AM
Normal mapping is a per-pixel effect. Number of objects doesn't matter; what matters is how many pixels are drawn with the normal mapped shader. If you can use object space normal mapping, you have nothing to worry about. If you need tangent space normal mapping, then you'll need to be more careful when writing your shaders. That's assuming the one light you mentioned. Every additional light is going to require an extra pass, and that can easily destroy performance.
Answer by Agilulfo · Jan 28, 2012 at 03:48 AM
thanks a lot Jessy, that is some interesting information!. I didn't know there were more than one type of normal maps, I'm reading this website now which seems to explain some of it. I believe I can use object space normal maps because the objects will not be deformed and the only character will not have a bump map. Unfortunately I have no idea how to write shaders (although I remember bookmarking your tutorials on youtube some time ago) so I am not sure how to tell unity what type of map I am using or how to convert tangent space normal maps to object space normal maps. Can you point me to resources or tools that do these things?
thanks again!
That page seems pretty helpful. One thing isn't necessarily true, though – I think you'd have to make an effort to make an object space normal mapped shader not perform as well as a world space one; Unity provides some data in object space and other data in world space, and you generally have to transform some of that, in the vertex shader. Tangent space normal mapping is slower in both the vertex and pixel shader, however, and the latter is what really matters, unless your models are ridiculously high-poly. Aside from deformation, you also can't do correct tiling without a tangent space normal map, unless your mesh is planar.
The shader videos I have up at this point unfortunately don't go into normal mapping. Here are some resources to check out: http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-4.0a-$$anonymous$$assive-Improvements http://unity3d.com/support/documentation/Components/SL-SurfaceShaders.html http://en.wikibooks.org/wiki/GLSL_Program$$anonymous$$g/Unity
P.S. You really should have written that as a comment, not an answer. I'd care more if the comments were as easy-to-read as the answers. :-P
oops, sorry, didn't quite get the answer system here. thanks again for the info. so happy to find more about normals :D . will be looking into the links. I did download Strumpy today, still haven't looked at it.
Your answer
Follow this Question
Related Questions
Halo effect perfomance on mobile devices 1 Answer
Slow Startup on iOS and Android 1 Answer
Performance lag every 1 second on iphone 4s 2 Answers
Shader performance question. 0 Answers