godotengine / godotengine/godot

Global shader sampler variables don't store their values

Open
#92,178 3 comments 0 reactions 0 assignees View on GitHub
bug confirmed topic:shaders
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Tested in: Godot v4.3.dev [40b4130c9] and v4.3.dev6.official [89850d553]

### System information

Godot v4.3.dev (40b4130c9) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21912.14) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

### Issue description

Godot don't store the data from any sampler variable type, after set the value in project settings restarting the editor make all the sampler variables go back to empty, the exception is if you use a resource already stored in your project directory, in this case the value will be preserved after the restart

https://github.com/godotengine/godot/assets/44306054/ae47ecba-60c8-42e5-b6ea-ff5119c74986

### Steps to reproduce

Create a new global shader variable in project settings of any sampler type
Create a new resource inside the variable
Close project settings and restart the editor

When you open the global shaders again the variable will be empty

### Minimal reproduction project (MRP)

No needed, any project can reproduce that.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue from Project Settings by creating a global shader variable with a sampler resource, closing the settings, and restarting the editor. Verify whether the sampler value is empty afterward, then trace the global shader variable persistence path and add coverage for sampler resources surviving an editor restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, tooling
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.