Godot Version
Godot 4.5.1 stable
Question
I have a bunch of shader globals defined in project settings, one of which is height_map, a Texture2D. For some reason, while working perfectly in the shaders, they are inaccessible in GDScript. Relevant code is:
var updated : bool = false
func update_shader_parameters():
if updated: return
print("Updating glovals...")
print()
heightmap = RenderingServer.global_shader_parameter_get("height_map").get_image()
print("global heightmap: ", heightmap)
power = RenderingServer.global_shader_parameter_get("power")
max_height = RenderingServer.global_shader_parameter_get("max_height")
const1 = RenderingServer.global_shader_parameter_get("const1")
original_map_size = RenderingServer.global_shader_parameter_get("map_size")
factor = size / original_map_size
offset = (1.0 - factor) / 2.0
updated = true
Another issue is that for some reason the height_map gets set to null everytime I restart the project for whatever reason. This only happens with this Texture2D, and not floats or other values.
I have checked and this isnt due to typos or anything, I can’t figure out what the issue is. Any help would be appreciated.
