1"use strict";(self.webpackChunkwebsite_docusaurus=self.webpackChunkwebsite_docusaurus||[]).push([["11308"],{92018(e,r,i){i.r(r),i.d(r,{metadata:()=>s,default:()=>u,frontMatter:()=>t,contentTitle:()=>c,toc:()=>h,assets:()=>o});var s=JSON.parse('{"id":"api-reference/core/resources/sampler","title":"Sampler","description":"A Sampler is an immutable object that holds a set of sampling parameters for texture access.","source":"@site/../docs/api-reference/core/resources/sampler.md","sourceDirName":"api-reference/core/resources","slug":"/api-reference/core/resources/sampler","permalink":"/docs/api-reference/core/resources/sampler","draft":false,"unlisted":false,"editUrl":"https://github.com/visgl/luma.gl/tree/master/docs/../docs/api-reference/core/resources/sampler.md","tags":[],"version":"current","frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"ExternalTexture","permalink":"/docs/api-reference/core/resources/external-texture"},"next":{"title":"Fence","permalink":"/docs/api-reference/core/resources/fence"}}'),a=i(62540),n=i(43023),d=i(22843),l=i(15851);let t={},c="Sampler",o={},h=[{value:"Usage",id:"usage",level:2},{value:"Types",id:"types",level:2},{value:"SamplerProps",id:"samplerprops",level:3},{value:"Texture Wrapping",id:"texture-wrapping",level:4},{value:"Texture Magnification Filter",id:"texture-magnification-filter",level:4},{value:"Texture Minification Filter",id:"texture-minification-filter",level:4},{value:"Texture Mipmap Filter",id:"texture-mipmap-filter",level:4},{value:"Texture Max Anisotropy",id:"texture-max-anisotropy",level:4},{value:"Texture Comparison Function",id:"texture-comparison-function",level:4},{value:"Members",id:"members",level:2},{value:"Methods",id:"methods",level:2},{value:"<code>constructor(props: SamplerProps)</code>",id:"constructorprops-samplerprops",level:3},{value:"<code>destroy(): void</code>",id:"destroy-void",level:3},{value:"Remarks",id:"remarks",level:2}];function p(e){let r={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,n.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.header,{children:(0,a.jsx)(r.h1,{id:"sampler",children:"Sampler"})}),"\n",(0,a.jsx)(d.p,{group:"textures",active:"sampler"}),"\n",(0,a.jsxs)(r.p,{children:["A ",(0,a.jsx)(r.code,{children:"Sampler"}),' is an immutable object that holds a set of sampling parameters for texture access.\nSampling parameters are applied during shader execution and control how values ("texels")\nare read from textures.']}),"\n",(0,a.jsxs)(r.p,{children:["Note that luma.gl automatically creates a default ",(0,a.jsx)(r.code,{children:"Sampler"})," for each ",(0,a.jsx)(r.code,{children:"Texture"}),".\nA texture's default sampler parameters can be specified creating the texture via ",(0,a.jsx)(r.code,{children:"device.createTexture({sampler: SamplerProps}))"}),".\nUnless an application needs to render the same texture with different sampling parameters,\nan application typically does not need to explicitly instantiate samplers."]}),"\n",(0,a.jsxs)(r.p,{children:["Note that a ",(0,a.jsx)(r.strong,{children:"Comparison sampler"})," is a special type of ",(0,a.jsx)(r.code,{children:"Sampler"})," that compares against the depth buffer.\nDuring comparison sampling, the interpolated and clamped ",(0,a.jsx)(r.code,{children:"r"})," texture coordinate is compared to currently bound depth texture,\nand the result of the comparison (",(0,a.jsx)(r.code,{children:"0"})," or ",(0,a.jsx)(r.code,{children:"1"}),") is assigned to the red channel.\nSpecifying the ",(0,a.jsx)(r.code,{children:"type: 'comparison-sampler'"})," sampler property creates a comparison sampler."]}),"\n",(0,a.jsxs)(r.p,{children:["For more information, see ",(0,a.jsx)(r.a,{href:"/docs/api-guide/gpu/gpu-textures#sampling",children:"Sampling"})," in the API Guide."]}),"\n",(0,a.jsx)(r.h2,{id:"usage",children:"Usage"}),"\n",(0,a.jsxs)(r.p,{children:["Create a new ",(0,a.jsx)(r.code,{children:"Sampler"})]}),"\n",(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-typescript",children:"import {luma} from '@luma.gl/core';\nconst device = await luma.createDevice();\nconst sampler = device.createSampler(gl, {\n addressModeU: 'clamp-to-edge'\n});\n"})}),"\n",(0,a.jsxs)(r.p,{children:["Note that a default ",(0,a.jsx)(r.code,{children:"Sampler"})," is automatically created for each texture:"]}),"\n",(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-typescript",children:"// Create a texture\nconst texture = device.createTexture({\n sampler: {\n minFilter: 'linear',\n maxFilter: 'linear'\n }\n});\nconsole.log(texture.sampler);\n"})}),"\n",(0,a.jsxs)(r.p,{children:["Create a new ",(0,a.jsx)(r.strong,{children:"comparison sampler"}),", by specifying the ",(0,a.jsx)(r.code,{children:"compare"})," sampler property creates a comparison sampler."]}),"\n",(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-typescript",children:"const sampler = device.createSampler(gl, {\n
1compare: 'lequal'\n});\n"})}),"\n",(0,a.jsx)(r.h2,{id:"types",children:"Types"}),"\n",(0,a.jsx)(r.h3,{id:"samplerprops",children:"SamplerProps"}),"\n",(0,a.jsxs)(r.table,{children:[(0,a.jsx)(r.thead,{children:(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.th,{children:"Sampler Parameter"}),(0,a.jsx)(r.th,{children:"Values"}),(0,a.jsx)(r.th,{children:"Description"})]})}),(0,a.jsxs)(r.tbody,{children:[(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"type"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"'color-sampler'"})," * | ",(0,a.jsx)(r.code,{children:"'comparison-sampler'"})]}),(0,a.jsxs)(r.td,{children:["Specify ",(0,a.jsx)(r.code,{children:"'comparison-sampler'"})," to create a depth comparison sampler"]})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"addressModeU?"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"'clamp-to-edge'"})," * | ",(0,a.jsx)(r.code,{children:"'repeat'"})," | ",(0,a.jsx)(r.code,{children:"'mirror-repeat'"})]}),(0,a.jsxs)(r.td,{children:["Texture wrapping for texture coordinate ",(0,a.jsx)(r.code,{children:"u"})," (",(0,a.jsx)(r.code,{children:"s"}),")"]})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"addressModeV?"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"'clamp-to-edge'"})," * | ",(0,a.jsx)(r.code,{children:"'repeat'"})," | ",(0,a.jsx)(r.code,{children:"'mirror-repeat'"})]}),(0,a.jsxs)(r.td,{children:["Texture wrapping for texture coordinate ",(0,a.jsx)(r.code,{children:"v"})," (",(0,a.jsx)(r.code,{children:"t"}),")"]})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"addressModeW?"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"'clamp-to-edge'"})," * | ",(0,a.jsx)(r.code,{children:"'repeat'"})," | ",(0,a.jsx)(r.code,{children:"'mirror-repeat'"})]}),(0,a.jsxs)(r.td,{children:["Texture wrapping for texture coordinate ",(0,a.jsx)(r.code,{children:"w"})," (",(0,a.jsx)(r.code,{children:"r"}),")"]})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"magFilter?"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"'nearest'"})," * | ",(0,a.jsx)(r.code,{children:"'linear'"})]}),(0,a.jsx)(r.td,{children:"Sample nearest texel, or interpolate closest texels"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"minFilter?"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"'nearest'"})," * | ",(0,a.jsx)(r.code,{children:"'linear'"})]}),(0,a.jsx)(r.td,{children:"Sample nearest texel, or interpolate closest texels"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"mipmapFilter?"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"'none'"})," * | ",(0,a.jsx)(r.code,{children:"'nearest'"})," | ",(0,a.jsx)(r.code,{children:"'linear'"})]}),(0,a.jsx)(r.td,{children:"Sample closest mipmap, or interpolate two closest mipmaps"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"maxAnisotropy?"})}),(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"number"})}),(0,a.jsx)(r.td,{children:"Combine samples from multiple mipmap levels when appropriate"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"lodMinClamp?"})}),(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"number"})}),(0,a.jsx)(r.td,{children:"Minimum level of detail to use when sampling"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"lodMaxClamp?"})}),(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"number"})}),(0,a.jsx)(r.td,{children:"Maximum level of detail to use when sampling"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"compare?"})}),(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"less-equal"})," etc (see below)"]}),(0,a.jsx)(r.td,{children:'Specifies compare function for a depth "comparison sampler"'})]})]})]}),"\n",(0,a.jsx)(r.p,{children:"Use the interactive playground to compare wrapping, filtering, mipmaps, LOD clamps,\nanisotropy, and depth comparison sampling."}),"\n",(0,a.jsx)(l.p8,{embedded:!0,showStats:!1}),"\n",(0,a.jsx)(r.h4,{id:"texture-wrapping",children:"Texture Wrapping"}),"\n",(0,a.jsx)(r.p,{children:"Controls how texture coordinates outside of the [0, 1] range are sampled."}),"\n",(0,a.jsxs)(r.ul,{children:["\n",(0,a.jsxs)(r.li,{children:["Parameters: ",(0,a.jsx)(r.code,{children:"addressModeU"}),", ",(0,a.jsx)(r.code,{children:"addressModeV"}),", ",(0,a.jsx)(r.code,{children:"addressModeW"})]}),"\n"]}),"\n",(0,a.jsxs)(r.table,{children:[(0,a.jsx)(r.thead,{children:(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.th,{children:"Value"}),(0,a.jsx)(r.th,{children:"Description"})]})}),(0,a.jsxs)(r.tbody,{children:[(0,a.jsxs)(r.tr,{children:[(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"repeat"})," (default)"]}),(0,a.jsx)(r.td,{children:"use fractional part of texture coordinates"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"clamp-to-edge"})}),(0,a.jsx)(r.td,{children:"clamp texture coordinates"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"mirrored-repeat"})}),(0,a.jsxs)(r.td,{children:["use fractional part of texture coordinate if integer part is odd, otherwise ",(0,a.jsx)(r.code,{children:"1 - frac"})]})]})]})]}),"\n",(0,a.jsx)(r.h4,{id:"texture-magnification-filter",children:"Texture Magnification Filter"}),"\n",(0,a.jsx)(r.p,{children:"Controls how a pixel is textured when it maps to less than one texel."}),"\n",(0,a.jsxs)(r.p,{children:["Parameter: ",(0,a.jsx)(r.code,{children:"magFilter"})]}),"\n",(0,a.jsxs)(r.table,{children:[(0,a.jsx)(r.thead,{children:(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.th,{children:"Value"}),(0,a.jsx)(r.th,{children:"Description"})]})}),(0,a.jsxs)(r.tbody,{children:[(0,a.jsxs)(r.tr,{children:[(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"nearest"})," (default)"]}),(0,a.jsx)(r.td,{children:"nearest texel"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"linear"})}),(0,a.jsx)(r.td,{children:"interpolated texel"})]})]})]}),"\n",(0,a.jsxs)(r.ul,{children:["\n",(0,a.jsxs)(r.li,{children:[(0,a.jsx)(r.code,{children:"nearest"})," is faster than ",(0,a.jsx)(r.code,{children:"linear"}),", but is not as smooth."]}),"\n"]}),"\n",(0,a.jsx)(r.h4,{id:"texture-minification-filter",children:"Texture Minification Filter"}),"\n",(0,a.jsx)(r.p,{children:"Controls how a pixel is textured when it maps to more than one texel."}),"\n",(0,a.jsxs)(r.p,{children:["Parameter: ",(0,a.jsx)(r.code,{children:"minFilter"})]}),"\n",(0,a.jsxs)(r.table,{children:[(0,a.jsx)(r.thead,{children:(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.th,{children:"Value"}),(0,a.jsx)(r.th,{children:"Description"})]})}),(0,a.jsxs)(r.tbody,{children:[(0,a.jsxs)(r.tr,{children:[(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"nearest"})," (default)"]}),(0,a.jsx)(r.td,{children:"nearest texel"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"linear"})}),(0,a.jsx)(r.td,{children:"interpolated texel"})]})]})]}),"\n",(0,a.jsx)(r.h4,{id:"texture-mipmap-filter",children:"Texture Mipmap Filter"}),"\n",(0,a.jsx)(r.p,{children:"Controls if a pixel is textured by referencing more than one mipmap level."}),"\n",(0,a.jsxs)(r.p,{children:["Parameter: ",(0,a.jsx)(r.code,{children:"mipmapFilter"})]}),"\n",(0,a.jsxs)(r.table,{children:[(0,a.jsx)(r.thead,{children:(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.th,{children:"Value"}),(0,a.jsx)(r.th,{children:"Description"})]})}),(0,a.jsxs)(r.tbody,{children:[(0,a.jsxs)(r.tr,{children:[(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"nearest"})," (default)"]}),(0,a.jsx)(r.td,{children:"nearest mipmap"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"linear"})}),(0,a.jsx)(r.td,{children:"interpolate between mipmaps"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"none"})}),(0,a.jsx)(r.td,{children:"no mipmaps"})]})]})]}),"\n",(0,a.jsxs)(r.p,{children:["For more information, see ",(0,a.jsx)(r.a,{href:"/docs/api-guide/gpu/gpu-textures#mipmaps",children:"GPU Textures"}),"."]}),"\n",(0,a.jsx)(r.h4,{id:"texture-max-anisotropy",children:"Texture Max Anisotropy"}),"\n",(0,a.jsx)(r.p,{children:"Controls multiple mipmap level can be consulted when texturing a pixel."}),"\n",(0,a.jsx)(r.h4,{id:"texture-comparison-function",children:"Texture Comparison Function"}),"\n",(0,a.jsxs)(r.blockquote,{children:["\n",(0,a.jsxs)(r.p,{children:["Specifying the ",(0,a.jsx)(r.code,{children:"compare"})," sampler property creates a comparison sampler.\nComparison samplers are special samplers that compare a value against the depth buffer."]}),"\n"]}),"\n",(0,a.jsxs)(r.p,{children:["Parameter: ",(0,a.jsx)(r.code,{children:"compare"})]}),"\n",(0,a.jsxs)(r.table,{children:[(0,a.jsx)(r.thead,{children:(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.th,{children:"`Value"}),(0,a.jsx)(r.th,{children:"Computed result"})]})}),(0,a.jsxs)(r.tbody,{children:[(0,a.jsxs)(r.tr,{children:[(0,a.jsxs)(r.td,{children:[(0,a.jsx)(r.code,{children:"less-equal"})," (default)"]}),(0,a.jsx)(r.td,{children:"result = 1.0 0.0, r <= D t r > D t"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"greater-equal"})}),(0,a.jsx)(r.td,{children:"result = 1.0 0.0, r >= D t r < D t"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"less"})}),(0,a.jsx)(r.td,{children:"result = 1.0 0.0, r < D t r >= D t"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"greater"})}),(0,a.jsx)(r.td,{children:"result = 1.0 0.0, r > D t r <= D t"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"equal"})}),(0,a.jsx)(r.td,{children:"result = 1.0 0.0, r = D t r \u2260 D t"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"not-equal"})}),(0,a.jsx)(r.td,{children:"result = 1.0 0.0, r \u2260 D t r = D t"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"always"})}),(0,a.jsx)(r.td,{children:"result = 1.0"})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"never"})}),(0,a.jsx)(r.td,{children:"result = 0.0"})]})]})]}),"\n",(0,a.jsxs)(r.p,{children:["During sampling, the interpolated and clamped ",(0,a.jsx)(r.code,{children:"r"})," texture coordinate is compared to currently bound depth texture,\nand the result of the comparison (",(0,a.jsx)(r.code,{children:"0"})," or ",(0,a.jsx)(r.code,{children:"1"}),") is assigned to the red channel."]}),"\n",(0,a.jsx)(r.h2,{id:"members",children:"Members"}),"\n",(0,a.jsxs)(r.ul,{children:["\n",(0,a.jsxs)(r.li,{children:[(0,a.jsx)(r.code,{children:"device"}),": ",(0,a.jsx)(r.code,{children:"Device"})," - holds a reference to the ",(0,a.jsx)(r.code,{children:"Device"})," that created this ",(0,a.jsx)(r.code,{children:"Sampler"}),"."]}),"\n",(0,a.jsxs)(r.li,{children:[(0,a.jsx)(r.code,{children:"handle"}),": ",(0,a.jsx)(r.code,{children:"unknown"})," - holds the underlying WebGL or WebGPU shader object"]}),"\n",(0,a.jsxs)(r.li,{children:[(0,a.jsx)(r.code,{children:"props"}),": ",(0,a.jsx)(r.code,{children:"SamplerProps"})," - holds a copy of the ",(0,a.jsx)(r.code,{children:"SamplerProps"})," used to create this ",(0,a.jsx)(r.code,{children:"Sampler"}),"."]}),"\n"]}),"\n",(0,a.jsx)(r.h2,{id:"methods",children:"Methods"}),"\n",(0,a.jsx)(r.h3,{id:"constructorprops-samplerprops",children:(0,a.jsx)(r.code,{children:"constructor(props: SamplerProps)"})}),"\n",(0,a.jsxs)(r.p,{children:[(0,a.jsx)(r.code,{children:"Sampler"})," is an abstract class and cannot be instantiated directly. Create with ",(0,a.jsx)(r.code,{children:"device.createSampler(...)"}),"."]}),"\n",(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-typescript",children:"device.createSampler({...})\n"})}),"\n",(0,a.jsx)(r.h3,{id:"destroy-void",children:(0,a.jsx)(r.code,{children:"destroy(): void"})}),"\n",(0,a.jsx)(r.p,{children:"Free up any GPU resources associated with this sampler immediately (instead of waiting for garbage collection)."}),"\n",(0,a.jsx)(r.h2,{id:"remarks",children:"Remarks"}),"\n",(0,a.jsxs)(r.ul,{children:["\n",(0,a.jsxs)(r.li,{children:["WebGL: More information about ",(0,a.jsx)(r.code,{children:"WebGLSampler"})," can be found in the ",(0,a.jsx)(r.a,{href:"https://www.khronos.org/opengl/wiki/Sampler_Object",children:"OpenGL Wiki"}),"."]}),"\n"]})]})}function u(e={}){let{wrapper:r}={...(0,n.R)(),...e.components};return r?(0,a.jsx)(r,{...e,children:(0,a.jsx)(p,{...e})}):p(e)}},22843(e,r,i){i.d(r,{p:()=>d});var s=i(62540);i(63696);var a=i(79464),n=i(79183);function d(e){let{group:r,active:i}=e;return(0,s.jsx)(n.N,{active:i,group:a.o.core[r]})}},79183(e,r,i){i.d(r,{N:()=>n});var s=i(62540);i(63696);var a=i(11083);function n(e){let{active:r,group:i}=e;return(0,s.jsx)("nav",{className:"docs-page-tabs","aria-label":i.label,children:i.tabs.map(e=>(0,s.jsx)(a.A,{className:e.id===r?"docs-page-tabs__tab docs-page-tabs__tab--active":"docs-page-tabs__tab",to:e.href,"aria-current":e.id===r?"page":void 0,children:e.label},e.id))})}},79464(e,r,i){i.d(r,{$:()=>a,o:()=>s});let s={core:{starting:{label:"Core starting points",tabs:[{id:"core-reference",label:"Overview",href:"/docs/api-reference/core"},{id:"core-guide",label:"Programming guide",href:"/docs/api-guide/gpu"},{id:"core-cookbook",label:"Cookbook",href:"/docs/api-guide/gpu/cookbook"}]},"guide-lifecycle":{label:"Core lifecycle guides",tabs:[{id:"initialization",label:"Initialization",href:"/docs/api-guide/gpu/gpu-initialization"},{id:"resources",label:"Resources",href:"/docs/api-guide/gpu/gpu-resources"},{id:"data-processing",label:"Data processing",href:"/docs/api-guide/gpu/gpu-data-processing"}]},"guide-rendering":{label:"Core rendering guides",tabs:[{id:"core-guide",label:"Overview",href:"/docs/api-guide/gpu"},{id:"rendering",label:"Rendering",href:"/docs/api-guide/gpu/gpu-rendering"},{id:"antialiasing",label:"Antialiasing",href:"/docs/api-guide/gpu/gpu-antialiasing"},{id:"parameters",label:"Parameters",href:"/docs/api-guide/gpu/gpu-parameters"},{id:"bindings",label:"Bindings",href:"/docs/api-guide/gpu/gpu-bindings"}]},"guide-shader-data":{label:"Core shader data guides",tabs:[{id:"bindings",label:"Bindings",href:"/docs/api-guide/gpu/gpu-bindings"},{id:"attributes",label:"Attributes",href:"/docs/api-guide/gpu/gpu-attributes"},{id:"uniforms",label:"Uniforms",href:"/docs/api-guide/gpu/gpu-uniforms"},{id:"textures",label:"Textures",href:"/docs/api-guide/gpu/gpu-textures"},{id:"video-textures",label:"Video textures",href:"/docs/api-guide/gpu/video-textures"},{id:"tabular-data",label:"Tabular data",href:"/docs/api-guide/gpu/tabular-data-in-wgsl"}]},device:{label:"Device and adapters",tabs:[{id:"luma",label:"luma",href:"/docs/api-reference/core/luma"},{id:"adapter",label:"Adapter",href:"/docs/api-reference/core/adapter"},{id:"device",label:"Device",href:"/docs/api-reference/core/device"},{id:"device-info",label:"DeviceInfo",href:"/docs/api-reference/core/device-info"},{id:"device-limits",label:"DeviceLimits",href:"/docs/api-reference/core/device-limits"},{id:"device-features",label:"DeviceFeatures",href:"/docs/api-reference/core/device-features"}]},"shader-types":{label:"GPU data types",tabs:[{id:"shader-types",label:"Shader Types",href:"/docs/api-reference/core/shader-types"},{id:"vertex-formats",label:"Vertex Formats",href:"/docs/api-reference/core/vertex-formats"},{id:"texture-formats",label:"Texture Formats",href:"/docs/api-reference/core/texture-formats"}]},commands:{label:"Command encoding",tabs:[{id:"command-encoding",label:"Workflow",href:"/docs/api-guide/gpu/gpu-commands"},{id:"command-encoder",label:"CommandEncoder",href:"/docs/api-reference/core/resources/command-encoder"},{id:"render-pass",label:"RenderPass",href:"/docs/api-reference/core/resources/render-pass"},{id:"render-bundle-encoder",label:"Render bundles",href:"/docs/api-reference/core/resources/render-bundle-encoder"},{id:"compute-pass",label:"ComputePass",href:"/docs/api-reference/core/resources/compute-pass"}]},pipelines:{label:"Shaders and pipelines",tabs:[{id:"shader",label:"Shader",href:"/docs/api-reference/core/resou
1rces/shader"},{id:"render-pipeline",label:"RenderPipeline",href:"/docs/api-reference/core/resources/render-pipeline"},{id:"compute-pipeline",label:"ComputePipeline",href:"/docs/api-reference/core/resources/compute-pipeline"},{id:"vertex-array",label:"VertexArray",href:"/docs/api-reference/core/resources/vertex-array"},{id:"transform-feedback",label:"TransformFeedback",href:"/docs/api-reference/core/resources/transform-feedback"}]},resources:{label:"Resources and synchronization",tabs:[{id:"resource",label:"Resource",href:"/docs/api-reference/core/resources/resource"},{id:"buffer",label:"Buffer",href:"/docs/api-reference/core/resources/buffer"},{id:"command-buffer",label:"CommandBuffer",href:"/docs/api-reference/core/resources/command-buffer"},{id:"query-set",label:"QuerySet",href:"/docs/api-reference/core/resources/query-set"},{id:"fence",label:"Fence",href:"/docs/api-reference/core/resources/fence"},{id:"pipeline-layout",label:"PipelineLayout",href:"/docs/api-reference/core/resources/pipeline-layout"}]},textures:{label:"Textures",tabs:[{id:"texture",label:"Texture",href:"/docs/api-reference/core/resources/texture"},{id:"texture-view",label:"TextureView",href:"/docs/api-reference/core/resources/texture-view"},{id:"sampler",label:"Sampler",href:"/docs/api-reference/core/resources/sampler"},{id:"external-texture",label:"ExternalTexture",href:"/docs/api-reference/core/resources/external-texture"}]},layouts:{label:"Layouts and bindings",tabs:[{id:"shader-layout",label:"ShaderLayout",href:"/docs/api-reference/core/shader-layout"},{id:"bindings",label:"Bindings",href:"/docs/api-reference/core/bindings"},{id:"shader-block-layout",label:"Block layout",href:"/docs/api-reference/core/shader-block-layout"},{id:"buffer-layout",label:"BufferLayout",href:"/docs/api-reference/core/buffer-layout"},{id:"uniform-store",label:"UniformStore",href:"/docs/api-reference/core/uniform-store"}]},presentation:{label:"Presentation",tabs:[{id:"canvas-context",label:"CanvasContext",href:"/docs/api-reference/core/canvas-context"},{id:"presentation-context",label:"PresentationContext",href:"/docs/api-reference/core/presentation-context"},{id:"framebuffer",label:"Framebuffer",href:"/docs/api-reference/core/resources/framebuffer"}]}},engine:{starting:{label:"Engine starting points",tabs:[{id:"engine-reference",label:"Overview",href:"/docs/api-reference/engine"},{id:"engine-overview",label:"Programming guide",href:"/docs/api-guide/engine"},{id:"engine-cookbook",label:"Cookbook",href:"/docs/api-guide/engine/cookbook"}]},guides:{label:"Engine learning paths",tabs:[{id:"engine-overview",label:"Overview",href:"/docs/api-guide/engine"},{id:"engine-cookbook",label:"Cookbook",href:"/docs/api-guide/engine/cookbook"},{id:"interaction-guide",label:"Interaction",href:"/docs/api-guide/engine/interactivity"},{id:"scenegraphs",label:"Scenegraphs",href:"/docs/api-guide/engine/scenegraph"},{id:"animation-guide",label:"Animation",href:"/docs/api-guide/engine/animation"},{id:"gpu-computations",label:"Compute",href:"/docs/api-guide/engine/transforms"},{id:"redraw-guide",label:"Redraw",href:"/docs/api-guide/engine/redraw"}]},model:{label:"Models and inputs",tabs:[{id:"model",label:"Model",href:"/docs/api-reference/engine/model"},{id:"shader-inputs-guide",label:"Inputs workflow",href:"/docs/api-guide/engine/shader-inputs"},{id:"shader-inputs",label:"ShaderInputs",href:"/docs/api-reference/engine/shader-inputs"},{id:"materials",label:"Materials",href:"/docs/api-guide/engine/materials"}]},geometry:{label:"Geometry",tabs:[{id:"geometry",label:"Geometry",href:"/docs/api-reference/engine/geometry"},{id:"gpu-geometry",label:"GPUGeometry",href:"/docs/api-reference/engine/geometry/gpu-geometry"},{id:"built-in-geometries",label:"Built-ins",href:"/docs/api-reference/engine/geometry/geometries"}]},scenegraph:{label:"Scenegraphs",tabs:[{id:"scenegraphs",label:"Workflow",href:"/docs/api-guide/engine/scenegraph"},{id:"scenegraph-node",label:"ScenegraphNode",href:"/docs/api-reference/engine/scenegraph/scenegraph-node"},{id:"group-node",label:"GroupNode",href:"/docs/api-reference/engine/scenegraph/group-node"},{id:"model-node",label:"ModelNode",href:"/docs/api-reference/engine/scenegraph/model-node"}]},compute:{label:"Compute",tabs:[{id:"gpu-computations",label:"Workflow",href:"/docs/api-guide/engine/transforms"},{id:"computation",label:"Computation",href:"/docs/api-reference/engine/compute/computation"},{id:"buffer-transform",label:"BufferTransform",href:"/docs/api-reference/engine/compute/buffer-transform"},{id:"texture-transform",label:"TextureTransform",href:"/docs/api-reference/engine/compute/texture-transform"},{id:"swap",label:"Swap",href:"/docs/api-reference/engine/compute/swap"}]},animation:{label:"Animation",tabs:[{id:"animation-guide",label:"Workflow",href:"/docs/api-guide/engine/animation"},{id:"animation-mixer",label:"Mixer",href:"/docs/api-reference/engine/animation/animation-mixer"},{id:"morph-targets",label:"Morph targets",href:"/docs/api-reference/engine/animation/morph-targets"},{id:"animation-loop",label:"AnimationLoop",href:"/docs/api-reference/engine/animation-loop"},{id:"animation-loop-template",label:"Template",href:"/docs/api-reference/engine/animation-loop-template"},{id:"key-frames",label:"KeyFrames",href:"/docs/api-reference/engine/animation/key-frames"},{id:"timeline",label:"Timeline",href:"/docs/api-reference/engine/animation/timeline"}]},"dynamic-resources":{label:"Dynamic resources",tabs:[{id:"dynamic-buffer",label:"DynamicBuffer",href:"/docs/api-reference/engine/dynamic-buffer"},{id:"dynamic-texture",label:"DynamicTexture",href:"/docs/api-reference/engine/dynamic-texture"},{id:"video-texture",label:"VideoTexture",href:"/docs/api-reference/engine/video-texture"},{id:"load-image-bitmap",label:"loadImageBitmap",href:"/docs/api-reference/engine/load-image-bitmap"}]},fullscreen:{label:"Fullscreen and passes",tabs:[{id:"clip-space",label:"ClipSpace",href:"/docs/api-reference/engine/clip-space"}
1,{id:"background-texture-model",label:"Background texture",href:"/docs/api-reference/engine/background-texture-model"},{id:"shader-pass-renderer",label:"Pass renderer",href:"/docs/api-reference/engine/passes/shader-pass-renderer"}]},interaction:{label:"Interaction",tabs:[{id:"interaction-guide",label:"Workflow",href:"/docs/api-guide/engine/interactivity"},{id:"orbit-controls",label:"OrbitControls",href:"/docs/api-reference/engine/orbit-controls"},{id:"picking",label:"PickingManager",href:"/docs/api-reference/engine/picking-manager"}]}},shadertools:{starting:{label:"Shadertools starting points",tabs:[{id:"shadertools-reference",label:"Overview",href:"/docs/api-reference/shadertools"},{id:"shadertools-guide",label:"Programming guide",href:"/docs/api-guide/shaders"},{id:"shadertools-cookbook",label:"Cookbook",href:"/docs/api-guide/shaders/cookbook"}]},"guide-authoring":{label:"Shader authoring guides",tabs:[{id:"shader-assembly",label:"Assembly",href:"/docs/api-guide/shaders/shader-assembly"},{id:"writing-customizable-shaders",label:"Customization",href:"/docs/api-guide/shaders/writing-customizable-shaders"},{id:"writing-portable-shaders",label:"Portability",href:"/docs/api-guide/shaders/writing-portable-shaders"},{id:"shader-passes",label:"Passes",href:"/docs/api-guide/shaders/shader-passes"}]},"guide-techniques":{label:"Shader technique guides",tabs:[{id:"rendering-techniques",label:"Techniques",href:"/docs/api-guide/shaders/rendering-techniques"},{id:"transparency",label:"Transparency",href:"/docs/api-guide/shaders/transparency"},{id:"glass-effects",label:"Glass",href:"/docs/api-guide/shaders/glass-effects"}]},authoring:{label:"Module authoring",tabs:[{id:"shader-module",label:"ShaderModule",href:"/docs/api-reference/shadertools/shader-module"},{id:"shader-plugin",label:"ShaderPlugin",href:"/docs/api-reference/shadertools/shader-plugin"},{id:"shader-assembler",label:"Assembler",href:"/docs/api-reference/shadertools/shader-assembler"},{id:"shader-conventions",label:"Conventions",href:"/docs/api-reference/shadertools/shader-conventions"}]},execution:{label:"Assembly and execution",tabs:[{id:"shader-pass",label:"ShaderPass",href:"/docs/api-reference/shadertools/shader-pass"},{id:"shader-assembler",label:"Assembler",href:"/docs/api-reference/shadertools/shader-assembler"},{id:"shader-info",label:"Shader parsing",href:"/docs/api-reference/shadertools/shader-info"},{id:"wgsl-support",label:"WGSL",href:"/docs/api-reference/shadertools/wgsl-support"}]}}},a=[{id:"shadertools",label:"Shadertools",href:"/docs/api-reference/shadertools"},{id:"engine",label:"Engine",href:"/docs/api-reference/engine"},{id:"core",label:"Core",href:"/docs/api-reference/core"},{id:"gpu-core",label:"GPU Core",href:"/docs/api-reference/experimental/gpu-core"}]},43023(e,r,i){i.d(r,{R:()=>d,x:()=>l});var s=i(63696);let a={},n=s.createContext(a);function d(e){let r=s.useContext(n);return s.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function l(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:d(e.components),s.createElement(n.Provider,{value:r},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.