Skip to content

Commit

Permalink
Fixup uncached texture detection, update gallery.
Browse files Browse the repository at this point in the history
  • Loading branch information
ILOVEPIE committed Dec 20, 2023
1 parent 86b2554 commit 5b398c8
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ A Gpu Accelerated Javascript Advanced Substation Alpha Subtitles Renderer.
SABRE.js is a full renderer for Substation Alpha Subtitles and Advanced Substation Alpha Subtitles.
It allows you to draw styled/stylized subtitles over web video with multiple fonts, colors, animations and effects.

<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>

#### Other Similar software.

- Javascript-Subtitles-Octopus
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ A Gpu Accelerated Javascript Advanced Substation Alpha Subtitles Renderer.
SABRE.js is a full renderer for Substation Alpha Subtitles and Advanced Substation Alpha Subtitles.
It allows you to draw styled/stylized subtitles over web video with multiple fonts, colors, animations and effects.

<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>

#### Other Similar software.

- Javascript-Subtitles-Octopus
Expand Down
9 changes: 9 additions & 0 deletions gallery/but_i_use_safari.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@

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

Karaoke FTW!

![Karaoke FTW!](/gallery/images/gallery2.png)

Japanese text works too!

![Japanese text works too!](/gallery/images/gallery3.png)

### 12/19/2023 - Video Demo

![karaoke in motion](/gallery/images/mahouka_intro.gif)
9 changes: 9 additions & 0 deletions gallery/gallery.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@

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

Karaoke FTW!

![Karaoke FTW!](/gallery/images/gallery2.webp)

Japanese text works too!

![Japanese text works too!](/gallery/images/gallery3.webp)

### 12/19/2023 - Video Demo

![karaoke in motion](/gallery/images/mahouka_intro.webp)
Binary file added gallery/images/demo_loop.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/images/mahouka_intro.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gallery/images/mahouka_intro.webp
Binary file not shown.
Binary file added gallery/video/demo_loop.mp4
Binary file not shown.
8 changes: 4 additions & 4 deletions src/renderer-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3129,7 +3129,7 @@ const renderer_prototype = global.Object.create(Object, {
let cachedGlyphInfo = null;
let cachedMaskGlyphInfo = null;
this._gl.activeTexture(this._gl.TEXTURE0);
if (texHash === null) {
if (texHash === null || !this._checkGlyphCache(texHash,texIndex)) {
this._gl.bindTexture(this._gl.TEXTURE_2D, this._textureSubtitle);
this._loadSubtitleToVram(source, this._textureSubtitleBounds);
} else {
Expand All @@ -3138,7 +3138,7 @@ const renderer_prototype = global.Object.create(Object, {
}
if (!isShape) {
this._gl.activeTexture(this._gl.TEXTURE1);
if (texMaskHash === null) {
if (texMaskHash === null || !this._checkGlyphCache(texMaskHash,texMaskIndex)) {
this._gl.bindTexture(
this._gl.TEXTURE_2D,
this._textureSubtitleMask
Expand Down Expand Up @@ -3216,7 +3216,7 @@ const renderer_prototype = global.Object.create(Object, {
],0);

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

let mask_coords;
if (!isShape) {
if (texMaskHash === null) {
if (texMaskHash === null || !this._checkGlyphCache(texMaskHash,texMaskIndex)) {
let maskDimensions =
this._textMaskRenderer.getTextureDimensions();
let extents = this._textureSubtitleMaskBounds;
Expand Down

0 comments on commit 5b398c8

Please sign in to comment.