C# Class ScriptRuntime.MaterialInstance

材质实例
Inheritance: ScriptRuntime.Base
Show file Open project: Genesis-3D/Genesis-3D Class Usage Examples

Public Methods

Method Description
SetGlobalValue ( GlobalShaderMatrix index, Matrix44 &value ) : void

设置着色器中的全局矩阵参数,比如摄像机变换矩阵

SetGlobalValue ( GlobalShaderVector index, System.Vector4 &value ) : void

设置着色器中的全局向量参数,比如环境光

SetTexture ( String paramName, String id, int priority ) : void

为材质中的纹理参数设置纹理资源路径

SetTexture ( String paramName, Texture texture ) : void

为材质中的纹理参数设置纹理

SetValue ( String paramName, Matrix44 &value ) : void

为材质中的矩阵参数设置矩阵值

SetValue ( String paramName, System.Vector4 value ) : void

为材质中的向量参数设置向量值

SetValue ( String paramName, float value ) : void

为材质中的浮点参数设值

Private Methods

Method Description
MaterialInstance ( ) : System
MaterialInstance ( DummyClass__ dummyObj ) : System

Method Details

SetGlobalValue() public static method

设置着色器中的全局矩阵参数,比如摄像机变换矩阵
public static SetGlobalValue ( GlobalShaderMatrix index, Matrix44 &value ) : void
index GlobalShaderMatrix 着色器中的全局矩阵参数类型
value Matrix44 要设置的矩阵的值
return void

SetGlobalValue() public static method

设置着色器中的全局向量参数,比如环境光
public static SetGlobalValue ( GlobalShaderVector index, System.Vector4 &value ) : void
index GlobalShaderVector 着色器中的全局向量参数类型
value System.Vector4 要设置的向量的值
return void

SetTexture() public method

为材质中的纹理参数设置纹理资源路径
public SetTexture ( String paramName, String id, int priority ) : void
paramName String 材质中的纹理参数名称
id String 要设置的纹理资源路径
priority int 默认的0表示同步加载,1表示异步加载
return void

SetTexture() public method

为材质中的纹理参数设置纹理
public SetTexture ( String paramName, Texture texture ) : void
paramName String 材质中的纹理参数名称
texture Texture 要设置的纹理
return void

SetValue() public method

为材质中的矩阵参数设置矩阵值
public SetValue ( String paramName, Matrix44 &value ) : void
paramName String 材质中的矩阵参数名称
value Matrix44 要设置的矩阵参数值
return void

SetValue() public method

为材质中的向量参数设置向量值
public SetValue ( String paramName, System.Vector4 value ) : void
paramName String 材质的向量参数名称
value System.Vector4 要设置的向量参数值
return void

SetValue() public method

为材质中的浮点参数设值
public SetValue ( String paramName, float value ) : void
paramName String 材质中的浮点参数名称
value float 要设置的浮点数值
return void