Version: 2020.1

ShaderUtil

class in UnityEditor

切换到手册

描述

可帮助从编辑器与着色器配合使用的 Utility 函数。

静态变量

allowAsyncCompilation为 true 时,允许在当前调用站点中使用异步着色器编译。
anythingCompiling为 true 时,编译器在查询时异步编译一些着色器。
hardwareSupportsRectRenderTexture当前硬件是否支持渲染纹理。

静态函数

ClearCachedData清除为给定着色器生成的所有内部缓存数据(如错误和编译信息)。
ClearShaderMessages清除给定着色器的编译时间消息。
CompilePass请求编辑器编译给定材质的特定通道所需的着色器变体。
CreateShaderAssetCreates a new Shader object from the provided source code string. You can use this method alongside the ScriptedImporter to create custom shader generation tools in the Editor.
GetAllShaderInfo返回所有可用着色器的 ShaderInfo 数组,包括内置着色器。
GetCallableShaderCount返回给定 RayTracingShader 中定义的可调用着色器数。
GetCallableShaderName返回给定 RayTracingShader 中用户定义的可调用着色器的名称。
GetCallableShaderParamSize返回给定 RayTracingShader 中用户定义的可调用着色器的参数大小。
GetComputeShaderMessageCount返回 Unity 着色器编译器为给定 ComputeShader 生成的错误和警告数。
GetComputeShaderMessages返回 Unity 着色器编译器为给定 ComputeShader 生成的每个错误和警告。
GetMissShaderCount返回给定 RayTracingShader 中定义的未命中着色器数。
GetMissShaderName返回给定 RayTracingShader 中用户定义的未命中着色器的名称。
GetMissShaderRayPayloadSize返回给定 RayTracingShader 中用户定义的未命中着色器的光线有效负载大小。
GetPropertyCount获取着色器中的属性数量。
GetPropertyDescription获取着色器的 propertyIdx 索引处的着色器属性的描述。
GetPropertyName获取着色器的 propertyIdx 索引处的着色器属性的名称。
GetPropertyType获取着色器的 propertyIdx 索引处的着色器属性的 ShaderProperyType。
GetRangeLimits获取着色器的 propertyIdx 索引处的范围属性的限制。
GetRayGenerationShaderCount返回给定 RayTracingShader 中定义的光线生成着色器数。
GetRayGenerationShaderName返回给定 RayTracingShader 中用户定义的光线生成着色器的名称。
GetRayTracingShaderMessageCount返回着色器编译器为给定 RayTracingShader 生成的错误和警告数。
GetRayTracingShaderMessages返回着色器编译器为给定 RayTracingShader 生成的每个错误和警告。
GetShaderData获取特定着色器的着色器数据。
GetShaderMessageCount返回 Unity 着色器编译器为给定 Shader 生成的错误和警告数。
GetShaderMessages返回 Unity 着色器编译器为给定 Shader 生成的每个错误和警告。
GetTexDim获取着色器属性的纹理尺寸。
HasProceduralInstancingDetermines whether the specified Shader contains a valid Procedural Instancing variant.
IsPassCompiled检查材质中给定通道的着色器变体是否已编译。
IsShaderPropertyHidden着色器的 propertyIdx 索引处的着色器属性是否隐藏?
IsShaderPropertyNonModifiableTexureProperty着色器的 propertyIdx 索引处的着色器属性是否为 NonModifiableTextureProperty?
RegisterShader注册用户创建的着色器。
RestoreAsyncCompilation在此 CommandBuffer 范围中恢复以前的着色器编译模式。
SetAsyncCompilation在 CommandBuffer 中添加着色器编译模式命令。
ShaderHasError如果给定 Shader 生成任何错误,则返回 true。忽略警告。
UpdateShaderAssetReplaces the existing source code in the specified shader with the source code in the supplied string.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961