-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Implement rendering pipeline and post-processing #12465
Conversation
bedc367
to
23c51aa
Compare
Tried. Everything seems to work as before. |
@lhofhansl I'd love you feedback on the way pipelines are built, side-by-side would be a good example. Thank you! |
@lhofhansl I've made slight changes to the pipeline framework, removing duplicated code here and there. |
With the latest update I find different behavior:
(I'm pretty sure this did not happen when I tested yesterday) |
Hmm... Lemme test that again... |
Re-compiled everything. The sun is visible. My mistake. But the other issues remain. What thew me off is that shadows seem to dependent on the aliasing setting. When aliasing is none, then entities self-shadow, but blocks no longer have shadows. At other aliasing settings blocks have shadows again, but entities don't. So some problems with the pipeline setup I assume. |
8ecef7c
to
54ceded
Compare
Shadow issue remain with latest push (antialiasing affecting whether shadows work or not) |
@x2048 I don't understand how to test sun rays effect which judging by your words in 'Postprocessing' Minetest Forums topic you added in this PR. I just don't see those rays neither in MTG nor in Devtest games. |
@Andrey2470T , the godrays are on a separate branch, to keep this PR scoped. |
@lhofhansl Can it be a driver problem? I can see all shadows with any AA setting (might be AA does not work for me at all?) |
@x2048 possible, but not likely. This is with the current Nvidia driver and only with this change. |
Nope tested with NVidia and Intel. Definitely something weird. Shadows are off when starting Minetest, then when switching antialiasing (without existing Minetest) shadows show up again. It is as if shadows are missing from the pipeline and then added when antialiasing is changed. |
Yes, they render now. I noted the rays will disappear at once as soon as the sun gets outside the player camera view. I don't know exactly whether this behaviour is correct or needs a fix. |
@Andrey2470T This is a known limitation, and I've made the transition subtle in the latest commit. |
So I'm happy to merge this without the caching. @x2048 do you think that would be OK (is the caching helping much)? Or do do you think we should try to track that down first? BTW. I tried to check the results of the setters and only cache when the return value indicates success, but that does not solve the problem. |
It was a long shot, glad that it worked. I'd like to try and fix this. Caching uniforms was not without a reason. |
Draft documentation on how to play with the pipeline until a better API is created: https://gist.github.com/x2048/7b398f6e10a0f302971d034931dadfa5 |
FYI. I changed the *ShaderSetting template such that I can control for each instance whether it's cached or not. |
It's one or more of these in shader.cpp:
(Note I added a "cache" parameter to the template). |
This is good finding. Did you manage to narrow it down further to a specific setting? |
Not, yet. It seems if I cache any of these I see the effect again. I had limited time yesterday, I'll try some more today. |
Ok. It's these two:
If either of these are cached, shadows sometimes do not display. |
Is there a branch somewhere that I could pull in? I guess, we can go with two uncached uniforms and solve it later. |
Not easily right now, sorry. |
But here's the simple change to shader.h. And then you can mark the two constants with false. |
Use shader info ID instead of material renderer ID as step state Use tile material and draw type values that avoid collisions with main nodes
@lhofhansl Can you try now? I changed what makes the state of PostProcessingStep and which material type is passed when generating the shader. Edit: It affects how MT shader system caches the material for the post-processing shader, and as a result how that shader works, including when the cached uniform values may be used. |
It's still happening :( |
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.
Works on GL and GLES
there's a minor review comment remaining, please address it!
If we merge as is, we should at least avoid caching the two shader constants I have identified as causing the shadow issues. |
Fixes instability of shadows on certain hardware Co-authored-by: lhofhansl <[email protected]>
79242fb
to
7272f1f
Compare
@lhofhansl I've pushed the changes that disable caching of light space matrix and light vector. Can you verify? |
Works. (BTW. The new volumetric light with bloom is pretty awesome. I hope we can get that one shortly after this.) |
This PR implements rendering pipeline as described in #12411 Alternative B and a minimal post-processing shader on top of the pipeline.
Fixes #12411 and fixes #5446
To do
This PR is Ready for review
Page flipremoved because not supported by current Irrlicht versionMerge undersampling with all 3d modes- postponed to a future PRHow to test