how do i load different textures in shader_param with gdscript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By koolaid

Since i have different masks that I can use for the transition, I want to be able to choose the mask I want to use. However I don’t know how to load it in code.

:bust_in_silhouette: Reply From: Inces
material.set_shader_param("mask", preload("pathtoyourtexturehere"))

It is in built-in documentation ;). The only problem is referencing the material. Take a note what material path You are using - it can be mesh.material or surface_get_material(surface) or material_override or even draw_pass.material

thank u so much

koolaid | 2022-02-19 09:50