Skip to content

Rework updating editor viewport HDR#116248

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
KoBeWi:ReloadHD
Feb 26, 2026
Merged

Rework updating editor viewport HDR#116248
Repiteo merged 1 commit into
godotengine:masterfrom
KoBeWi:ReloadHD

Conversation

@KoBeWi

@KoBeWi KoBeWi commented Feb 13, 2026

Copy link
Copy Markdown
Member

Follow-up to #94496 (review)
Replaces manual updating of viewport's HDR on setting change with a method that allows registering relevant viewports in EditorNode, so it's handled automatically.

Could use some testing, but it should work the same as before.

@KoBeWi KoBeWi added this to the 4.x milestone Feb 13, 2026
@KoBeWi KoBeWi requested review from a team as code owners February 13, 2026 12:39
Comment thread editor/scene/material_editor_plugin.cpp
@akien-mga akien-mga requested review from a team and allenwp February 13, 2026 13:00
@KoBeWi KoBeWi force-pushed the ReloadHD branch 2 times, most recently from 9511192 to 31d5194 Compare February 13, 2026 15:26
@allenwp

allenwp commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for the review request! I'll give this a review at some point when the checks are passing. @DarkKilauea may also be interested in seeing this as well.

@DarkKilauea DarkKilauea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me, I'll test them this weekend when I get back to my desktop.

Left only a minor comment.

Comment thread editor/editor_node.cpp Outdated

@Calinou Calinou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally (rebased on top of master 8120fb1), it works as expected. Code looks good to me.

@KoBeWi KoBeWi modified the milestones: 4.x, 4.7 Feb 21, 2026

@allenwp allenwp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the following crash:

Exception thrown: read access violation.
**this** was nullptr.

call stack:

>	godot.windows.editor.dev.x86_64.exe!Node::is_inside_tree() Line 551	C++
 	godot.windows.editor.dev.x86_64.exe!Viewport::set_use_hdr_2d(bool p_enable) Line 1279	C++
 	godot.windows.editor.dev.x86_64.exe!EditorNode::_update_from_settings() Line 560	C++
 	godot.windows.editor.dev.x86_64.exe!call_with_variant_args_helper<EditorNode>(EditorNode * p_instance, void(EditorNode::*)() p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<> __formal) Line 237	C++
 	godot.windows.editor.dev.x86_64.exe!call_with_variant_args<EditorNode>(EditorNode * p_instance, void(EditorNode::*)() p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 351	C++
 	godot.windows.editor.dev.x86_64.exe!CallableCustomMethodPointer<EditorNode,void>::call(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 103	C++
 	godot.windows.editor.dev.x86_64.exe!Callable::callp(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 57	C++
 	godot.windows.editor.dev.x86_64.exe!Object::emit_signalp(const StringName & p_name, const Variant * * p_args, int p_argcount) Line 1389	C++
 	godot.windows.editor.dev.x86_64.exe!Object::emit_signal<>(const StringName & p_name) Line 977	C++
 	godot.windows.editor.dev.x86_64.exe!ProjectSettings::_emit_changed() Line 570	C++
 	godot.windows.editor.dev.x86_64.exe!call_with_variant_args_helper<ProjectSettings>(ProjectSettings * p_instance, void(ProjectSettings::*)() p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<> __formal) Line 237	C++
 	godot.windows.editor.dev.x86_64.exe!call_with_variant_args<ProjectSettings>(ProjectSettings * p_instance, void(ProjectSettings::*)() p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 351	C++
 	godot.windows.editor.dev.x86_64.exe!CallableCustomMethodPointer<ProjectSettings,void>::call(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 103	C++
 	godot.windows.editor.dev.x86_64.exe!Callable::callp(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 57	C++
 	godot.windows.editor.dev.x86_64.exe!CallQueue::_call_function(const Callable & p_callable, const Variant * p_args, int p_argcount, bool p_show_error) Line 220	C++
 	godot.windows.editor.dev.x86_64.exe!CallQueue::flush() Line 268	C++
 	godot.windows.editor.dev.x86_64.exe!SceneTree::process(double p_time) Line 706	C++
 	godot.windows.editor.dev.x86_64.exe!Main::iteration() Line 4939	C++
 	godot.windows.editor.dev.x86_64.exe!OS_Windows::run() Line 2354	C++
 	godot.windows.editor.dev.x86_64.exe!widechar_main(int argc, wchar_t * * argv) Line 99	C++
 	godot.windows.editor.dev.x86_64.exe!_main() Line 126	C++
 	godot.windows.editor.dev.x86_64.exe!main(int argc, char * * argv) Line 140	C++
 	godot.windows.editor.dev.x86_64.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 154	C++
 	[External Code]	
 	godot.windows.editor.dev.x86_64.exe!ShimMainCRTStartup(...) Line 74	C
 	[External Code]	

Steps to reproduce:

  1. Create a standard 3D material resource
  2. Open the standard 3D material resource in the inspector
  3. Open something else in the inspector
  4. Open the standard 3D material resource in the inspector
  5. Open project settings and toggle Window/request_hdr_output on or off
  6. Crash

MRP: hdr-editor-crash.zip

@KoBeWi

KoBeWi commented Feb 26, 2026

Copy link
Copy Markdown
Member Author

Fixed. Turns out I was using ObjectID wrong.

@allenwp

allenwp commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Thanks! I'll retest/review once github checks are passing again.

@allenwp allenwp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this does look like a much nicer way to handle this!

@Repiteo Repiteo merged commit 77c6669 into godotengine:master Feb 26, 2026
20 checks passed
@Repiteo

Repiteo commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@KoBeWi KoBeWi deleted the ReloadHD branch February 26, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment