godotengine / godotengine/godot

Texture shader parameter is missing reset button.

Open
#96,941 6 comments 0 reactions 0 assignees View on GitHub
bug confirmed topic:editor topic:shaders
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.
![Screenshot from 2024-09-12 21-28-17](https://github.com/user-attachments/assets/70e055d1-fba0-4975-82e4-6fd648f95171)

When u set a `Texture` in a `ShaderMaterial` parameter you don't.
![Screenshot from 2024-09-12 21-28-08](https://github.com/user-attachments/assets/143b5d93-db39-4c66-998f-af8e207ace8d)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.