- Home /
Mesh Swap vs Run-time Material Change..
Helloz
Im working on an IOS game, and wanted to ask about optimisation.
The Simple scenario is:
I have many Red textured balls (Prefabs) and when i tap one, that one turns into a Yellow textured ball.
I know of 4 options to do this:
1) Material Changing via Renderer.material
2) Instancing a new Yellow Mesh, and change the mesh
3) 2 Objects parented an empty game object... Hide one, show the other..
4) An object with 2 UV sets? And just switch UV mapping coordinates... (have only read about it)
Question: Would like to ask if anyone knows what would be the FASTEST processing/ least memorage method of implementing this mechanic for mobile. Or what is your preferred way of doing it ..?
Thanks!!!!
material changing via randerer.materail is easy and fast i think so. But i also worked on that. In before versions it is working fine but in latest free versions it's not. Only in the inspector view it is changing. not in the game view.
I think u can get 30days trail for ios also.
meshes and renders are same i think show.
Thanks Shankar....Ya my 30 days have been used up already :(
Though I've read somewhere that its best not to Swap $$anonymous$$aterials too much during runtime. I definitely prefer it though, since its much easier to implement.
Answer by Fattie · Apr 09, 2013 at 07:59 AM
FWIW
solution (3) is the totally ordinary solution you would see in millions of video game projects.
performance concerns are totally irrelevant here. to be honest (just as a scientific question) I doubt there'd even be an answer to "what is more performant" -- they all use "no" horsepower and it would depend entirely on the game you are doing, the particular details. other issues like culling, phsyics etc. would utterly, utterly swamp the trivial performance issues involved.
(If you are doing some sort of UNUSUAL PROJECT -- ie you 'forgot to mention" you have 18 million balls, or 82,000 colors, or you must change colors every millionth of a second, or whatever ... then that is a separate specific question.)
Honestly the answer is just "3 .. get on with it". It's that simple. Performance is totally irrelevant in this question on mobile.
Suggest you CLOSE OUT (tick any answer) this question and move on to a new specific questions if you have one
Sorry... i didn't know. I was concerned that it may cause a moment of choke, combining with everything else that's happening. (Didnt mention its for Ipad 1 / 3Gs.. every 1 extra FPS counts... >.<)
I've read at random posts not to Instance stuff too much, or not even to use $$anonymous$$aterial change, yet i see some others do it. Just needed a solid confirmation on what i need to do. Thanks for taking the time to answer.
you should post a new, more specific question, like "performance of instancing a new mesh" Good luck!