How do you pass a scene; e.g, kitchen image & 3 char images, to a shader, as a texture?

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

How do you pass a scene; e.g, kitchen image & 3 char images, to a shader, as a texture?

#1 Post by henvu50 »

I have a shader. I need to pass it a base texture image and overlay texture image.

Can I pass the current Ren'py scene as a texture? Imagine you hide the UI, now all you see is a Kitchen and three characters on the screen.

Code: Select all

images/kitchen.png
images/char1.png
images/char2.png
images/char3.png
How do I pass that scene as a texture, or get a variable image that represents the current seen with the UI hidden?

Code: Select all

# pass this as a texture image to a shader
Renpy.ReturnCurrentSceneAsTextureWithoutUI()?
The goal is to be able to apply shaders to the whole scene, minus the UI.

UPDATE: I found a way to combine images into one composite image, then pass that to the shader, but is there a better way?

Code: Select all

image dynamic_scene_image = Composite(
    (1920, 1080),
    (dynamicImg01_x, dynamicImg01_y), dynamicImg01,
    (dynamicImg02_x, dynamicImg02_y), dynamicImg02)

label test():
    show screen_shader_combined_image_of_scene:
        shader("photoshop.softlight")
        Model().child("dynamic_scene_image").child("images/soft_light_overlay_effect05.png")
    
    "Screen Shader Applied"
    hide screen_shader_combined_image_of_scene
    "Black Screen"

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]