English中文

TextureUniform

new Cesium.TextureUniform(options)

一个简单的结构体,用作 a 的值 A simple struct that serves as a value of a sampler2D有价值的制服。这与使用 -valued uniform. This is used with CustomShader and TextureManager
名称 Name 类型 Type 说明 Description
options object 具有以下属性的对象: An object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
typedArray Uint8Array 可选 optional 存储纹理内容的类型化数组。值按行优先顺序存储。由于 WebGL 对纹理使用 y-up 约定,因此行从下到上列出。 A typed array storing the contents of a texture. Values are stored in row-major order. Since WebGL uses a y-up convention for textures, rows are listed from bottom to top.
width number 可选 optional 图像的宽度。当 options.typedArray 存在时需要 The width of the image. Required when options.typedArray is present
height number 可选 optional 图像的高度。当 options.typedArray 存在时是必需的。 The height of the image. Required when options.typedArray is present.
url string | Resource 可选 optional 指向纹理图像的 URL 字符串或资源。 A URL string or resource pointing to a texture image.
repeat boolean true 可选 optional 定义后,纹理采样器将设置为在两个方向上环绕 When defined, the texture sampler will be set to wrap in both directions
pixelFormat PixelFormat PixelFormat.RGBA 可选 optional 当定义 options.typedArray 时,它用于确定纹理的像素格式 When options.typedArray is defined, this is used to determine the pixel format of the texture
pixelDatatype PixelDatatype PixelDatatype.UNSIGNED_BYTE 可选 optional 当定义 options.typedArray 时,这是类型化数组中像素值的数据类型。 When options.typedArray is defined, this is the data type of pixel values in the typed array.
minificationFilter TextureMinificationFilter TextureMinificationFilter.LINEAR 可选 optional 纹理采样器的缩小过滤器。 The minification filter of the texture sampler.
magnificationFilter TextureMagnificationFilter TextureMagnificationFilter.LINEAR 可选 optional 纹理采样器的放大过滤器。 The magnification filter of the texture sampler.
maximumAnisotropy number 1.0 可选 optional 纹理采样器的最大各向异性 The maximum anisotropy of the texture sampler
实验性 Experimental

此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.