godotengine / godotengine/godot

C# CompositorEffect does not work, and it will stuck the engine when re-opening the project

Open
#95,286 5 comments 0 reactions 0 assignees View on GitHub
bug needs testing topic:dotnet topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Godot v4.3.rc2.mono.official [3978628c6]

### System information

Godot v4.3.rc2.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 (NVIDIA; 31.0.15.3161) - AMD Ryzen 9 7900X 12-Core Processor (24 Threads)

### Issue description

I'm trying to write a compositor effect for rendering a custom texture for my rendering proposal.

However, I failed at making translation [the official demo](https://github.com/godotengine/godot-demo-projects/tree/master/compute/post_shader) to C# version in the first step.

I put the initialization step into the constructor, and marked the class as [GlobalClass] and [Tool]. But it does not work when I attached it to a Compositor of a WorldEnviroment Node.

More severely, if I saved the scene with a C# compositor effect, the engine will be stuck when the project is re-opened.

### Steps to reproduce

In MRP, I've made an available CompositorEffect with GDScript and a C# version translation of it.
The custom CompositorEffect will make rendered object completely black.

1. Switch the GDScript version and C# version for the WorldEnvironment's Compositor in the main scene.
2. The C# version should take no effect at all.

3. Save the scene with C# version is attached. Then close the engine.
4. Re-open this project, engine will be stuck. (later manually delete the compositor in .tscn file can re-open this project successfully)

### Minimal reproduction project (MRP)

[CompositorCSharpMRP.zip](https://github.com/user-attachments/files/16550921/CompositorCSharpMRP.zip)

Contributor guide

Open the contributing guide

Research direction

Open the attached CompositorCSharpMRP.zip and run the reproduction using the WorldEnvironment node's CompositorEffect. Compare the GDScript and C# versions while switching them, then save and reopen the scene to observe the engine hang. Done means the C# compositor effect works and the project reopens normally with it attached.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.