Creating Procedural Textures

  由程序主生贴图,然后设置给Material。首先定义需要的数据:

  Creating Procedural Textures

  在Start方法中完成初始化,注意设置的是_MainTex。

  Creating Procedural Textures

  实现GenerateParabola方法,算的是到中点的距离除以半径的百分比:

  Creating Procedural Textures

How it works

  下图也是上述Shader产生出的图像,中心点高亮,向边框逐渐变暗。

  Creating Procedural Textures

其它生成算法

1、使用sin函数的环生成算法。

  Creating Procedural Textures 

  生成结果如下:

  Creating Procedural Textures

相关文章:

  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-01-17
  • 2021-05-26
猜你喜欢
  • 2021-09-09
  • 2021-11-28
  • 2021-04-05
  • 2021-05-13
  • 2021-06-23
  • 2022-12-23
  • 2021-08-24
相关资源
相似解决方案