Godot Version
4.5.1
Question
I have a noise texture in a shader, and i want to reach it by a gdscript. However, I just can’t figure it out, how to do it… Any ideas how?
4.5.1
I have a noise texture in a shader, and i want to reach it by a gdscript. However, I just can’t figure it out, how to do it… Any ideas how?
You can use ShaderMaterial.get_shader_parameter() for that. For example: var noise_tex = $MeshInstance3D.material.get_shader_parameter("noise_tex")
Thank you!
I have access to the texture, but how to reach it’s seed?
Textures don’t have seeds. Texture is just an array of pixels.
If an existing NoiseTexture2D object was previously assigned to that shader parameter, you can simply cast the return type to NoiseTexture2D and access its noise object’s seed property.
I know, I mean the noise texture
Thank you guys for the help, I got the code working!