-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Screen shot #326
Screen shot #326
Conversation
Ok I've spent the last two days on this and I keep running into things that prevent it from working.
Obviously the explicitness of vulkan is awesome but dam this is frustrating. I just want a way to get the dam image into a buffer. |
Ok so I've learnt one thing. An image copy or image to buffer copy will not take care of the format transitions. So you can't go from uint to float for example. |
I think the best option here is to figure out how to go from floats to 8 bit uints in glsl. |
|
Ok I was about to give up and just use the |
Ok I have a working screen shot with the latest commit using compute.
uvec4 col = uvec4(uint(255*t.x), uint(255*t.y), uint(255*t.z), uint(255*t.w));
|
Ok this is working pretty well now. |
When can we merge this? |
ping |
I'm not even sure if this should be merged to master. I think it's good for a reference implementation but ultimately it would be better to include most of the functionality into nannou directly. |
This fails on an debug_assert because the resolve renderpass contains images with different formats. |
It also looks like this isn't copying the colors correctly. I think it's probably related to the above issue of different formats.
|
Hey @freesig, seems like this is getting close at least!
Are you sure the image requires the By the way, in case it helps, the frame to swapchain image writing process looks like this:
I haven't looked closely at the current implementation, but I'm imagining the screenshot approach would look kind of similar where you add commands to resolve the MSAA frame image to a non-MSAA image and then blit it to the target storage image? |
Yeh I need Uint format for the PNG writer because it writes as &[u8]
Yeh that's exactly what's happening.
|
This makes sense to me! |
Todo:
Found:
|
I just ran this locally and the color is looking fine to me! Awesome stuff @freesig :) One thing I did notice is that it looks like the texture coordinates are double what they should be. Here's a demonstration of the screenshots I'm getting: If I change tex_coords = position + vec2(0.5); to tex_coords = position * 0.5 + vec2(0.5); then it looks as I'd expect: I think my modification makes sense, as the incoming position coords are -1 to 1, and after It looks like maybe the frag shader was copied from the vk_image example, which is also incorrect by the looks of it, however it's not as noticeable in that example as the edges are black. Did you or @MacTuitui run into this at all? |
This looks very encouraging :) |
Works flawlessly with the tex_coords fix on my MacBook Pro (using @freesig vulkano patch for disccrete GPUs). That is a huge win for me. Thanks a lot! |
@mitchmindtree Hey nice catch, I did indeed copy that code. I'll push a fix.
This is kind of true. It's already on another thread however you can't really make them independent because if you just allow the rendering thread to run ahead of the saving thread then you will end up with a huge ever growing buffer of images waiting to be saved. It would probably crash your program. You either have to make the rendering thread wait or skip frames. |
Closing now that we have the |
Attempt at a screen shot