-
Notifications
You must be signed in to change notification settings - Fork 14
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
Graphics improvements #565
Conversation
8ce714b
to
27ee0db
Compare
Codecov Report
@@ Coverage Diff @@
## devel #565 +/- ##
==========================================
- Coverage 81.38% 80.90% -0.48%
==========================================
Files 243 244 +1
Lines 30070 30731 +661
==========================================
+ Hits 24472 24864 +392
- Misses 5598 5867 +269
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
30a4ba5
to
3890f35
Compare
@@ -20,6 +22,10 @@ struct MainWindow final { | |||
SHCCSTR("If the device backing the window should be created with " | |||
"debug layers on."), | |||
{CoreInfo::BoolType}}, | |||
{"IgnoreCompilationErrors", | |||
SHCCSTR("When enabled, shader or pipeline compilation errors will be ignored and either use fallback rendering or not " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh 😐 can't compilation happen within Maybe shards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean this is good for development but not sure needed.. can maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it I guess... 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's harder to do since it happens deeper within GFX.Render
- Increase frame cleanup thresholds for pipelines/shaders - Per view/drawable generator wires. Derive parameters - Pass features to generators - Instance render graph evaluator per render call - Add writable frag_depth - Fix captured variables inside generator wires - Fix ViewData being captured during graph building (needs to be fully dynamic) # Conflicts: # src/extra/gfx.cpp # src/gfx/render_graph.hpp # src/gfx/renderer.cpp
- Fix web - Configurable rust flags - Optimize -O3 even in debug builds with asyncify
They are now relative to script, similar to dynamic path usage
Graphics improvements
PR contains several changes I made while working on a simple PBR demo, porting over the shaders from the bgfx days.
For now, the demo code can be found here: https://github.com/shards-lang/pbr-demo (run entry.edn)
Generators
Adds the concept of generators:
Which when added, will run the generator for each unique
View
being rendered, and the resulting table will be injected as shader paramters.To precompute once and reuse forever you can wrap your code inside
(Setup)
inside the generatorNote that this also replaces DrawData previously available on Feature, so something like the following can be used to replace the previous DrawData usages:
If you need to pass data to the generator, channels should be used.
Render target creation
Renderable textures can now be created using the same Texture shard, but passing it a Format and Size.
In addition parameters are supported for most fields and Cubemap and mip levels were added.
RenderInto
A dedicated shard was added to push a collection of render attachments onto the view stack
Attachments can be a whole texture, a specific mip or cubemap (array) layer. The attachments will bind to the named outputs specified on any of the render steps.
This also replaces the previous UI rendering
(GFX.Region)
shards, now you'd use the RenderInto shard for this as well, but pass the :WindowRegion argument as well