Add TrueNAS/FreeNAS information

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2023-04-02 15:36:07 +02:00
parent 441e320b1b
commit 7c207cd76b
+46 -32
View File
@@ -7,39 +7,9 @@ date: "2022-01-13"
{% capture content %}When knowledge becomes common knowledge, the curse of time starts affecting it and eventually it may be lost. This is a page dedicated to such knowledge I possess or rediscovered through encountering the same problems. I can't guarantee that someone may hold a patent on the knowledge recorded here.{% endcapture %}{% include blocks/paragraph.liquid content=content %} {% capture content %}When knowledge becomes common knowledge, the curse of time starts affecting it and eventually it may be lost. This is a page dedicated to such knowledge I possess or rediscovered through encountering the same problems. I can't guarantee that someone may hold a patent on the knowledge recorded here.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% capture color_space_block %}
{% include blocks/heading.liquid level=2 content="Is lossless conversion between YUV and RGB possible?" %}
{% capture content %}It depends on the matrix used to transfer to and from YUV, as well as the number of bits per channel. To be on the safe side, it should be assumed that converting to and from YUV will result in slight quality loss, which may be acceptable to you, but will result in accumulating error.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% endcapture %}{% include blocks/details.liquid level=1 title="Color Space Handling" content=color_space_block open=true %}
{% capture particle_block %}
{% include blocks/heading.liquid level=2 content="Calculate maximum Particle count ahead of time" %}
{% capture content %}Many modern Particle simulation engines rely on user input for their maximum particle count, despite the maximum particle count being something that can be calculated ahead of time. All you need is the highest possible spawn rate (as particles per second), the minimum decay rate (as decay value per second), and the maximum life time (in seconds). Once you have these variables the following formulae will result in the maximum particle count:{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% capture particle_max_count_code %}particles = min(maxSpawnRate / minDecayRate, maxLifeTime * maxSpawnRate){% endcapture %}{% include blocks/code.liquid content=particle_max_count_code %}
{% endcapture %}{% include blocks/details.liquid level=1 title="Particle Simulation" content=particle_block open=true %}
{% capture rendering_block %}
{% include blocks/heading.liquid level=2 content="Is it possible to avoid Color Banding?" %}
{% capture content %}Not while we work with finite space, but we can make it nearly invisible to a Human-like observer through Dithering. Dithering requires a higher precision input, so a 10/10/10/X texture for intermediate and 8/8/8/X texture for output would already improve quality. Most game engines opt for 16/16/16/X or 10/10/10/X for their internal render buffer, but many do not opt to dither to the target buffer.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% include blocks/heading.liquid level=2 content="Could Dithering provide higher quality?" %}
{% capture content %}Yes with a Human-like observer (perceptual Quality), otherwise no. We can abuse the poor quality of Human vision through spatial and temporal Dithering, thus pretending to have extra precision that doesn't exist. Many older games and consoles abused this to draw more colors than they actually could render on screen. Often it is comined with sub-pixel rendering to provide further quality improvements.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% capture content %}With modern technology, this trick became much easier than before, to the point that Displays have this built-in now: FRC. After you hit a refresh rate of roughly 40 Hz, you can fake an extra bit of precision every additional 40 Hz. So a 120 Hz monitor with only 8 bits per channel could fake 10 bits per channel to a human-like observer, and they would very likely not notice it.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% include blocks/heading.liquid level=2 content="Can you store HDR in 8/8/8/8-bit?" %}
{% capture content %}No, but some game engines did abuse this format for faking HDR. The 4th channel would contain a multiplier for the first three channels, however this came at a cost of precision and often reduced overall quality. As GPUs got more advanced, we now have a better HDR format when space is limited without any of the downsides: 10/10/10/2.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% endcapture %}{% include blocks/details.liquid level=1 title="Rendering" content=rendering_block open=true %}
{% capture glossary_block %} {% capture terminology_block %}
{% capture list %} {% capture list %}
<li> <li>
<strong>Bits per Pixel (bpp, BpP)</strong><br> <strong>Bits per Pixel (bpp, BpP)</strong><br>
@@ -82,4 +52,48 @@ date: "2022-01-13"
A combined texture format where each of the A, B, C, and D elements specify the bits for a specific channel, usually in the order RGBA or BGRA. A combined texture format where each of the A, B, C, and D elements specify the bits for a specific channel, usually in the order RGBA or BGRA.
</li> </li>
{% endcapture %}{% include blocks/list.liquid content=list %} {% endcapture %}{% include blocks/list.liquid content=list %}
{% endcapture %}{% include blocks/details.liquid level=3 title="Glossary" content=glossary_block open=true %} {% endcapture %}{% include blocks/details.liquid level=3 title="Terminology" content=terminology_block %}
{% capture color_space_block %}
{% include blocks/heading.liquid level=2 content="Is lossless conversion between YUV and RGB possible?" %}
{% capture content %}It depends on the matrix used to transfer to and from YUV, as well as the number of bits per channel. To be on the safe side, it should be assumed that converting to and from YUV will result in slight quality loss, which may be acceptable to you, but will result in accumulating error.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% endcapture %}{% include blocks/details.liquid level=1 title="Color Space Handling" content=color_space_block %}
{% capture block_hosting %}
{% capture block_hosting_trunas %}
{% capture block_hosting_trunas_recordsize %}{% capture content %}The Record Size of a storage dataset in TrueNAS and FreeNAS matters a lot. It can be the difference between being able to transfer 2 GiB in a second, and taking multiple minutes to do so. While documentation is a bit sparse and fractured, through testing I was able to find out that the best record size is the default it has already selected. It offers the best mixture of performance for large and small writes, especially on faster storage.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% capture content %}My tests went through many record sizes, halving and doubling from 128K outwards. Every halving resulted in large read/writes getting significantly slower, but small read/writes getting slightly faster. Every doubling resulting in large read/write getting slightly faster, but small read/writes getting significantly slower. The best value ended up being 128K, which managed to keep most of the NVMe performance as is (~80MiB/s in RND4K, ~2.5GiB/s in RND1M).{% endcapture %}{% include blocks/paragraph.liquid content=content %}{% endcapture %}{% include blocks/details.liquid level=3 title="Ideal Record Size" content=block_hosting_trunas_recordsize %}
{% endcapture %}{% include blocks/details.liquid level=2 title="TrueNAS & FreeNAS" content=block_hosting_trunas %}
{% endcapture %}{% include blocks/details.liquid level=1 title="Hosting" content=block_hosting %}
{% capture particle_block %}
{% include blocks/heading.liquid level=2 content="Calculate maximum Particle count ahead of time" %}
{% capture content %}Many modern Particle simulation engines rely on user input for their maximum particle count, despite the maximum particle count being something that can be calculated ahead of time. All you need is the highest possible spawn rate (as particles per second), the minimum decay rate (as decay value per second), and the maximum life time (in seconds). Once you have these variables the following formulae will result in the maximum particle count:{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% capture particle_max_count_code %}particles = min(maxSpawnRate / minDecayRate, maxLifeTime * maxSpawnRate){% endcapture %}{% include blocks/code.liquid content=particle_max_count_code %}
{% endcapture %}{% include blocks/details.liquid level=1 title="Particle Simulation" content=particle_block %}
{% capture rendering_block %}
{% include blocks/heading.liquid level=2 content="Is it possible to avoid Color Banding?" %}
{% capture content %}Not while we work with finite space, but we can make it nearly invisible to a Human-like observer through Dithering. Dithering requires a higher precision input, so a 10/10/10/X texture for intermediate and 8/8/8/X texture for output would already improve quality. Most game engines opt for 16/16/16/X or 10/10/10/X for their internal render buffer, but many do not opt to dither to the target buffer.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% include blocks/heading.liquid level=2 content="Could Dithering provide higher quality?" %}
{% capture content %}Yes with a Human-like observer (perceptual Quality), otherwise no. We can abuse the poor quality of Human vision through spatial and temporal Dithering, thus pretending to have extra precision that doesn't exist. Many older games and consoles abused this to draw more colors than they actually could render on screen. Often it is comined with sub-pixel rendering to provide further quality improvements.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% capture content %}With modern technology, this trick became much easier than before, to the point that Displays have this built-in now: FRC. After you hit a refresh rate of roughly 40 Hz, you can fake an extra bit of precision every additional 40 Hz. So a 120 Hz monitor with only 8 bits per channel could fake 10 bits per channel to a human-like observer, and they would very likely not notice it.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% include blocks/heading.liquid level=2 content="Can you store HDR in 8/8/8/8-bit?" %}
{% capture content %}No, but some game engines did abuse this format for faking HDR. The 4th channel would contain a multiplier for the first three channels, however this came at a cost of precision and often reduced overall quality. As GPUs got more advanced, we now have a better HDR format when space is limited without any of the downsides: 10/10/10/2.{% endcapture %}{% include blocks/paragraph.liquid content=content %}
{% endcapture %}{% include blocks/details.liquid level=1 title="Rendering" content=rendering_block %}