godotengine / godotengine/godot

Render 3D Transparent Pass takes 80+ ms for a simple empty scene + cube

Open
#95,112 0 comments 0 reactions 0 assignees View on GitHub
bug performance topic:3d topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Godot Engine v4.3.rc2.official.3978628c6 - https://godotengine.org

### System information

OpenGL API 4.1 Metal - 88 - Compatibility - Using Device: Apple - Apple M1 Pro

### Issue description

The profiler shows a spike in frame time, with `Render 3D Transparent Pass` taking 80+ ms.

I attached a MRP with an empty scene that instantiates a cube when you click with the left mouse button.

The cube is just a MeshInstance3D with a StandardMaterial3D.
It has Transparency = Alpha, and an AnimationPlayer with an animation that pulses the color changing the alpha.

The curious thing is that it only happens in a single frame, after that, the frame time is fine for all the frames.

![Screenshot 2024-08-03 at 8 59 37 PM](https://github.com/user-attachments/assets/9fc6679d-bc1b-4c98-ae86-91b289fef831)
![Screenshot 2024-08-03 at 9 05 47 PM](https://github.com/user-attachments/assets/a311f612-a3d1-48ce-8abc-419e45d835a3)

### Steps to reproduce

1. unzip the MRP
2. open in godot
3. click the play button
4. start the visual profiler
5. go to the game and click with the left mouse button inside the window
6. observe the cube being instantiated
7. observe the spike in frame time in the profiler

### Minimal reproduction project (MRP)

[render-3d-transparent-pass.zip](https://github.com/user-attachments/files/16484288/render-3d-transparent-pass.zip)

Contributor guide

Open the contributing guide

Research direction

Open the attached render-3d-transparent-pass.zip project and reproduce the issue using the listed steps. Run Godot's visual profiler while instantiating the transparent animated cube, then trace the reported Render 3D Transparent Pass spike to the responsible rendering area. Done means the reproduction no longer causes an unexplained 80+ ms single-frame spike, with profiling results confirming the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
computer-graphics, game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.