用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:shadervariantcollection:shadervariantcollection

ShaderVariantCollection 着色器变体集合

Namespace: UnityEngine/Inherits from: Object

Description 描述

ShaderVariantCollection records which shader variants are actually used in each shader.

ShaderVariantCollection 记录在每个着色器中哪些着色器变体是实际使用的。

This is used for shader preloading (“warmup”), so that a game can make sure “actually required” shader variants are loaded at startup (or level load time), to avoid shader compilation related hiccups later on in the game.

这是用于着色器预加载(“预热”),这样一个游戏就可以确保“实际上需要“着色器变体在启动时加载(或加载效率),以避免以后在游戏中着色器编译相关卡顿。

In Unity, many shaders internally have multiple “variants”, to account for different light modes, lightmaps, shadows and so on. These variants are indentified by a shader pass type, and a set of shader keywords. See ShaderVariant.

在Unity中,许多着色器内部有多个“变体”,具备不同的光模式,以及光照贴图、阴影等等。这些变异是利用着色器传递类型和一组着色器关键词识别。见:ShaderVariant。

Typical use of ShaderVariantCollection is to record the shader variants used during a play session from the editor (under Graphics Settings), save them out as an asset, and add to the list of preloaded shaders (again in Graphics Settings). Additionally, you could call WarmUp on a ShaderVariantCollection object manually.

ShaderVariantCollection是记录的典型使用着色器变异戏剧会话期间使用的编辑器(在图形设置),拯救他们作为一种资产,增加预加载的列表着色器在图形设置(再一次)。此外,你可以叫手动预热ShaderVariantCollection对象上。

ShaderVariantCollection generally replaces the old Shader.WarmupAllShaders function.

ShaderVariantCollection通常替换旧材质。WarmupAllShaders函数。

Variables 变量

isWarmedUpIs this ShaderVariantCollection already warmed up? (Read Only)
ShaderVariantCollection 是否已经预热?(只读)
shaderCountNumber of shaders in this collection (Read Only).
。在该碰撞体中着色器的数量(只读)。
variantCountNumber of total varians in this collection (Read Only).
)。
在集合中总变量的数量(只读)。

Constructors 构造函数

ShaderVariantCollectionCreate a new empty shader variant collection.
创建一个着色器变体集。

Public Functions 函数

AddAdds a new shader variant to the collection.
在集合中添加一个的变体。
ClearRemove all shader variants from the collection.
在集合中移除所有的变体。
ContainsChecks if a shader variant is in the collection.
检查在集合中是否存在某变体。
RemoveRemove shader variant from the collection.
在集合中移除某个的变体。
WarmUpFully load shaders in ShaderVariantCollection.
在集合中完全加载某着色器。
script/unityengine/classes/shadervariantcollection/shadervariantcollection.txt · 最后更改: 2016/08/02 05:29 (外部编辑)