Texture sampling configuration for filtering, mipmapping, and wrapping modes.
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel; const assetManager = model.project.assetManager; const textures = assetManager.assets.filter( a => a.isOfType(Editor.Assets.Texture.getTypeName()) ) as Editor.Assets.Texture[]; if (textures.length === 0) { console.log('No textures found in project'); return; } const textureParam = new Editor.Assets.TextureParameter(textures[0].id); const sampler = textureParam.sampler; // Configure sampler: bilinear filtering with mipmaps, repeating U/V, clamped W sampler.filteringMode = Editor.Assets.FilteringMode.Bilinear; sampler.mipmapsEnabled = true; sampler.wrapModeU = Editor.Assets.WrapMode.Repeat; sampler.wrapModeV = Editor.Assets.WrapMode.Repeat; sampler.wrapModeW = Editor.Assets.WrapMode.ClampToEdge; console.log(`Configured sampler for "${textures[0].name}"`); Copy
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel; const assetManager = model.project.assetManager; const textures = assetManager.assets.filter( a => a.isOfType(Editor.Assets.Texture.getTypeName()) ) as Editor.Assets.Texture[]; if (textures.length === 0) { console.log('No textures found in project'); return; } const textureParam = new Editor.Assets.TextureParameter(textures[0].id); const sampler = textureParam.sampler; // Configure sampler: bilinear filtering with mipmaps, repeating U/V, clamped W sampler.filteringMode = Editor.Assets.FilteringMode.Bilinear; sampler.mipmapsEnabled = true; sampler.wrapModeU = Editor.Assets.WrapMode.Repeat; sampler.wrapModeV = Editor.Assets.WrapMode.Repeat; sampler.wrapModeW = Editor.Assets.WrapMode.ClampToEdge; console.log(`Configured sampler for "${textures[0].name}"`);
Protected
Snap Hidden
Texture filtering method applied during sampling.
Whether mipmaps are used for texture sampling.
Wrapping behavior for U texture coordinates.
Wrapping behavior for V texture coordinates.
Wrapping behavior for W texture coordinates.
Texture sampling configuration for filtering, mipmapping, and wrapping modes.
Example