Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement overdraw, lighting, and unshaded debug draw modes for OpenGL #86677

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

daustria
Copy link
Contributor

@daustria daustria commented Jan 1, 2024

Debug lighting and unshaded should work as expected. For unshaded specifically it seems like most of the work was already there and just needed to be toggled by setting the right variant.

For overdraw mode, using the same shader as the one used in the forward renderer results in faded colours, probably due to doing blending in srgb vs linear space. one way to compensate for this is to set a higher alpha which is done in this implementation. I attached some pictures of what this looks like, although it doest quite match the forward renderer. I chose to set ALPHA=0.2 instead of ALPHA=0.1 as in forward+ (i wanted to match the colour of forward+, setting ALPHA=0.3 makes the objects look too blue compared to forward+)

overdraw imgaes

bugsquad edit: Fixes #82485

@fire fire changed the title implement overdraw, lighting, and unshaded debug draw modes for opengl Implement overdraw, lighting, and unshaded debug draw modes for opengl Jan 1, 2024
@fire
Copy link
Member

fire commented Jan 1, 2024

@lyuma do you think we should have an engine implementation of the gamma conversion hack for compatibility/opengl?

@daustria
Copy link
Contributor Author

daustria commented Jan 1, 2024

do you think we should have an engine implementation of the gamma conversion hack for compatibility/opengl?

that sounds interesting, is there a link or file i can see to understand what hack you are talking about?

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Looks great so far. I left a few comments that will need to be addressed. But it shouldn't be too much work. Please let me know if you have any questions!

drivers/gles3/rasterizer_scene_gles3.cpp Outdated Show resolved Hide resolved
drivers/gles3/rasterizer_scene_gles3.cpp Outdated Show resolved Hide resolved
drivers/gles3/rasterizer_scene_gles3.cpp Outdated Show resolved Hide resolved
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Looks great to me now! Good job!

@clayjohn clayjohn modified the milestones: 4.x, 4.3 Jan 22, 2024
@clayjohn clayjohn added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Jan 22, 2024
@YuriSizov YuriSizov merged commit 0fa5aa5 into godotengine:master Jan 24, 2024
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks! And congrats on your first merged Godot contribution!

@akien-mga akien-mga changed the title Implement overdraw, lighting, and unshaded debug draw modes for opengl Implement overdraw, lighting, and unshaded debug draw modes for OpenGL Feb 6, 2024
@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.

@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenGL: Debug draw modes are not working
6 participants