Version: 2018.4
LanguageEnglish
  • C#

ShaderUtil

class in UnityEditor

/

Implemented in:UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Utility functions to assist with working with shaders from the editor.

Static Properties

hardwareSupportsRectRenderTextureDoes the current hardware support render textues.

Static Methods

ClearShaderErrorsClear compile time errors for the given shader.
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.
GetAllShaderInfoReturns an array of ShaderInfo of all available shaders. That includes built-in shaders.
GetPropertyCountGet the number of properties in Shader s.
GetPropertyDescriptionGet the description of the shader propery at index propertyIdx of Shader s.
GetPropertyNameGet the name of the shader propery at index propertyIdx of Shader s.
GetPropertyTypeGet the ShaderProperyType of the shader propery at index propertyIdx of Shader s.
GetRangeLimitsGet Limits for a range property at index propertyIdx of Shader s.
GetShaderDataGet the shader data for a specific shader.
GetTexDimGets texture dimension of a shader property.
IsShaderPropertyHiddenIs the shader propery at index propertyIdx of Shader s hidden?
IsShaderPropertyNonModifiableTexurePropertyIs the shader propery at index propertyIdx of Shader s a NonModifiableTextureProperty?
RegisterShaderRegister a user created shader.
UpdateShaderAssetReplaces the existing source code in the specified shader with the source code in the supplied string.