Unity官网针对IOS开发有比较好的建议,我总结了翻译如下,后面附上原文。

  • 尽量控制定点数量(注意所谓顶点不是建模时的顶点,而是引擎渲染时的顶点。例如,模型一个顶点如果设置了2个法向,那么对引擎来说就是2个顶点) :

    • 对Iphone3或更高设备,每帧渲染的顶点不超过4万个
    • 对更早的设备,每帧渲染的顶点不超过1万个
  • 场景所用的材质尽量减少。即使是不同的物件,也尽量采用同一个材质。
  • 将固定的场景物件设置为静态(static)。
  • 尽量使用PVRTC(这是Apple推荐的一种格式)纹理,不行的话,也尽量用16位纹理取代32位的。
  • 不要在shader中使用multi-pass,通过用混合或者像素shader来合并不同的纹理以达到相同效果。
  • 如果自行编写shader,尽量避免使用浮点数。下面是建议的类型:
    • fixed/lowp——适用于颜色,光照等
    • half/mediump——适用于纹理UV
    • float/highp——避免在像素shader里使用,可以在顶点shader里面用于计算顶点位置
  • 在像素shader中尽量少用复杂的数学计算,例如幂函数、三角函数等。
  • 没必要的话不要使用像素光照(Pixel Lights)
  • 不要使用动态光照,用烘焙的lightmap
  • 不要使用alpha测试,用alpha混合来代替
  • 不要使用雾
  • 大场景中使用Occlusion culling来削减不可见区域。关卡设计时考虑到实施 Occlusion culling 的便利性
  • 使用sky box 来实现远景

原文如下:

  • Keep vertex count below:

    • 40K per frame when targeting iPhone 3GS and newer devices (with SGX GPU)
    • 10K per frame when targeting older devices (with MBX GPU)
  • Keep the number of different materials per scene low - share as many materials between different objects as possible.
  • Set Static property on a non-moving objects to allow internal optimizations.
  • Use PVRTC formats for textures when possible, otherwise choose 16bit textures over 32bit.
  • Use combiners or pixel shaders to mix several textures per fragment instead of multi-pass approach.
  • If writing custom shaders, always use smallest possible floating-point types:
    • fixed / lowp -- perfect for color, lighting information and normals,
    • half / mediump -- for texture UV coordinates,
    • float / highp -- avoid in pixel shaders, fine to use in vertex shader for vertex position calculations.
  • Minimize use of complex mathematical operations such as pow, sin, cos etc in pixel shaders.
  • Do not use Pixel Lights when it is not necessary -- choose to have only a single (preferably directional) pixel light affecting your geometry.
  • Do not use dynamic lights when it is not necessary -- choose baking lighting instead.
  • Choose to use less textures per fragment.
  • Avoid alpha-testing, choose alpha-blending instead.
  • Do not use fog when it is not necessary.
  • Learn benefits of Occlusion culling and use it to reduce amount of visible geometry and draw-calls in case of complex static scenes with lots of occlusion. Plan your levels to benefit from Occlusion culling.
  • Use skyboxes to "fake" distant geometry.

Unity官网针对IOS开发有比较好的建议的更多相关文章

  1. Unity 官网无法访问|国外网站访问过慢|国外网站访问加速器

    目录 1. 文档地址 2. 按 3. 工具下载地址 1. 文档地址 GitHub博客 https://coco5666.github.io/blog/articles/20190704-01/ 2. ...

  2. unity官网安装教程

    于今天起记录与回忆游戏开发相关一些小目标 2020-12-01 第一篇正式的博客就从软件的安装开始吧 unity个人版是免费的不用刻意去找破解版什么的 unity官网安装 1.unity.cn uni ...

  3. Unity官网教程之Tips

    前言 翻译整理unity官网教程的tips部分,原文:http://unity3d.com/cn/learn/tutorials/topics/tips Snap 按住Ctrl键,并用鼠标拖动Game ...

  4. Unity 官网教程 -- Multiplayer Networking

    教程网址:https://unity3d.com/cn/learn/tutorials/topics/multiplayer-networking/introduction-simple-multip ...

  5. iOS开发学习路径的一些建议

    结合自己情况聊下iOS学习建议,这里不讲大道理,说说具体怎么做.欢迎大家拍砖. 1.第一点要求 ,能比较顺畅的阅读官方的文档 如果你连官方的文档读起来都非常困难,那你还谈什么提高和进阶,咱们学习iOS ...

  6. Spring boot 官网学习笔记 - 开发第一个Spring boot web应用程序(使用mvn执行、使用jar执行)

    Creating the POM <?xml version="1.0" encoding="UTF-8"?> <project xmlns= ...

  7. 几个比較好的IT站和开发库官网

    几个比較好的IT站和开发库官网 1.IT技术.项目类站点 (1)首推CodeProject,一个国外的IT站点,官网地址为:http://www.codeproject.com,这个站点为程序开发人员 ...

  8. 几个比较好的IT站和开发库官网

    1.IT技术.项目类网站 (1)首推CodeProject,一个国外的IT网站,官网地址为:http://www.codeproject.com,这个网站为程序开发者提供了很好的代码示例以及讲解,不过 ...

  9. iOS:iOS开发非常全的三方库、插件等等

    iOS开发非常全的三方库.插件等等 github排名:https://github.com/trending, github搜索:https://github.com/search. 此文章转自git ...

随机推荐

  1. 快速排序——PowerShell版

    继续读啊哈磊算法有感系列,继续升华.上一篇是冒泡排序,在结尾总结了一下冒泡排序的缺点——时间复杂度O(N*N)太大.这一篇来说一下快速排序,快速排序可以在多数情况下克服冒泡排序的缺点(最坏的情况下和冒 ...

  2. URLConnection格式与用法

    private void getdialog() { final EditText et = new EditText(this); final String workid = this.workid ...

  3. Android开发日记(一)

    实现点击一个图片按钮跳转到一个动作ImageViewSchoolCard = (ImageView) view.findViewById(R.id.ImageViewLostThings); Imag ...

  4. 使用matplot做图--sin图像

    # _*_ coding:utf-8 _*_ import numpy as np import matplotlib.pyplot as plt x = np.arange(-5, 5, 0.1) ...

  5. python基础系列教程——Python中的编码问题,中文乱码问题

    python基础系列教程——Python中的编码问题,中文乱码问题 如果不声明编码,则中文会报错,即使是注释也会报错. # -*- coding: UTF-8 -*- 或者 #coding=utf-8 ...

  6. Nutch系列1:简介

    由Java实现的,开放源代码(open-source)的web搜索引擎. Nutch 致力于让每个人都能很容易, 同时花费很少就可以配置世界一流的Web搜索引擎. 为了完成这一宏伟的目标, Nutch ...

  7. web工程jar包问题

    JRE System Library主要存放J2SE的标准jar,一般不需要调整. Referenced Libraries是存放第三方的jar包,也就是自己导入的jar包.在项目属性的Java Bu ...

  8. laravel 5.1 性能优化对比 - 框架提供的方法

    写了一个项目发现性能不如人意. 于是便测试下, 看下性能瓶颈在什么地方. 使用 ab -n 20 http://www.lartest.com/ 软件环境: OS : windows 8.1 CPU: ...

  9. 彻底解决java WEB项目的文件路径问题(war包)

    在j2EE项目中,我们通常会把项目打包公布,通常是war包,作为独立单元,能够远程上传,载入,公布,还能够实现版本号控制,但这与我们开发过程中使用MyEclipse自己主动部署有所不同,下面做具体说明 ...

  10. 标题添加菜单HeaderContextMenu

    <!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Co ...