aboutsummaryrefslogtreecommitdiff
path: root/web/pw-visualizer/src/webgl/texture.ts
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-11-06 17:43:00 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-11-06 18:07:16 +0100
commitfdc2ab9421c6a38c6bbd9b621c4da4f2c147a773 (patch)
tree50466d9b751f1e1eb3ee8a47479a4d28b5050aa6 /web/pw-visualizer/src/webgl/texture.ts
parentd3845eb85fc8f75562a6e121c5e437763ffeea63 (diff)
downloadplanetwars.dev-fdc2ab9421c6a38c6bbd9b621c4da4f2c147a773.tar.xz
planetwars.dev-fdc2ab9421c6a38c6bbd9b621c4da4f2c147a773.zip
msdf font renderen
Diffstat (limited to 'web/pw-visualizer/src/webgl/texture.ts')
-rw-r--r--web/pw-visualizer/src/webgl/texture.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/pw-visualizer/src/webgl/texture.ts b/web/pw-visualizer/src/webgl/texture.ts
index 9624489..9ebd5c0 100644
--- a/web/pw-visualizer/src/webgl/texture.ts
+++ b/web/pw-visualizer/src/webgl/texture.ts
@@ -67,8 +67,14 @@ export class Texture {
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ if (name == "font") {
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ } else {
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+
+ }
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA,
gl.UNSIGNED_BYTE, new Uint8Array([255, 0, 0, 255]));