Make the triangle example simpler#810
Conversation
If different code/libraries in an application use the same device, they can share buffers and textures. E.g. a lib doing compute can visualize the result with a viz library without having to move the data to the CPU. Therefore I want to promote the global device, especially for libraries. Maybe keep it straightforward but mention the global device briefly in a comment?
I liked that it was a bit more colorful, and it demonstrates varyings nicely with a few extra lines in the shader.
yeah, if that fixes the hdr example, let's do that.
Sounds good! I think we're aiming for an example for ppl to explore to understand wgpu, so any comments that help understand what happens is good! |
|
|
||
| """ | ||
|
|
||
| # test_example = true |
There was a problem hiding this comment.
I disabled this and removed the screenshot. Since we get one for cube and one for triangle anyway. Perhaps not the best idea as we could miss problems
| from rendercanvas.offscreen import RenderCanvas | ||
|
|
||
| try: | ||
| from .triangle import setup_drawing_sync |
There was a problem hiding this comment.
... and problems we missed. I ran this locally and got a messed up image. As I was on main for rendercanvas I had to go back to v2.5.0 to get it to work again. Didn't bisect it fully but between v2.5.0 and v2.6.0 is what I could find on the quick.
I suspect something about the bitorder might be wrong:
I will check the rendercanvas code when I find time. Maybe a numpy kwargs is all we need
There was a problem hiding this comment.
wasn't it. I tried around with different shapes and all. But the individual pixel values don't make sense. I think it's somewhere in the new bitmapcontext in rendercanvas. I had a quick glance and it looked like it always writes bytes as uint8... so it could also be a platform specific problem with order across bytes.
I will try some variations and file this for rendercanvas hopefully in a few days.
closes #809
a few open questions:
(I don't expect to have any time over the weekend but will find a bit of free space next week)