Godot Version
Godot 4.6.1
Question
I currently have a 3d project and I’m trying to create a skybox using WorldEnvironment. I want to change a shader parameter of an offset in a Gradient color ramp a noisetexture2D.
I’ve this so far, but i don’t know how get the value for the offsets in the color ramp
$WorldEnvironment.environment.sky.sky_material.set_shader_parameter("noise")
Print the returned object to determine its type then look into class reference to see what properties of that object you can access.
I made small mistake in the original code snippet. I wanted to set the shader parameter, the problem is that i don’t know how to get the directory of the offset value, i’ve only made it work up to the noise parameter.
Apply what I described above recursively and you’ll get to the wanted property.
Can you explain a bit more? I still don’t understand
print($WorldEnvironment.environment.sky.sky_material.get_shader_parameter("noise")) to see the type of the object that is assigned to the shader parameter. Then look up that type in the class reference to see its properties. Find the relevant property and look up its type in the reference… Repeat the process until you find what you’re looking for.
1 Like