|
AnyCAD Rapid API 2026
Help you to create a better world!
|
精灵材质类 更多...
Public 成员函数 | |
| SpriteMaterial (global::System.IntPtr cPtr, bool cMemoryOwn) | |
| 仅供内部使用 | |
| void | SetColorMap (Texture map) |
| 获取/设置颜色贴图 | |
| Texture | GetColorMap () |
| void | SetAlphaMap (Texture map) |
| 获取/设置 Alpha 贴图 | |
| Texture | GetAlphaMap () |
| void | SetRotation (float val) |
| 获取/设置旋转角度属性 | |
| float | GetRotation () |
| void | SetSizeAttenuation (bool val) |
| 获取/设置尺寸衰减属性(从模板) | |
| bool | GetSizeAttenuation () |
| void | SetMorphTargets (bool val) |
| 获取/设置形变目标属性(从模板) | |
| bool | GetMorphTargets () |
Public 成员函数 继承自 AnyCAD.Foundation.MaterialInstance | |
| 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) |
| bool | GetColorWrite () |
| void | SetColorWrite (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 new SpriteMaterial | Cast (GfxObject obj) |
| static SpriteMaterial | Create (string templateName) |
| 创建精灵材质 | |
静态 Public 成员函数 继承自 AnyCAD.Foundation.MaterialInstance | |
| static MaterialInstance | Cast (GfxObject obj) |
精灵材质类
用于渲染2D精灵(Sprite)的材质,始终面向相机。 支持旋转、透明度控制和尺寸衰减。
|
static |
创建精灵材质
| templateName | 模板名称 |
| void AnyCAD.Foundation.SpriteMaterial.SetAlphaMap | ( | Texture | map | ) |
获取/设置 Alpha 贴图
控制精灵的透明度
| void AnyCAD.Foundation.SpriteMaterial.SetColorMap | ( | Texture | map | ) |
获取/设置颜色贴图
精灵的颜色纹理
| void AnyCAD.Foundation.SpriteMaterial.SetMorphTargets | ( | bool | val | ) |
获取/设置形变目标属性(从模板)
是否启用顶点形变动画
| void AnyCAD.Foundation.SpriteMaterial.SetRotation | ( | float | val | ) |
获取/设置旋转角度属性
精灵的旋转角度(弧度)
| void AnyCAD.Foundation.SpriteMaterial.SetSizeAttenuation | ( | bool | val | ) |
获取/设置尺寸衰减属性(从模板)
true 表示精灵大小随距离相机远近而变化