- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在我的着色器中定义一个浮点数数组,如下所示:
Properties
{
_TilesX ("Tiles X", Int) = 10
_TilesY ("Tiles Y", Int) = 10
_TileData1 ("Tile data", Float[]) = {} // THIS!!!
_Texture1 ("Texture odd", 2D) = "white" {}
_Texture2 ("Texture even", 2D) = "white" {}
}
float[]
的属性类型,因为在Unity的手册页或论坛上找不到该类型。
最佳答案
显然不是。
我没有这样想,因为我从未见过,但我想我会四处搜寻,然后碰到this thread,回答问题的人这样说(强调我的意思):
You can set arrays from script using
SetFloatArray
,SetVectorArray
, andSetColorArray
as of 5.4, but you can't define an array in the properties. Basically this means you can still set the value and have it defined in the CGPROGRAM block to be used, but it won't be serialized / saved by the material asset or show up in the material editor. It's an odd omission, especially since texture arrays are supported as properties (though texture arrays are a specific type of texture sampler rather than an array of texture properties like color arrays).
关于unity3d - 如何在Shader属性中定义 float 组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45098671/
我是一名优秀的程序员,十分优秀!