godotengine / godotengine/godot
Texture shader parameter is missing reset button.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- latest 4.4
### System information
Godot v4.3.stable - Ubuntu 24.04.1 LTS 24.04 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (RADV NAVI23) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)
### Issue description
When u set a `Texture` in a `StandardMaterial3D` you get a reset button.

When u set a `Texture` in a `ShaderMaterial` parameter you don't.

Other (some/most/all?) types of shader params have the correct reset button.
Similar to https://github.com/godotengine/godot/issues/95953
Probably related to this code:
```
bool ShaderMaterial::_property_can_revert(const StringName &p_name) const {
if (shader.is_valid()) {
const StringName *pr = remap_cache.getptr(p_name);
if (pr) {
Variant default_value = RenderingServer::get_singleton()->shader_get_parameter_default(shader->get_rid(), *pr);
Variant current_value = get_shader_parameter(*pr);
return default_value.get_type() != Variant::NIL && default_value != current_value;
} else if (p_name == "render_priority" || p_name == "next_pass") {
return true;
}
}
return false;
}
```
Thanks.
### Steps to reproduce
- set texture to shader param in editor
### Minimal reproduction project (MRP)
https://github.com/rakkarage/testtextureshaderparameter
Contributor guide
Research direction
Start at ShaderMaterial::_property_can_revert, which the issue identifies as related to the missing reset button, and compare its handling of texture shader parameters with StandardMaterial3D. Use the linked minimal reproduction project to set a texture shader parameter in the editor; done means the parameter exposes a working reset button like the StandardMaterial3D case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100