godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.84k stars 20.15k forks source link

Visual shader inspector panel always collapse on value change #81481

Open bitinn opened 1 year ago

bitinn commented 1 year ago

Godot version

v4.1.1.stable.official [bd6af8e0e]

System information

Godot v4.1.1.stable - macOS 13.5.0 - Vulkan (Forward+) - integrated Apple M2 Max - Apple M2 Max (12 Threads)

Issue description

When editing visual shader's flags and modes under inspector, its panel always collapse after any single value change, making the process of testing values very cumbersome. See attached video.

https://streamable.com/v6w47s

I tried other nested panel such as world environment, they do not suffer from this issue.

https://streamable.com/056dg2

Steps to reproduce

In any new project, create a shader material then assign a new visual shader, modify its flags or modes as shown.

Minimal reproduction project

N/A, should be easy to reproduce in any project. I suspect the issue is due to visual shader recompiling after mode/flag change?

bitsawer commented 1 year ago

Confirmed, this happens at current master too at fc99492d3066098e938449b10e02f8e01d07e2d1. Also StandardMaterial3D and ShaderMaterial seems to work normally, so looks like a VisualShader specific regression.

jsjtxietian commented 11 months ago

I did some quick check and find maybe it's because set these flags or modes will trigger a _queue_update which will call _update_shader, and it will emit change to ShaderMaterial::_shader_changed().

Relared to #74745

viksl commented 6 months ago

@jsjtxietian Well changing the flags does change the shader so it should trigger shader change or not? Btw changing Node3D properties such as rotation edit mode also causes the materials to fold but it does not fold Mesh resource of MeshInstance3D but it does collapse the Material (this time StandardMaterial3D). So it's not just VisualShader related.

Chaosus commented 1 month ago

Its a regression from https://github.com/godotengine/godot/pull/73381 cc @KoBeWi