These are wgsl functions, not js functions. The function is enclosed in a js string constant, to be appended into the code to reference it in the string shader.
- Source:
- core/image.js, line 1
Members
staticconstantdecodeNumberSprite String
From a provided number, get the sprite in an atlas that matches the value.
- Source:
- core/image.js, line 284
Example
import { decodeNumberSprite } from 'points/image'; // wgsl string ${decodeNumberSprite} let value = decodeNumberSprite(numberToDecode, start0char, image, position, startPosition, uvr, ratio, size);
js
staticconstantflipTextureUV String
Flips texture in Y. This because it comes flipped, so this corrects it.
- Source:
- core/image.js, line 199
Example
import { flipTextureUV } from 'points/image'; // wgsl string ${flipTextureUV} let value = flipTextureUV(uvr);
js
staticconstantpixelateTexture String
Increase the aparent pixel size of the texture image using textureSample
.
This reduces the quality of the image.
- Source:
- core/image.js, line 332
Example
import { pixelateTexture } from 'points/image'; // wgsl string ${pixelateTexture} let value = pixelateTexture(image, imageSampler, 10,10, uvr);
js
staticconstantpixelateTexturePosition String
Increase the aparent pixel size of the texture image using texturePosition
.
This reduces the quality of the image.
- Source:
- core/image.js, line 363
Example
import { pixelateTexturePosition } from 'points/image'; // wgsl string ${pixelateTexturePosition} let value = pixelateTexturePosition(image, imageSampler, vec2f(), 10,10, uvr);
js
staticconstantsprite String
Sprite or Atlas. Extract a piece of the sprite with an index.
- Source:
- core/image.js, line 224
Example
import { sprite } from 'points/image'; // wgsl string ${sprite} let value = sprite(texture, imageSampler, vec2f(), uvr, 0, vec2(8u,22u) );
js
staticconstanttexture String
Places a texture. The texture being an image loaded from the JS side.
- Source:
- core/image.js, line 28
Example
import { texture } from 'points/image'; await points.setTextureImage('image', 'myimage.jpg'); // wgsl string ${texture} let value = texture(image, imageSampler, uvr, true);
js
staticconstanttextureExternal String
places texture_external in a position
- Source:
- core/image.js, line 116
Example
import { textureExternal } from 'points/image'; await points.setTextureVideo('video', 'myvideo.mp4'); // wgsl string ${textureExternal} let value = textureExternal(video, imageSampler, uvr, true);
js
staticconstanttextureExternalPosition String
Places texture_external in a position. Texture external being in this case a video loaded as texture in the JS side.
- Source:
- core/image.js, line 160
Example
import { textureExternalPosition } from 'points/image'; await points.setTextureVideo('video', 'myvideo.mp4'); // wgsl string ${textureExternalPosition} let value = textureExternalPosition(video, imageSampler, vec2f(), uvr, true);
js
staticconstanttexturePosition String
Places texture in a position
- Source:
- core/image.js, line 73
Example
import { texturePosition } from 'points/image'; await points.setTextureImage('image', 'myimage.jpg'); // wgsl string ${texturePosition} let value = texturePosition(image, imageSampler, vec2f(), uvr, true);
js