Skip to content

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

Merged
YuriSizov merged 1 commit into
godotengine:masterfrom
daustria:debug-modes-opengl
Jan 24, 2024
Merged

Implement overdraw, lighting, and unshaded debug draw modes for OpenGL#86677
YuriSizov merged 1 commit into
godotengine:masterfrom
daustria:debug-modes-opengl

Conversation

@daustria

@daustria daustria commented Jan 1, 2024

Copy link
Copy Markdown
Contributor

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

Comment thread drivers/gles3/rasterizer_scene_gles3.h Outdated
Comment thread drivers/gles3/rasterizer_scene_gles3.cpp Outdated
@daustria daustria force-pushed the debug-modes-opengl branch from c91674e to c1a7c9b Compare January 1, 2024 17:12
Comment thread drivers/gles3/rasterizer_scene_gles3.cpp Outdated
@daustria daustria force-pushed the debug-modes-opengl branch from c1a7c9b to 214c59f Compare January 1, 2024 17:18
@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

fire commented Jan 1, 2024

Copy link
Copy Markdown
Member

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

@daustria

daustria commented Jan 1, 2024

Copy link
Copy Markdown
Contributor Author

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?

@clayjohn clayjohn 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.

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!

Comment thread drivers/gles3/rasterizer_scene_gles3.cpp Outdated
Comment thread drivers/gles3/rasterizer_scene_gles3.cpp Outdated
Comment thread drivers/gles3/rasterizer_scene_gles3.cpp Outdated
@daustria daustria force-pushed the debug-modes-opengl branch from 214c59f to c8bdd1d Compare January 8, 2024 22:34

@clayjohn clayjohn 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.

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
@YuriSizov

Copy link
Copy Markdown
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
Copy Markdown
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