Version: 5.5

ProceduralMaterial

class in UnityEngine

/

Inherits from:Material

Switch to Manual

Description

Class for ProceduralMaterial handling.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public string floatRangeProperty = "Saturation"; public float cycleTime = 10; public Renderer rend; void Start() { rend = GetComponent<Renderer>(); } void Update() { ProceduralMaterial substance = rend.sharedMaterial as ProceduralMaterial; if (substance) { float lerp = Mathf.PingPong(Time.time * 2 / cycleTime, 1); substance.SetProceduralFloat(floatRangeProperty, lerp); substance.RebuildTextures(); } } }

Static Variables

isSupportedCheck if ProceduralMaterials are supported on the current platform.
substanceProcessorUsageUsed to specify the Substance engine CPU usage.

Variables

animationUpdateRateSet or get the update rate in millisecond of the animated substance.
cacheSizeSet or get the Procedural cache budget.
isCachedDataAvailableIndicates whether cached data is available for this ProceduralMaterial's textures (only relevant for Cache and DoNothingAndCache loading behaviors).
isFrozenReturns true if FreezeAndReleaseSourceData was called on this ProceduralMaterial.
isLoadTimeGeneratedShould the ProceduralMaterial be generated at load time?
isProcessingCheck if the ProceduralTextures from this ProceduralMaterial are currently being rebuilt.
isReadableSet or get the "Readable" flag for a ProceduralMaterial.
loadingBehaviorGet ProceduralMaterial loading behavior.
presetSet or get an XML string of "input/value" pairs (setting the preset rebuilds the textures).

Public Functions

CacheProceduralPropertySpecifies if a named ProceduralProperty should be cached for efficient runtime tweaking.
ClearCacheClear the Procedural cache.
FreezeAndReleaseSourceDataRender a ProceduralMaterial immutable and release the underlying data to decrease the memory footprint.
GetGeneratedTextureThis allows to get a reference to a ProceduralTexture generated by a ProceduralMaterial using its name.
GetGeneratedTexturesGet generated textures.
GetProceduralBooleanGet a named Procedural boolean property.
GetProceduralColorGet a named Procedural color property.
GetProceduralEnumGet a named Procedural enum property.
GetProceduralFloatGet a named Procedural float property.
GetProceduralPropertyDescriptionsGet an array of descriptions of all the ProceduralProperties this ProceduralMaterial has.
GetProceduralTextureGet a named Procedural texture property.
GetProceduralVectorGet a named Procedural vector property.
HasProceduralPropertyChecks if the ProceduralMaterial has a ProceduralProperty of a given name.
IsProceduralPropertyCachedChecks if a named ProceduralProperty is cached for efficient runtime tweaking.
IsProceduralPropertyVisibleChecks if a given ProceduralProperty is visible according to the values of this ProceduralMaterial's other ProceduralProperties and to the ProceduralProperty's visibleIf expression.
RebuildTexturesTriggers an asynchronous rebuild of this ProceduralMaterial's dirty textures.
RebuildTexturesImmediatelyTriggers an immediate (synchronous) rebuild of this ProceduralMaterial's dirty textures.
SetProceduralBooleanSet a named Procedural boolean property.
SetProceduralColorSet a named Procedural color property.
SetProceduralEnumSet a named Procedural enum property.
SetProceduralFloatSet a named Procedural float property.
SetProceduralTextureSet a named Procedural texture property.
SetProceduralVectorSet a named Procedural vector property.

Static Functions

StopRebuildsDiscard all the queued ProceduralMaterial rendering operations that have not started yet.

Inherited members

Variables

colorОсновной цвет материала.
globalIlluminationFlagsDefines how the material should interact with lightmaps and lightprobes.
mainTextureТекстура материала.
mainTextureOffsetОтступ основной текстуры.
mainTextureScaleМасштабирование основной текстуры.
passCountHow many passes are in this material (Read Only).
renderQueueRender queue of this material.
shaderThe shader used by the material.
shaderKeywordsAdditional shader keywords set by this material.
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public Functions

CopyPropertiesFromMaterialКопирует свойства с другого материала в данный материал.
DisableKeyword"Отзывает" ключевое слово шейдера.
EnableKeywordУстанавливает ключевое слово шейдера, которое активируется данным материалом.
FindPassReturns the index of the pass passName.
GetColorПолучает имя значения цвета.
GetColorArrayGet a named color array.
GetFloatПолучает именованное float значение.
GetFloatArrayGet a named float array.
GetIntПолучает именованное integer значение.
GetMatrixПолучает именованное значение матрицы из шейдера.
GetMatrixArrayGet a named matrix array.
GetPassNameReturns the name of the shader pass at index pass.
GetTagПолучает тэг шейдера материала.
GetTextureПолучает именованную текстуру.
GetTextureOffsetПолучает размещение смещения текстуры propertyName.
GetTextureScaleПолучает размещение масштабирования текстуры propertyName.
GetVectorПолучает значение именованного вектора.
GetVectorArrayGet a named vector array.
HasPropertyПроверяет, имеет ли шейдер материала свойство по заданному имени.
IsKeywordEnabledУстанавливает ключевое слово шейдера, которое активируется данным материалом.
LerpИнтерполирует свойства между двумя материалами.
SetBufferSet a named ComputeBuffer value.
SetColorУстанавливает именованное значение цвета.
SetColorArraySet a color array property.
SetFloatУстанавливает именованное float значение.
SetFloatArraySet a float array property.
SetIntУстанавливает именованное integer значение.
SetMatrixУстанавливает именованную матрицу для шейдера.
SetMatrixArraySet a matrix array property.
SetOverrideTagУстанавливает ключевое слово шейдера, которое активируется данным материалом.
SetPassАктивирует, учитывая pass для визуализации.
SetTextureУстанавливает именованную текстуру.
SetTextureOffsetУстанавливает перемещение отступа текстуры propertyName.
SetTextureScaleУстанавливает перемещение масштабирования текстуры propertyName.
SetVectorУстанавливает именованное значение вектора.
SetVectorArrayУстанавливает именованное значение вектора.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

Static Functions

DestroyУдаляет GameObject, Component или Asset.
DestroyImmediateDestroys the object obj immediately.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.