Let me just leave this here:
presentation
... and that links...
Practical Guide to Optimization for Mobiles (Unity Manual)
Optimizing Graphics Performance (Unity Manual)
Profiler (Unity Manual)
ShadowGun: Optimizing for Mobile Sample Level (Unity Blog)
“Fast Mobile Shaders” talk at SIGGRAPH 2011 (Unity Blog) - highly recommend to anyone who writes unity shaders
http://malideveloper.arm.com/
OpenGL ES 3.0 Developer Resources (Mali Developer Center) - now it's not widespread, but it seems to be very popular and effective in near future!
ASTC Texture Compression: ARM Pushes the Envelope in Graphics Technology (ARM Blogs)
пятница, 20 сентября 2013 г.
понедельник, 16 сентября 2013 г.
Optimize performance in Unity3d: practical notes
(Russian post goes here)
I wrote an article in russian about unity performance optimization recently. In this topic I want to share some small, but efficient practical tips with you. Here we go:
P.S. We are applying all this tips in game named technoball, so please free to try it and tell me what you think about it.
P.P.S We made a lot of work and prepared an awesome update, stay in touch!
I wrote an article in russian about unity performance optimization recently. In this topic I want to share some small, but efficient practical tips with you. Here we go:
- if you're running out of memory, use proper texture compression. PVRTC is acceptable for iOS, DXT for android. And don't forget about mip-maps. I know, it gonna increase binary size by 30%, but it's worth it. Don't be so modest to limit max size to textures.
- If you don't need shadows in renderers (for example, in UI or something), just uncheck "Receive shadows" & "Cast shadows" options. They are always on by default.
- Don't forget about batching. And yes, static batching allows much more than dynamic, so you don't move object, mark it as static. If you want to combine meshes runtime, use StaticBatchingUtility.Combine.
- Take into account renderer settings, physics settings of project (Edit->Project settings)
- Anti-aliasing, texture quality, shadows and vsync have many options. Just experiment with them to gain best performance/quality.
- Uncheck layer collision checks you don't need to calculate.
- If you don't really need physics, change fixed timestep.
- Don't move static objects.
- Design your level, so your camera will not take a lot of objects, then camera culling will save a lot of frames for you.
- Mesh collider checks are very expensive! It's better to use double-check technique: firstly make a capsule or box collider and check with it's collision, then check with mesh collider.
- Lights. Know the difference between point & directional, use them properly.
- Cache transform, collider, rigidbody. We use CachedMonoBehaviour in our projects and happy with that (P.S. From 4.1 Unity did a lot of work with GetComponent optimization, but CachedMonoBehaviour is still faster).
You may achieve better results if you know instruments you use. These tips are really easy to use and sometimes they give more performance than it's expected. Use it and know, premature optimization is root of all evil.
P.S. We are applying all this tips in game named technoball, so please free to try it and tell me what you think about it.
P.P.S We made a lot of work and prepared an awesome update, stay in touch!
воскресенье, 8 сентября 2013 г.
Мысля про скриншоты
Оказывается, "бухгалтероподобным" людям тяжело сделать скриншот и поделиться с друзьями. И вправду, я не умею стандартными средствами делать скриншот быстрее, чем следующими операциями:
Как можно убыстрить этот процесс:
- нажать prtscr
- открыть paint(быстрее, чем нажать пуск, набрать mspaint я не умею)
- вставить рисунок
- сохранить
- открыть файлопомойку, залить файл
- получить ссылку, поделиться
Как можно убыстрить этот процесс:
- Воспользоваться связкой макинтош+дропбокс(кхе-кхе). В маке я делаю в три операции: делаю скриншот сразу в десктоп (cmd+shift+3), кидаю в паблик дропбокс, получаю ссылку из дропбокса
- Воспользоваться сервисом snag.gy. Смысл таков: нажимаете prtscr, открываете сайт, нажимаете вставить(если нужно, корректируете встроенным редактором), сохраняете, делитесь. Примерно так же быстро, как в маке.
- Наверняка есть уже готовые сервисы-демоны, которые висят в системе, при нажатии магического шортката делают скриншот, аплодят в файловую помойку и показывают ссылку. Если кто знает о таких, пожалуйста, поведайте! Если нет, скажите, если бы была такая прога, скажите, пользовались бы вы им?
четверг, 22 августа 2013 г.
Facebook left-side menu with storyboards
Well, facebook-like left-side menus became really trendy UI pattern, so everyone tries to insert it to their projects.
Functionally it's primitive: you have left-view in background, and there's drag gesture recognizer, which "catches" foreground view and moves it on xz-direction.
There are lots of open source implementations for ios:
ViewDeck
SASlideMenu
JWSlideMenu
DDMenuController
PKRevealController
ECSlidingViewController
MWFSlideNavigationViewController
MFSideMenu
HHTabListController
MTSlideViewController
SlideViewController
MTStackViewController
MMDrawerController
I'd recommend to use ViewDeck and SASlideMenu, because they are the most functional and easiest to integrate (For android developers it's worth to mention this stackoverflow answer).
Functionally it's primitive: you have left-view in background, and there's drag gesture recognizer, which "catches" foreground view and moves it on xz-direction.
There are lots of open source implementations for ios:
But there was a problem related to storyboards: there's no out-of-box solution to integrate left-side menu with storyboards power! Recently I found really easy to use framework: ViewDeckStoryBoards. Hooray, there's no need to revert back to xibs nightmare! It's based on viewDeck, there's a little code needed(just to overwrite left side & main windows). It supports arc, storyboards.
суббота, 29 июня 2013 г.
Принцип самурая или почему надо радоваться преждевременным ошибкам
Делаем игру с командой и часто инспектируем код друг друга.
Натолкнулся вот на это:(ссылка)
Натолкнулся вот на это:(ссылка)
Коротко: есть кнопки, и при запуске подписываются обработчики. Все хорошо, код абсолютно безопасен. Но он плох. Почему?
void Awake (){saveDirPath = Application.dataPath + "/Levels/";if (buttonSave != null) {UIEventListener.Get (buttonSave.gameObject).onClick += OnButtonSave_Click;}if (buttonLoad != null) {UIEventListener.Get (buttonLoad.gameObject).onClick += OnButtonLoad_Click;}if (buttonInputDialogOk != null) {UIEventListener.Get (buttonInputDialogOk.gameObject).onClick += OnButtonInputDialogOk_Click;}if (buttonInputDialogCancel != null) {UIEventListener.Get (buttonInputDialogCancel.gameObject).onClick += OnButtonInputDialogCancel_Click;}if (buttonselectLevelDialogClose != null) {UIEventListener.Get (buttonselectLevelDialogClose.gameObject).onClick += OnButtonselectLevelDialogClose_Click;}}
воскресенье, 23 июня 2013 г.
Почему Unity?
Меня попросили написать короткую статью о том, зачем нужен unity3d и почему я пользуюсь именно им. Решил поделиться своими мыслями здесь, в блоге и постраться не создать очередной холливарной статьи :)
Рынок мобильных приложений, в частности, мобильного гейм-дева, такой, как сейчас, появился совсем недавно - в 2008-2009 году, почти сразу после появления революционного по тем меркам гаджета под названием iphone. А поскольку игры на мобильных начали пользоваться бешенным спросом, то программисты начали делать все, чтобы этот спрос удовлетворить. Совсем скоро начали появляться движки для создания мобильных игр, такие как shiva3d, cocos2d, airplay sdk(сейчас marmalade), corona sdk, unreal engine для мобилок(ограниченный udk), unity3d и так далее. У меня был совсем маленький опыт разработки под marmalade, немножко поигрался с udk, но больше всего мне понравился unity3d.
Чем же привлекателен лично для меня unity3d:
Рынок мобильных приложений, в частности, мобильного гейм-дева, такой, как сейчас, появился совсем недавно - в 2008-2009 году, почти сразу после появления революционного по тем меркам гаджета под названием iphone. А поскольку игры на мобильных начали пользоваться бешенным спросом, то программисты начали делать все, чтобы этот спрос удовлетворить. Совсем скоро начали появляться движки для создания мобильных игр, такие как shiva3d, cocos2d, airplay sdk(сейчас marmalade), corona sdk, unreal engine для мобилок(ограниченный udk), unity3d и так далее. У меня был совсем маленький опыт разработки под marmalade, немножко поигрался с udk, но больше всего мне понравился unity3d.
Чем же привлекателен лично для меня unity3d:
пятница, 21 июня 2013 г.
Подписаться на:
Сообщения (Atom)

