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

Maybe sharper egui soon #216

Closed
wants to merge 3 commits into from
Closed

Conversation

EriKWDev
Copy link
Contributor

@EriKWDev EriKWDev commented Dec 7, 2024

See notes in #215

Still not solved but colors are closer. Will keep looking into it

@EriKWDev EriKWDev marked this pull request as draft December 7, 2024 20:18
@EriKWDev
Copy link
Contributor Author

EriKWDev commented Dec 7, 2024

investigation progress: #215 (comment)

}

@fragment
fn fs_main_gamma_framebuffer(in: VertexOutput) -> @location(0) vec4<f32> {
Copy link
Owner

Choose a reason for hiding this comment

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

do we really need a separate entry point? it's largely doing the same thing, we might as well just have an if/else at the end based on a runtime flag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Runtime flag can do it. Just replicated egui-wgpu for the quick draft.

It would be nice to find the underlying cause so the shader potentially can be simple again..

[mode; 3]
},
mag_filter: match options.magnification {
egui::TextureFilter::Nearest => blade_graphics::FilterMode::Nearest,
Copy link
Owner

Choose a reason for hiding this comment

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

we should have helper function to do this mapping, since we are doing it 3 times here

egui::TextureFilter::Nearest => blade_graphics::FilterMode::Nearest,
egui::TextureFilter::Linear => blade_graphics::FilterMode::Linear,
},
mipmap_filter: match options.mipmap_mode {
Copy link
Owner

Choose a reason for hiding this comment

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

this would look like options.mipmap_mode.map_or(blade_graphics::FilterMode::Linear, my_mapping_function)


use blade_graphics as gpu;
use winit::platform::x11::WindowAttributesExtX11;

Copy link
Owner

Choose a reason for hiding this comment

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

do we need a separate example for this? we already have particle using egui, scene using it, and move as well.

Copy link
Contributor Author

@EriKWDev EriKWDev Dec 8, 2024

Choose a reason for hiding this comment

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

Nop, will remove, didn't intend to include it here, was just the one I used to debug

blade-egui/shader.wgsl Show resolved Hide resolved
@@ -144,7 +204,11 @@ impl GuiPainter {
..Default::default()
},
depth_stencil: None, //TODO?
fragment: shader.at("fs_main"),
fragment: if info.format.is_srgb() {
Copy link
Owner

Choose a reason for hiding this comment

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

This looks highly suspicious to me.
Generally speaking, I expect the rendering pipeline to assume linear space render targets all the way. I don't think there is value in expanding this assumption any further.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what egui-wgpu did so I just replicated all of it to see if it would help.

Egui examples use a non-srg render target whereas blade always uses one

Copy link
Owner

Choose a reason for hiding this comment

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

Minimizing changes is a good experiment for sure. Shipping it the way egui_wgpu did seems very concerning to me. I'll try to find some associated discussion there.

@EriKWDev
Copy link
Contributor Author

EriKWDev commented Dec 8, 2024

Just a note, my approach for the investigation was to minimize differences between blade and egui-wgpu, so I made sure to try and replicate their code.

Once we find the issue we can go back and make only minimal changes in a own PR :)

@EriKWDev
Copy link
Contributor Author

EriKWDev commented Dec 8, 2024

Closed by #217 and the separate samplers is superseded by #218

@EriKWDev EriKWDev closed this Dec 8, 2024
@EriKWDev EriKWDev deleted the ErikWDev/sharper-egui branch December 9, 2024 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants