Editor.Assets.WrapMode
EnumOptions for what value is returned when a fetch falls outside the bounds of a texture.
Index
Enumeration Members
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const assetManager = model.project.assetManager;
// WrapMode controls texture coordinate behavior via Sampler
const textures = assetManager.assets.filter(a => a.isOfType('Texture'));
if (textures.length === 0) {
console.log('No textures in project');
return;
}
const texParam = new Editor.Assets.TextureParameter(textures[0].id);
const sampler = texParam.sampler;
// Repeat: tile the texture (good for tiling patterns)
sampler.wrapModeU = Editor.Assets.WrapMode.Repeat;
sampler.wrapModeV = Editor.Assets.WrapMode.Repeat;
// ClampToEdge: no tiling (good for UI textures)
sampler.wrapModeU = Editor.Assets.WrapMode.ClampToEdge;
sampler.wrapModeV = Editor.Assets.WrapMode.ClampToEdge;
console.log(`Sampler final: U=ClampToEdge (${sampler.wrapModeU}), V=ClampToEdge (${sampler.wrapModeV})`);
Enumeration Members
ClampToBorderColor
ClampToBorderColor:
number
Outside the range of 0 to 1, texture coordinates return the value specified by the borderColor property.
ClampToEdge
ClampToEdge:
number
Texture coordinates will be clamped between 0 and 1.
MirroredRepeat
MirroredRepeat:
number
Between -1 and 1, the texture is mirrored across the 0 axis. The image is repeated outside of that range.
Repeat
Repeat:
number
Wrap to the other side of the texture, effectively ignoring the integer part of the number to keep only the fractional part of the texture coordinate.