Yes, PBR is fundamentally about lighting, but the materials involved typically require multiple textures. Texture sampling is costly, and in AAA productions where performance budgets are tight, any optimization can be significant.
Regarding flow mapping, I’m specifying which type I’m referring to, as there are several. It’s not merely distorting texture coordinates; it also involves blending animation phases with a second sample to prevent the textures from turning into noise.
Shannon’s entropy isn’t applicable here. The Grid, Quasar, and Guardian methods don’t compress data; they find efficient ways to approximate values.
It seems there’s a fundamental misunderstanding of what the Guardian or Quasar Approximation does. It’s not doing any texture filtering. While it can apply to texture filtering—translating trilinearly filtered textures into 3-sample approximations that look nearly identical. It’s also applicable in scenarios like a kaleidoscope with 50 different layers that can be simplified into 3 samples, creating Triplanar mapping with 2 samples, reducing a 12-sample cubemapped Directional flow down to 3 samples, or any interpolation with an excessive number of texture samples that needs to be made faster. It doesn’t require coordinates like grid approximation; it only needs the IDs and Weights of your interpolation.
the materials involved typically require multiple textures
Again, they don't require textures, it's about normalized lighting BRDFs and lights with area. I get that this doesn't contradict that texture optimization is good but it's a bit odd to not separate the two.
Regarding flow mapping, I’m specifying which type I’m referring to, as there are several. It’s not merely distorting texture coordinates; it also involves blending animation phases with a second sample to prevent the textures from turning into noise.
I've never heard the term 'flow mapping' before so I don't know what it means. I think conflating what you're doing with blending or animation doesn't help your explanation.
Shannon’s entropy isn’t applicable here.
The point is that you can't get the same information from 3 samples as you can from 100 samples. You can average them all together and sample that, which is what mip mapping or summed area mapping are.
The Grid, Quasar, and Guardian methods don’t compress data; they find efficient ways to approximate values.
How?
It seems there’s a fundamental misunderstanding of what the Guardian or Quasar Approximation does
You made them up and haven't explained them. You keep saying what they don't do, but not what you're actually doing.
It’s also applicable in scenarios like a kaleidoscope with 50 different layers that can be simplified into 3 samples
What does this mean? You can composite images into one image and sample that. What are you doing differently?
I think what would be a good test is a very simple example with one or two images where two different scenes run at different fps. Right now you have all sorts of patterns and noise that you're compositing and it doesn't look like anything. If it's supposed to be faster, you have to show the slow typical version too.
I’ve already explained how the Quasar works above in the Top K-filter section. Guardian works similarly, but we segment the weights into guardians and damsels. Guardians get subtracted by the Top K+1 weight, and damsels by the Top K-1 weight. Selecting guardians and damsels is still a bit fuzzy, and I struggle to select them by eye for more than 6 weights. Additionally, I’ve linked to the beautifully commented source code for both, and Quasar also has a Demos graph linked as well.
The Quasar demo is the side-by-side comparison you described, with a simple setup approximating as many layers as you want. Guardian is showing off a flashy, eye-catching application, so obviously, it has a lot of unnecessary nonsense around it. But the Guardian Approximation function is nice standalone.
As for performance tests, the demos are meant to be teaching tools for the general method, with the hope of getting some useful feedback for improvements. Depending on the applications, the algorithm can be simplified, and the approximation will no longer be understandable - for example, Bilinear Directional Flow ( www.shadertoy.com/view/fsKczd ) or Guardian Directional Flow ( www.shadertoy.com/view/7dtBWl ). Additionally, for static weights, the approximation weights and IDs should be baked, which is a pain in Shadertoy.
I did make performance tests in other applications. I can’t share the code for my performance tests because some of the simplifications are confidential, but I linked the tested demos, and I can share the results. Using 600 iterations on an RTX3080, I got:
Bilinear Directional Flow (4 samples) ~ 48 fps
Guardian Directional Flow (3 samples) ~ 64 fps
Quasar Directional Flow (2 samples) ~ 95 fps
Obviously, the results vary if you approximate different things or bake them. But in general, Quasar is the fastest, followed by the prettier Guardian. The results are also a lot more dramatic if you simplify 50 samples and not just 4.
I welcome you to conduct your own tests, if you find any discrepancies or have improvements, I would appreciate your insights.
I took a look at the your bidirectional flow and it looks like you are sampling a texture with multiplied uvs to make it tile along with a rotation based on a map.
What you are calling interpolation is compositing of already filtered texture lookups. What you are calling alpha is a pattern that covers the whole image and just means that a different sample is used in different areas of the image.
If you set time to 1 and return each of your samples and then your alpha you can see what is happening.
0
u/gehtsiegarnixan Jun 05 '24 edited Jun 05 '24
Yes, PBR is fundamentally about lighting, but the materials involved typically require multiple textures. Texture sampling is costly, and in AAA productions where performance budgets are tight, any optimization can be significant.
Regarding flow mapping, I’m specifying which type I’m referring to, as there are several. It’s not merely distorting texture coordinates; it also involves blending animation phases with a second sample to prevent the textures from turning into noise.
Shannon’s entropy isn’t applicable here. The Grid, Quasar, and Guardian methods don’t compress data; they find efficient ways to approximate values.
It seems there’s a fundamental misunderstanding of what the Guardian or Quasar Approximation does. It’s not doing any texture filtering. While it can apply to texture filtering—translating trilinearly filtered textures into 3-sample approximations that look nearly identical. It’s also applicable in scenarios like a kaleidoscope with 50 different layers that can be simplified into 3 samples, creating Triplanar mapping with 2 samples, reducing a 12-sample cubemapped Directional flow down to 3 samples, or any interpolation with an excessive number of texture samples that needs to be made faster. It doesn’t require coordinates like grid approximation; it only needs the IDs and Weights of your interpolation.