AnyCAD Rapid API 2026
Help you to create a better world!
载入中...
搜索中...
未找到
AnyCAD.Foundation.MaterialInstance类 参考

材质实例 更多...

类 AnyCAD.Foundation.MaterialInstance 继承关系图:
AnyCAD.Foundation.GfxObject AnyCAD.Foundation.BasicMaterial AnyCAD.Foundation.FontMaterial AnyCAD.Foundation.LineMaterial AnyCAD.Foundation.MeshMaterial AnyCAD.Foundation.MeshNormalMaterial AnyCAD.Foundation.PointsMaterial AnyCAD.Foundation.SpriteMaterial AnyCAD.Foundation.LineDashedMaterial AnyCAD.Foundation.LinePatternMaterial AnyCAD.Foundation.MeshPatternMaterial AnyCAD.Foundation.MeshPhongMaterial AnyCAD.Foundation.MeshStandardMaterial

Public 成员函数

 MaterialInstance (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
string GetName ()
 
void SetName (string val)
 
uint GetHashCodeId ()
 
MaterialTemplate GetTemplate ()
 
uint GetUpdateVersion ()
 
byte GetLineWidth ()
 
void SetLineWidth (byte val)
 
bool GetDepthTest ()
 
void SetDepthTest (bool val)
 
bool GetDepthWrite ()
 
void SetDepthWrite (bool val)
 
UniformSet GetUniforms ()
 
EnumBlendingMode GetBlending ()
 
void SetBlending (EnumBlendingMode val)
 
float GetRenderOrder ()
 
void SetRenderOrder (float val)
 
void SetColor (Vector3 val)
 颜色
 
Vector3 GetColor ()
 
void SetOpacity (float val)
 不透明度。配合SetTransparent使用。
 
float GetOpacity ()
 
void SetAlphaTest (float val)
 Alpha测试的值
 
float GetAlphaTest ()
 
void SetFaceSide (EnumFaceSide val)
 单面、背面、双面渲染设置
 
EnumFaceSide GetFaceSide ()
 
void SetVertexColors (bool val)
 是否启用顶点颜色(Vector3)
 
bool GetVertexColors ()
 
void SetVertexColors4 (bool val)
 是否启用顶点颜色(Vector4)
 
bool GetVertexColors4 ()
 
void SetRGB (byte r, byte g, byte b)
 Set Color by R,G,B
 
void SetColor (float r, float g, float b)
 Set Color by R,G,B
 
void SetColorByRGB (float r, float g, float b)
 
void SetColorByVec3 (Vector3 v)
 
void SetTransparent (bool enabled)
 是否启用透明
 
bool GetTransparent ()
 判断是否启用透明
 
bool GetReceiveShadow ()
 是否接收阴影
 
bool GetStatic ()
 是否是静态的Shader,无需要编译。
 
uint GetMorphTargetCount ()
 MorphTarget数量
 
void SetFixedSize (bool fixedSize)
 相对视图固定大小
 
bool IsFixedSize ()
 是否显示为固定大小
 
void SetFlipSided (bool filpSided)
 法向量反向
 
void RequestUpdate ()
 请求更新。材质参数修改后调用。
 
void ComputeHashCode ()
 计算哈希值,内部使用。
 
void AddDefine (string key, string value)
 定义宏,在Shader使用
 
void AddTexture (string name, Texture texture)
 添加材质通道
 
Texture GetTexture (string name)
 
void SetUniform (string name, bool val)
 
void SetUniform (string name, int val)
 
void SetUniform (string name, EnumTextureUnit val)
 
void SetUniform (string name, float val)
 
void SetUniform (string name, Vector2 val)
 
void SetUniform (string name, Vector3 val)
 
void SetUniform (string name, Vector4 val)
 
void SetUniform (string name, Matrix3 val)
 
void SetUniform (string name, Matrix4 val)
 
void SetUniform (string name, Matrix2 val)
 
void SetUniformBool (string name, bool val)
 
void SetUniformInt (string name, int val)
 
void SetUniformTextureUnit (string name, EnumTextureUnit val)
 
void SetUniformFloat (string name, float val)
 
void SetUniformVec2 (string name, Vector2 val)
 
void SetUniformVec3 (string name, Vector3 val)
 
void SetUniformVec4 (string name, Vector4 val)
 
void SetUniformMat2 (string name, Matrix2 val)
 
void SetUniformMat3 (string name, Matrix3 val)
 
void SetUniformMat4 (string name, Matrix4 val)
 
- Public 成员函数 继承自 AnyCAD.Foundation.GfxObject
 GfxObject (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
void Dispose ()
 
uint GetUuid ()
 

静态 Public 成员函数

static MaterialInstance Cast (GfxObject obj)
 

详细描述

材质实例

Group: Rendering

成员函数说明

◆ AddDefine()

void AnyCAD.Foundation.MaterialInstance.AddDefine ( string key,
string value )

定义宏,在Shader使用

参数
key名称
value

◆ AddTexture()

void AnyCAD.Foundation.MaterialInstance.AddTexture ( string name,
Texture texture )

添加材质通道

参数
namemap名称
texture贴图

◆ GetMorphTargetCount()

uint AnyCAD.Foundation.MaterialInstance.GetMorphTargetCount ( )

MorphTarget数量

返回
数量

◆ GetReceiveShadow()

bool AnyCAD.Foundation.MaterialInstance.GetReceiveShadow ( )

是否接收阴影

返回
true接收

◆ GetStatic()

bool AnyCAD.Foundation.MaterialInstance.GetStatic ( )

是否是静态的Shader,无需要编译。

返回
true则为静态shader。

◆ GetTransparent()

bool AnyCAD.Foundation.MaterialInstance.GetTransparent ( )

判断是否启用透明

返回
true启用

◆ IsFixedSize()

bool AnyCAD.Foundation.MaterialInstance.IsFixedSize ( )

是否显示为固定大小

返回
true则是

◆ SetColor()

void AnyCAD.Foundation.MaterialInstance.SetColor ( float r,
float g,
float b )

Set Color by R,G,B

参数
r[0,1]
g[0,1]
b[0,1]

◆ SetFixedSize()

void AnyCAD.Foundation.MaterialInstance.SetFixedSize ( bool fixedSize)

相对视图固定大小

参数
fixedSize

◆ SetFlipSided()

void AnyCAD.Foundation.MaterialInstance.SetFlipSided ( bool filpSided)

法向量反向

参数
filpSided是否反向

◆ SetRGB()

void AnyCAD.Foundation.MaterialInstance.SetRGB ( byte r,
byte g,
byte b )

Set Color by R,G,B

参数
r[0,255]
g[0,255]
b[0,255]

◆ SetTransparent()

void AnyCAD.Foundation.MaterialInstance.SetTransparent ( bool enabled)

是否启用透明

参数
enabledtrue启用