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 203
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 118
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 251
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 282
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 143
Example
import { sprite } from 'points/image'; // wgsl string ${sprite} let value = sprite(texture, imageSampler, vec2f(), uvr, 0, vec2(8u,22u) );
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 76
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. The texture being an image loaded from the JS side.
- Source:
- core/image.js, line 28
Example
import { texturePosition } from 'points/image'; await points.setTextureImage('image', 'myimage.jpg'); // wgsl string ${texturePosition} let value = texturePosition(image, imageSampler, vec2f(), uvr, true);
js