Skip to content

Commit 3870668

Browse files
committed
Fixup uncached texture detection, update gallery.
1 parent 86b2554 commit 3870668

9 files changed

Lines changed: 26 additions & 4 deletions

File tree

README.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ A Gpu Accelerated Javascript Advanced Substation Alpha Subtitles Renderer.
99
SABRE.js is a full renderer for Substation Alpha Subtitles and Advanced Substation Alpha Subtitles.
1010
It allows you to draw styled/stylized subtitles over web video with multiple fonts, colors, animations and effects.
1111

12+
<span style="text-align:center; width:100%; display: inline-block;"></span>[![karaoke demo loop](gallery/images/demo_loop.gif)](gallery/video/demo_loop.mp4)</video></span>
13+
1214
#### Other Similar software.
1315

1416
- Javascript-Subtitles-Octopus

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ A Gpu Accelerated Javascript Advanced Substation Alpha Subtitles Renderer.
99
SABRE.js is a full renderer for Substation Alpha Subtitles and Advanced Substation Alpha Subtitles.
1010
It allows you to draw styled/stylized subtitles over web video with multiple fonts, colors, animations and effects.
1111

12+
<span style="text-align:center; width:100%; display: inline-block;"></span>[![karaoke demo loop](gallery/images/demo_loop.gif)](gallery/video/demo_loop.mp4)</video></span>
13+
1214
#### Other Similar software.
1315

1416
- Javascript-Subtitles-Octopus

gallery/but_i_use_safari.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,14 @@
88

99
### 5/15/2021 - Closing in on psychovisual equivalency with libass...
1010

11+
Karaoke FTW!
12+
1113
![Karaoke FTW!](/gallery/images/gallery2.png)
14+
15+
Japanese text works too!
16+
1217
![Japanese text works too!](/gallery/images/gallery3.png)
18+
19+
### 12/19/2023 - Video Demo
20+
21+
![karaoke in motion](/gallery/images/mahouka_intro.gif)

gallery/gallery.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,14 @@
66

77
### 5/15/2021 - Closing in on psychovisual equivalency with libass...
88

9+
Karaoke FTW!
10+
911
![Karaoke FTW!](/gallery/images/gallery2.webp)
12+
13+
Japanese text works too!
14+
1015
![Japanese text works too!](/gallery/images/gallery3.webp)
16+
17+
### 12/19/2023 - Video Demo
18+
19+
![karaoke in motion](/gallery/images/mahouka_intro.webp)

gallery/images/demo_loop.gif

12.8 MB
Loading

gallery/images/mahouka_intro.gif

87.9 MB
Loading

gallery/images/mahouka_intro.webp

85.7 MB
Loading

gallery/video/demo_loop.mp4

2.06 MB
Binary file not shown.

src/renderer-main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,7 +3129,7 @@ const renderer_prototype = global.Object.create(Object, {
31293129
let cachedGlyphInfo = null;
31303130
let cachedMaskGlyphInfo = null;
31313131
this._gl.activeTexture(this._gl.TEXTURE0);
3132-
if (texHash === null) {
3132+
if (texHash === null || !this._checkGlyphCache(texHash,texIndex)) {
31333133
this._gl.bindTexture(this._gl.TEXTURE_2D, this._textureSubtitle);
31343134
this._loadSubtitleToVram(source, this._textureSubtitleBounds);
31353135
} else {
@@ -3138,7 +3138,7 @@ const renderer_prototype = global.Object.create(Object, {
31383138
}
31393139
if (!isShape) {
31403140
this._gl.activeTexture(this._gl.TEXTURE1);
3141-
if (texMaskHash === null) {
3141+
if (texMaskHash === null || !this._checkGlyphCache(texMaskHash,texMaskIndex)) {
31423142
this._gl.bindTexture(
31433143
this._gl.TEXTURE_2D,
31443144
this._textureSubtitleMask
@@ -3216,7 +3216,7 @@ const renderer_prototype = global.Object.create(Object, {
32163216
],0);
32173217

32183218
let tex_coords;
3219-
if (texHash === null) {
3219+
if (texHash === null || !this._checkGlyphCache(texHash,texIndex)) {
32203220
let dimensions = source.getTextureDimensions();
32213221
let extents = this._textureSubtitleBounds;
32223222
let width = dimensions[0] / extents[0];
@@ -3247,7 +3247,7 @@ const renderer_prototype = global.Object.create(Object, {
32473247

32483248
let mask_coords;
32493249
if (!isShape) {
3250-
if (texMaskHash === null) {
3250+
if (texMaskHash === null || !this._checkGlyphCache(texMaskHash,texMaskIndex)) {
32513251
let maskDimensions =
32523252
this._textMaskRenderer.getTextureDimensions();
32533253
let extents = this._textureSubtitleMaskBounds;

0 commit comments

Comments
 (0)