-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add Shaders #110
Add Shaders #110
Conversation
breaks loads of stuff: sizing, click functions, cursor hovering just a few Only tested on login example not optimized; spams handle weak clones to ensure got correct handle (will be fixed by new handle swapping routine) not sure about the API changes but might just need to get used to it, is much more extensible
centered padding now broken, not tested other text positions
@bytemunch nice stuff. What do you think about having 2 ways for public facing API:
? |
@StaffEngineer I was thinking about a default internal shader yeah, definitely a good idea, think I need to work with shaders for a while longer before I understand if they can be added to eachother, or if we wanted both rounded corners and shadows (for example) they would need to be defined in a single I do think shadows and corners should be available to the user without messing with shader code. |
@bytemunch yeah, you can pass flags from rust side to shader code to enable specific features.... so it's possible to have one shader for all features... as a tradeoff it's definitely gonna be slower than separate shaders due to |
This might be useful to test performance of rendering pipeline when working with shaders: https://github.com/bevyengine/bevy/blob/main/docs/profiling.md#chrome-tracing-format |
Yea far as my reading has taken me so far conditions on the GPU is something to avoid. The other approach seems to be building shaders on eachother with render passes and rendering to textures and stuff.. Seems complicated, might get easier once I've wrapped my head around it all. |
Nice bevy example! Shaders are fun, I am sure you love it :D For inspiration if you haven't seen it: https://youtu.be/BFld4EBO2RE |
I wish we have cosmic text widget on all sides of 3d cube with ability to rotate cube... could be nice showcase demo :) |
Note to self: do NOT try and read a spec while parenting. Found naga_oil which looks like it solves most of the complicated shader bits, but further research required lol |
so that's how modular shaders work, okay. and after looking at bevy's mesh2d shader I'm less worried about putting a few branches in shader code. Can write |
naga_oil is adopted by bevy in 0.11 release to enable better (more explicit) importing/exporting functionality afaik. So yeah, your approach sounds good to me. |
ui materials are merged fyi :) |
Let's re-open if/once active :) |
closes #66
I'm not that experienced with traits and the like but this feels like the idiomatic way to add shader support, public facing API feels okay-ish.
Branches off #106 so might need some history tidying up lol
TODO:
I'm not too sure about the differences between
Sprite
andQuad
meshes, might be an idea to move to using quads directly if that's what sprites do, save having an extra display method.