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

PBR debug visualisations #5398

Closed
wants to merge 11 commits into from
Closed

Conversation

superdump
Copy link
Contributor

@superdump superdump commented Jul 20, 2022

Objective

Solution

  • Add PbrDebug enum resource covering a bunch of cases
  • Use this resource to configure the desired debug visualisation through shader defs, defaulting to PbrDebug::None
  • Implement debug visualisations for all the modes in the enum
  • Fix clustered forward debug visualisation along the way
  • Add a method to be able to invalidate the SpecializedMeshPipelines mesh and vertex layout caches that map from mesh and vertex layouts to specialised render pipelines. This is necessary as the PbrDebug lives outside of and affects all pipelines. Or at least all PBR pipelines, but this was a simple approach.
  • Press v in the scene_viewer tool to cycle through the PBR debug visualisations

Normal-mapped normals:
Screenshot 2022-07-20 at 18 56 26


Changelog

  • Added: PbrDebug resource to control debug visualizations.

@superdump superdump requested a review from cart July 20, 2022 16:57
@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Rendering Drawing game state to the screen A-Diagnostics Logging, crash handling, error reporting and performance analysis labels Jul 20, 2022
Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

Couple of nitpicks, but otherwise I really like this.

examples/3d/pbr_debug.rs Outdated Show resolved Hide resolved
examples/3d/pbr_debug.rs Outdated Show resolved Hide resolved
crates/bevy_pbr/src/render/pbr_debug.wgsl Show resolved Hide resolved
crates/bevy_pbr/src/render/pbr.wgsl Outdated Show resolved Hide resolved
@superdump
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 18, 2022
@bors
Copy link
Contributor

bors bot commented Aug 18, 2022

try

Build failed:

@JMS55
Copy link
Contributor

JMS55 commented Jan 2, 2023

I haven't reviewed this deeply, but I don't see anything about tonemapping in this PR. Some of these modes should maybe disable tonemapping, as we want to see the raw output without adjustments.

@IceSentry
Copy link
Contributor

Yeah, tonemapping didn't exist when this PR was created.

@NthTensor
Copy link
Contributor

This appears to have gone stale and perhaps needs significant rewrites. I propose we close this an open an issue for the feature/adoption.

@NthTensor NthTensor added the S-Adopt-Me The original PR author has no intent to complete this work. Pick me up! label Aug 24, 2024
@NthTensor
Copy link
Contributor

Closing as stale, existing issue suffices. Feel free to re-open Rob, this looked really neat.

@NthTensor NthTensor closed this Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Adopt-Me The original PR author has no intent to complete this work. Pick me up!
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add PBR debug render modes
6 participants