Exception: Live2D shader has not been given uniform tex1 error

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Exception: Live2D shader has not been given uniform tex1 error

#1 Post by Mole-chan »

Hello,
I'm trying to integrate a Live2D model into a short game but have been met with this error.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 41, in script
    k "-YAWN-"
  File "renpy/common/000window.rpy", line 114, in _window_auto_callback
    _window_show(auto=True)
  File "renpy/common/000window.rpy", line 69, in _window_show
    renpy.with_statement(trans)
Exception: Shader ('live2d.flip_texture', 'live2d.inverted_mask', 'renpy.geometry', 'renpy.texture') has not been given uniform tex1.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 41, in script
    k "-YAWN-"
  File "D:\Downloads\renpy-8.0.3-sdk\renpy\ast.py", line 889, in execute
    statement_name(stmt_name)
  File "D:\Downloads\renpy-8.0.3-sdk\renpy\ast.py", line 47, in statement_name
    i(name)
  File "renpy/common/000window.rpy", line 114, in _window_auto_callback
    _window_show(auto=True)
  File "renpy/common/000window.rpy", line 69, in _window_show
    renpy.with_statement(trans)
  File "D:\Downloads\renpy-8.0.3-sdk\renpy\exports.py", line 1657, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "D:\Downloads\renpy-8.0.3-sdk\renpy\display\core.py", line 2798, in do_with
    return self.interact(trans_pause=True,
  File "D:\Downloads\renpy-8.0.3-sdk\renpy\display\core.py", line 3377, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
  File "D:\Downloads\renpy-8.0.3-sdk\renpy\display\core.py", line 3912, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "D:\Downloads\renpy-8.0.3-sdk\renpy\display\core.py", line 2609, in draw_screen
    renpy.display.draw.draw_screen(surftree)
  File "gl2draw.pyx", line 815, in renpy.gl2.gl2draw.GL2Draw.draw_screen
  File "gl2draw.pyx", line 872, in renpy.gl2.gl2draw.GL2Draw.load_all_textures
  File "gl2draw.pyx", line 872, in renpy.gl2.gl2draw.GL2Draw.load_all_textures
  File "gl2draw.pyx", line 872, in renpy.gl2.gl2draw.GL2Draw.load_all_textures
  [Previous line repeated 7 more times]
  File "gl2draw.pyx", line 885, in renpy.gl2.gl2draw.GL2Draw.load_all_textures
  File "gl2draw.pyx", line 918, in renpy.gl2.gl2draw.GL2Draw.render_to_texture
  File "gl2texture.pyx", line 206, in renpy.gl2.gl2texture.TextureLoader.render_to_texture
  File "gl2texture.pyx", line 360, in renpy.gl2.gl2texture.GLTexture.from_render
  File "gl2draw.pyx", line 1341, in renpy.gl2.gl2draw.GL2DrawingContext.draw
  File "gl2draw.pyx", line 1322, in renpy.gl2.gl2draw.GL2DrawingContext.draw_one
  File "gl2draw.pyx", line 1322, in renpy.gl2.gl2draw.GL2DrawingContext.draw_one
  File "gl2draw.pyx", line 1236, in renpy.gl2.gl2draw.GL2DrawingContext.draw_one
  File "gl2draw.pyx", line 1203, in renpy.gl2.gl2draw.GL2DrawingContext.draw_model
  File "gl2shader.pyx", line 313, in renpy.gl2.gl2shader.Program.draw
  File "gl2shader.pyx", line 264, in renpy.gl2.gl2shader.Program.missing
Exception: Shader ('live2d.flip_texture', 'live2d.inverted_mask', 'renpy.geometry', 'renpy.texture') has not been given uniform tex1.

Windows-10-10.0.19045 AMD64
Ren'Py 8.0.3.22090809
Rounded GUI 1.1.0
Wed Apr 12 15:34:20 2023
It seems to be rooted in a couple inverted masks that are used throughout the model, but the error itself gives no real clues on how to solve it.

For context, I am using the latest version of Ren'py and the latest version of the Live2D sdk. Config.gl2 has been set to true in options.rpy. All of the model's .json and texture files are present.

Any help would be appreciated, as I do hope to use Live2D more in the future and nipping this in the bud would be preferable.

Thank you.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Exception: Live2D shader has not been given uniform tex1 error

#2 Post by PyTom »

Can you send me the model that's causing this problem, and the command you're using to show the Live2D displayable? What I'm seeing doesn't make a ton of sense, so I too would like to figure this one out.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Re: Exception: Live2D shader has not been given uniform tex1 error

#3 Post by Mole-chan »

PyTom wrote: Thu Apr 13, 2023 10:44 pm Can you send me the model that's causing this problem, and the command you're using to show the Live2D displayable? What I'm seeing doesn't make a ton of sense, so I too would like to figure this one out.
Thank you for getting back to me! And glad it's not just me that's stumped.

The command to show the displayable is pretty standard, using the documentation as reference. Here it is with some additional surrounding code for context:

show screen FakePhone
show kiki idl
with pixellate
$play_music("audio/sleep.ogg")
k tired "-YAWN-"
k sad "I wonder if anyone is still awake. If I'm going to be up and miserable, I may as well have company…"


The displayable itself is defined as such:

image kiki = Live2D("images/kiki", height=.7, loop=True, nonexclusive=["blush","side_eye", "closed_eyes","slight_frown"], fade=True, default_fade=.4)

I've also attached the model, as requested. Please tell me if you'd like the original CMO3 file. I opted not to include it right away as it is quite large and I didn't want to burden you with it if it wouldn't be helpful.

I hope this additional context helps!
Attachments
problem L2D model.zip
(6.49 MiB) Downloaded 13 times

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Exception: Live2D shader has not been given uniform tex1 error

#4 Post by PyTom »

Just landed a fix for this. The fix will be in the next nightlies. Thanks for posting the data.

The problem seems to be caused by layers that both used a mask, and were used by a mask.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Mole-chan
Veteran
Posts: 333
Joined: Thu Aug 27, 2009 12:46 am
Completed: DUAEL, Escape from Puzzlegate
Projects: A Bird with Gold-Mended Wings
Deviantart: mole-chan
Skype: mole-chan
itch: moleworks
Contact:

Re: Exception: Live2D shader has not been given uniform tex1 error

#5 Post by Mole-chan »

PyTom wrote: Thu Apr 20, 2023 1:04 am Just landed a fix for this. The fix will be in the next nightlies. Thanks for posting the data.

The problem seems to be caused by layers that both used a mask, and were used by a mask.
Awesome, thank you very much!

I'm glad my obscure issue could be of help in development.

Post Reply

Who is online

Users browsing this forum: No registered users