美文网首页
(四)创建master material

(四)创建master material

作者: Nick_4438 | 来源:发表于2022-12-24 19:26 被阅读0次

简介

在项目中如果每一个对象都要创建对应的material 将会导致工作量很大,于是我们期望可以创建一个master material,然后我们可以根据master material,创建material 实例。复用相关材质。

操作步骤

  • 创建一个material 命名为:M_MASTER,编辑material,使用Texture 、tint、constant、multiply配置

  • 变换constant、Texture sample为变量

  • 添加staticSwitchParameter,使其可判断参数条件

  • 成品如下:

image.png
  • 使用master material 创建 material instance,命名为:MI_Sphere
image.png
  • 拖动MI_Sphere到对象上应用该material instance

  • 双击MI_Sphere,可看到该材质实例的参数配置页面

image.png

操作技巧

  • 右键 constant可以转换constant为参数,参数可以配置默认值、最大值、最小值
  • 右键texture sample也可以转变成为参数

相关文章

网友评论

      本文标题:(四)创建master material

      本文链接:https://www.haomeiwen.com/subject/alhwqdtx.html