Unity Manual


  • 首页

  • 分类

  • 公益404

  • 搜索

Accessing and Modifying Material parameters via script

发表于 2017-07-01 | 更新于 2017-07-01 | 分类于 Graphics , Graphics Overview , Materials, Shaders & Textures , Accessing and Modifying Material parameters via script

Accessing and Modifying Material parameters via script

Special requirements for Scripting with the Standard Shader

You must enable the correct Keywords for your required Standard Shader variant

Keyword Feature
_NORMALMAP Normal Mapping
_ALPHATEST_ON “Cut out” Transparency Rendering Mode
_ALPHABLEND_ON “Fade” Transparency Rendering Mode
_ALPHAPREMULTIPLY_ON “Transparent” Transparency Rendering Mode
_EMISSION Emission Colour or Emission Mapping
_PARALLAXMAP Height Mapping
_DETAIL_MULX2 Secondary “Detail” Maps (Albedo & Normal Map)
_METALLICGLOSSMAP Metallic/Smoothness Mapping in Metallic Workflow
_SPECGLOSSMAP Specular/Smoothness Mapping in Specular Workflow

Linear or gamma workflow

发表于 2017-06-30 | 更新于 2017-06-30 | 分类于 Graphics , Graphics Overview , Lighting , Related topics , Linear rendering overview , Linear or gamma workflow

Linear or gamma workflow

  • 图片一般保存在 Gamma 空间

Linear color space workflow

  • gamma texture 将会移除伽玛校正

Linear Textures

  • bypass sRGB Sampling:关闭的话,将会采集 sRGB,使纹理变成 sRGB 格式
  • 如果纹理原本是在 linear 空间的,则需要关闭 bypass sRGB Sampling

Notes

  • 对于 colors,unity 在传入 GPU 前就会使用 floating
  • 对于 texture,unity 会去除伽玛校正
  • 当把结果写进 framebuffer,可能直接使用伽玛校正,或者保留,取决于后面的处理

Gamma Textures with linear rendering

发表于 2017-06-30 | 更新于 2017-06-30 | 分类于 Graphics , Graphics Overview , Lighting , Related topics , Linear rendering overview , Gamma Textures with linear rendering

Gamma Textures with linear rendering

Lightmapping

  • 光照计算是在 linear 下完成的
  • 光照贴图存储是 gamma 空间
  • linear 模式得转换贴图,gamma 模式不用转换(那为什么切换模式需要重新烘焙?)

Importing lightmaps

  • 光照数据 EXR 文件是在 linear 空间创建的,导入的时候会转成 gamma 空间
  • 使用外部光照纹理,纹理标记为 lightmap,这时候 bypass sRGB Sampling 是开启的

Linear supported platforms

  • 如若开启 linear 不支持,将会运行时退出
  • 支持 win,mac,iOS,Android
  • Android 需要 GLES3,Android 4.3
  • iOS 需要 Metal

Linear rendering overview

发表于 2017-06-30 | 更新于 2017-06-30 | 分类于 Graphics , Graphics Overview , Lighting , Related topics , Linear rendering overview

Linear rendering overview

Linear and gamma color space

  • 人眼看光线没有 linear 反应
  • 历史原因,显示器也是用的 gamma 空间
  • gamma 更符合人眼,但是计算如果也是用 gamma,计算的光照强度就不真实

Reducing the file size of your build

发表于 2017-06-30 | 更新于 2017-06-30 | 分类于 Working In Unity , Advanced Development , Reducing the file size of your build

Reducing the file size of your build

Suggestions for reducing build size

Meshes and Animations

  • Mesh 压缩只减少精度,因此只减少硬盘,不减少内存
  • Animation 帧减少,因此硬盘和内存都会减少

DLLs

  • 必有的 dll:mscorlib.dll,Boo.Lang.dll,UnityScript.Lang.dll,UnityEngine.dll

Memory Profiler

发表于 2017-06-30 | 更新于 2017-06-30 | 分类于 Working In Unity , Advanced Development , Profiler overview , Memory Profiler

Memory Profiler

Simple

  • Unity:Unity 占用内存大小
  • Mono:托管块大小
  • GfxDriver:贴图,渲染,Shader,网格内存
  • FMOD:声卡内存大小
  • Profiler:分析模块内存占用

Profiler window

发表于 2017-06-30 | 更新于 2017-06-30 | 分类于 Working In Unity , Advanced Development , Profiler overview , Profiler window

Profiler window

Deep Profiling

  • 使用 Deep 将会分析所有的代码

View SyncTime

  • “Wait For Target FPS”,如果没有开启同步的话,将会显示等待时间
  • 可以关闭

Trouble Shooting

发表于 2017-06-29 | 更新于 2017-06-29 | 分类于 Working In Unity , Creating Gameplay , Trouble Shooting

Trouble Shooting

Shadows

  • 手游不支持软阴影
  • 前向渲染仅支持一个方向光投影

    Some of my objects do not cast or receive shadows

  • 只有不透明物体接受或者投射阴影
  • 顶点 shader 不接受阴影,但是可以投射阴影
  • 只有像素光照投射阴影

Importing from the Asset Store

发表于 2017-06-29 | 更新于 2017-06-29 | 分类于 Working In Unity , Asset Workflow , Importing from the Asset Store

Importing from the Asset Store

Location of downloaded Asset files

  • Mac ~/Library/Unity/Asset Store
  • Win C:\Users\accountName\AppData\Roaming\Unity\Asset Store

1…67
Fly

Fly

作者懒得写

69 日志
113 分类
GitHub CSDN
© 2018 Fly
由 Hexo 强力驱动
主题 - NexT.Pisces
0%