Understanding Post processing. #4490
Unanswered
gallickgunner
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Deckgl version: 8.1.0
Hello, I'm having some trouble understanding the internal working of post processing passes. Both deckgl and lumagl's docs are lacking when it comes to explaining how the parameters tie in with the working.
The main problem is how to implement multi pass post processing effects. I think the
passes
property in the shader module was the key to this. However the results are quite strange. If I pass in the following value,passes: [{filter: 'firstPass'}, {sampler: 'secPass'}]
and have the following fragment shader for post processing on an icon layer
Then, I assumed that the
firstPass
returned color, would be available as thetexture
to thesecPass
in the arguments. Since the second Pass does nothing but return it as it is, the result should be equal to the firstPass, however the results change,First Pass only,
First Pass + Second Pass
Also I noted that this only happens if the alpha value is changed in the first Pass. If alpha is set to 1.0, then the results don't change. So is it a bug or something supposed to happen that I don't know of? Perhaps something related to blending?
Secondly, what actually happens if we use multiple effects rather than one effect with multiple passes? I'm guessing again that the first Pass rendered image is sent as a texture to the second effect? I tried this approach with the above scenario and had the same results.
The
dependencies
property, however, in the module seemed rather ambiguous. I assumed that mentioning a dependency had the effect of merging all of them into one mega effect, however, passing only this supposed Mega effect to the Deck component didn't had any combined effects on the image, just the passed one. What's the point of mentioning it?Thirdly, I'd like to know if it's possible rendering into offscreen buffers, then passing the result as a texture to secondary passes. This was pretty straightforward to do in luma.gl, however I know no way to make this work with the shader module system. Any help would be appreciated, thanks.
Beta Was this translation helpful? Give feedback.
All reactions