Stephen C. Wills
0b4f3b4732
Introduce subtile lighting into the software renderer ( #7807 )
1 year ago
Gleb Mazovetskiy
299b6bffcd
dun_render: Clean up foliage masks code
...
Removes the last remnants of foliage masks support from `dun_render`.
2 years ago
Gleb Mazovetskiy
2580cd7b68
Simplify foliage rendering
...
During `ReencodeDungeonCels`, extracts floor tile foliage into
a triangle with the floor frame and a separate 16-px tall `TransparentSquare`.
This means that the floor frames are now always triangles and
the foliage can be rendered directly without masking.
Dungeon graphics sizes:
Map | Frames | Foliage frames | Byte size | Before PR | After PR
-----|--------|---------------:|-----------:|----------:|----------:
Town | 3,803 | 41 | 2,317,832 | 2,242,056 | 2,242,190
L1 | 1,119 | 11 | 738,836 | 721,604 | 721,110
L4 | 1,091 | 6 | 603,140 | 584,500 | 584,242
RG99 binary size reduced by ~4 KiB: 2,426,380 bytes -> 2,421,388 bytes
2 years ago
Gleb Mazovetskiy
1bab0251e2
Minor rendering cleanups
...
Extracted from various open PRs, for ease of reviewing.
2 years ago
Gleb Mazovetskiy
4e572f0450
dun_render: Fix OOB in `world_draw_black_tile`
2 years ago
Gleb Mazovetskiy
ef498f2baf
Speed up `world_draw_black_tile`
...
Previously, there were 2 loops to render all the lines of a diamond.
This changes it to call `RenderLeftTriangle` + `RenderRightTriangle`.
That's 4 loops + some extra clipping calculations
Yet, this version is ~28% faster.
I don't understand why it's faster at all.
Perhaps it's only faster on some hardware?
Modern computers are magic.
Anyway, here are the (very surprising) results on my Ryzen 3950x:
```
BASELINE=master
BENCHMARK=dun_render_benchmark
git checkout "$BASELINE"
tools/build_and_run_benchmark.py -B "build-reld-${BASELINE}" --no-run "$BENCHMARK"
git checkout -
tools/build_and_run_benchmark.py --no-run "$BENCHMARK"
tools/linux_reduced_cpu_variance_run.sh ~/google-benchmark/tools/compare.py -a benchmarks \
"build-reld-${BASELINE}/${BENCHMARK}" "build-reld/${BENCHMARK}" \
--benchmark_filter='.*BlackTile.*' --benchmark_repetitions=10
```
```
Comparing build-reld-master/dun_render_benchmark to build-reld/dun_render_benchmark
Benchmark Time CPU Time Old Time New CPU Old CPU New
------------------------------------------------------------------------------------------------------------------------
BM_RenderBlackTile_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10
BM_RenderBlackTile_mean -0.2786 -0.2786 156 113 156 113
BM_RenderBlackTile_median -0.2808 -0.2808 157 113 157 113
BM_RenderBlackTile_stddev -0.3148 -0.3138 1 1 1 1
BM_RenderBlackTile_cv -0.0503 -0.0488 0 0 0 0
OVERALL_GEOMEAN -0.2785 -0.2786 0 0 0 0
```
2 years ago
Gleb Mazovetskiy
15f8987d73
dun_render: Fix dark triangle rendering
2 years ago
Gleb Mazovetskiy
f6c8a32815
dun_render: Specialized FullyDark+Solid triangles
...
Eliminates regression in the rendering speed of such triangles.
2 years ago
Gleb Mazovetskiy
40ee61e776
dun_render: Unroll triangle loops
...
Rather than relying on the compiler to do it, which doesn't always
happen, we do it by hand.
Previously, very slightly different versions of the code could result in
those loops not being unrolled (such as in the current master).
I've run the benchmark like this:
```bash
BASELINE=dun-benchmark
BENCHMARK=dun_render_benchmark
git checkout "$BASELINE"
tools/build_and_run_benchmark.py -B "build-reld-${BASELINE}" --no-run "$BENCHMARK"
git checkout -
tools/build_and_run_benchmark.py --no-run "$BENCHMARK"
tools/linux_reduced_cpu_variance_run.sh ~/google-benchmark/tools/compare.py -a benchmarks \
"build-reld-${BASELINE}/${BENCHMARK}" "build-reld/${BENCHMARK}" \
--benchmark_repetitions=10
```
Benchmark results are below.
The `FullyLit` calls are ~55% faster.
The `PartiallyLit` calls are ~40% faster.
The `FullyDark` version is twice as slow, which is surprising.
I have a separate idea about eliminating most of the `FullyDark` calls
entirely.
```
Benchmark Time CPU Time Old Time New CPU Old CPU New
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
DunRenderBenchmark/LeftTriangle_Solid_FullyLit_pvalue 0.0004 0.0004 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTriangle_Solid_FullyLit_mean -0.5634 -0.5634 188036 82095 188014 82080
DunRenderBenchmark/LeftTriangle_Solid_FullyLit_median -0.5601 -0.5601 186905 82218 186884 82202
DunRenderBenchmark/LeftTriangle_Solid_FullyLit_stddev -0.6274 -0.6274 61414 22883 61402 22879
DunRenderBenchmark/LeftTriangle_Solid_FullyLit_cv -0.1465 -0.1465 0 0 0 0
DunRenderBenchmark/LeftTriangle_Solid_FullyDark_pvalue 0.0013 0.0013 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTriangle_Solid_FullyDark_mean +0.9781 +0.9781 238021 470823 237988 470757
DunRenderBenchmark/LeftTriangle_Solid_FullyDark_median +0.9733 +0.9733 238086 469812 238050 469752
DunRenderBenchmark/LeftTriangle_Solid_FullyDark_stddev +0.9791 +0.9790 74987 148403 74978 148383
DunRenderBenchmark/LeftTriangle_Solid_FullyDark_cv +0.0005 +0.0005 0 0 0 0
DunRenderBenchmark/LeftTriangle_Solid_PartiallyLit_pvalue 0.0113 0.0113 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTriangle_Solid_PartiallyLit_mean -0.3891 -0.3891 984208 601272 984080 601180
DunRenderBenchmark/LeftTriangle_Solid_PartiallyLit_median -0.3931 -0.3931 980791 595272 980682 595188
DunRenderBenchmark/LeftTriangle_Solid_PartiallyLit_stddev -0.3950 -0.3950 316631 191562 316575 191533
DunRenderBenchmark/LeftTriangle_Solid_PartiallyLit_cv -0.0097 -0.0096 0 0 0 0
DunRenderBenchmark/LeftTriangle_Transparent_FullyLit_pvalue 0.6776 0.6776 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTriangle_Transparent_FullyLit_mean -0.0802 -0.0802 995379 915591 995236 915450
DunRenderBenchmark/LeftTriangle_Transparent_FullyLit_median -0.0816 -0.0817 994452 913256 994299 913112
DunRenderBenchmark/LeftTriangle_Transparent_FullyLit_stddev -0.0916 -0.0915 319114 289898 319065 289864
DunRenderBenchmark/LeftTriangle_Transparent_FullyLit_cv -0.0124 -0.0123 0 0 0 0
DunRenderBenchmark/LeftTriangle_Transparent_FullyDark_pvalue 0.0091 0.0091 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTriangle_Transparent_FullyDark_mean -0.3875 -0.3875 1001347 613375 1001222 613282
DunRenderBenchmark/LeftTriangle_Transparent_FullyDark_median -0.3830 -0.3830 998801 616295 998628 616194
DunRenderBenchmark/LeftTriangle_Transparent_FullyDark_stddev -0.3901 -0.3901 320998 195778 320963 195747
DunRenderBenchmark/LeftTriangle_Transparent_FullyDark_cv -0.0043 -0.0043 0 0 0 0
DunRenderBenchmark/LeftTriangle_Transparent_PartiallyLit_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTriangle_Transparent_PartiallyLit_mean +0.0046 +0.0046 1014824 1019541 1014707 1019386
DunRenderBenchmark/LeftTriangle_Transparent_PartiallyLit_median +0.0032 +0.0032 1015895 1019161 1015801 1019001
DunRenderBenchmark/LeftTriangle_Transparent_PartiallyLit_stddev +0.0037 +0.0036 322403 323590 322370 323538
DunRenderBenchmark/LeftTriangle_Transparent_PartiallyLit_cv -0.0010 -0.0010 0 0 0 0
DunRenderBenchmark/RightTriangle_Solid_FullyLit_pvalue 0.0006 0.0006 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTriangle_Solid_FullyLit_mean -0.5523 -0.5524 176362 78951 176340 78938
DunRenderBenchmark/RightTriangle_Solid_FullyLit_median -0.5514 -0.5514 175837 78875 175814 78865
DunRenderBenchmark/RightTriangle_Solid_FullyLit_stddev -0.5884 -0.5884 55614 22891 55607 22888
DunRenderBenchmark/RightTriangle_Solid_FullyLit_cv -0.0805 -0.0805 0 0 0 0
DunRenderBenchmark/RightTriangle_Solid_FullyDark_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTriangle_Solid_FullyDark_mean +1.9896 +1.9896 161841 483845 161819 483767
DunRenderBenchmark/RightTriangle_Solid_FullyDark_median +1.9924 +1.9924 161742 483991 161715 483917
DunRenderBenchmark/RightTriangle_Solid_FullyDark_stddev +2.0012 +2.0010 51356 154129 51351 154107
DunRenderBenchmark/RightTriangle_Solid_FullyDark_cv +0.0039 +0.0038 0 0 0 0
DunRenderBenchmark/RightTriangle_Solid_PartiallyLit_pvalue 0.0058 0.0058 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTriangle_Solid_PartiallyLit_mean -0.4247 -0.4247 1046216 601892 1046042 601809
DunRenderBenchmark/RightTriangle_Solid_PartiallyLit_median -0.4249 -0.4249 1053545 605870 1053349 605785
DunRenderBenchmark/RightTriangle_Solid_PartiallyLit_stddev -0.4174 -0.4174 330051 192291 330001 192261
DunRenderBenchmark/RightTriangle_Solid_PartiallyLit_cv +0.0127 +0.0127 0 0 0 0
DunRenderBenchmark/RightTriangle_Transparent_FullyLit_pvalue 0.3847 0.3847 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTriangle_Transparent_FullyLit_mean -0.1217 -0.1217 1050082 922274 1049928 922136
DunRenderBenchmark/RightTriangle_Transparent_FullyLit_median -0.1226 -0.1226 1047556 919087 1047400 918953
DunRenderBenchmark/RightTriangle_Transparent_FullyLit_stddev -0.0833 -0.0833 324195 297188 324156 297143
DunRenderBenchmark/RightTriangle_Transparent_FullyLit_cv +0.0437 +0.0437 0 0 0 0
DunRenderBenchmark/RightTriangle_Transparent_FullyDark_pvalue 0.0046 0.0046 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTriangle_Transparent_FullyDark_mean -0.4253 -0.4253 1047974 602234 1047816 602137
DunRenderBenchmark/RightTriangle_Transparent_FullyDark_median -0.4267 -0.4267 1051985 603146 1051802 603042
DunRenderBenchmark/RightTriangle_Transparent_FullyDark_stddev -0.4276 -0.4276 334355 191387 334304 191363
DunRenderBenchmark/RightTriangle_Transparent_FullyDark_cv -0.0039 -0.0039 0 0 0 0
DunRenderBenchmark/RightTriangle_Transparent_PartiallyLit_pvalue 0.7913 0.7913 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTriangle_Transparent_PartiallyLit_mean -0.0137 -0.0138 1059054 1044492 1058910 1044325
DunRenderBenchmark/RightTriangle_Transparent_PartiallyLit_median -0.0178 -0.0179 1058596 1039738 1058508 1039571
DunRenderBenchmark/RightTriangle_Transparent_PartiallyLit_stddev +0.0031 +0.0031 337359 338411 337309 338362
DunRenderBenchmark/RightTriangle_Transparent_PartiallyLit_cv +0.0171 +0.0171 0 0 0 0
DunRenderBenchmark/TransparentSquare_Solid_FullyLit_pvalue 0.9097 0.9097 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/TransparentSquare_Solid_FullyLit_mean +0.0011 +0.0012 1493697 1495394 1493444 1495169
DunRenderBenchmark/TransparentSquare_Solid_FullyLit_median -0.0017 -0.0017 1496838 1494238 1496604 1494029
DunRenderBenchmark/TransparentSquare_Solid_FullyLit_stddev +0.0021 +0.0020 530878 531975 530805 531882
DunRenderBenchmark/TransparentSquare_Solid_FullyLit_cv +0.0009 +0.0009 0 0 0 0
DunRenderBenchmark/TransparentSquare_Solid_FullyDark_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/TransparentSquare_Solid_FullyDark_mean -0.0204 -0.0204 1433093 1403907 1432881 1403668
DunRenderBenchmark/TransparentSquare_Solid_FullyDark_median -0.0183 -0.0183 1429205 1403083 1428989 1402880
DunRenderBenchmark/TransparentSquare_Solid_FullyDark_stddev -0.0096 -0.0097 505699 500858 505631 500743
DunRenderBenchmark/TransparentSquare_Solid_FullyDark_cv +0.0110 +0.0109 0 0 0 0
DunRenderBenchmark/TransparentSquare_Solid_PartiallyLit_pvalue 0.0539 0.0539 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/TransparentSquare_Solid_PartiallyLit_mean -0.3176 -0.3176 2382675 1626018 2382333 1625760
DunRenderBenchmark/TransparentSquare_Solid_PartiallyLit_median -0.3198 -0.3198 2403842 1635148 2403483 1634913
DunRenderBenchmark/TransparentSquare_Solid_PartiallyLit_stddev -0.3148 -0.3149 827423 566929 827319 566830
DunRenderBenchmark/TransparentSquare_Solid_PartiallyLit_cv +0.0040 +0.0040 0 0 0 0
DunRenderBenchmark/TransparentSquare_Transparent_FullyLit_pvalue 0.5708 0.5708 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/TransparentSquare_Transparent_FullyLit_mean -0.0873 -0.0873 2175867 1985983 2175589 1985685
DunRenderBenchmark/TransparentSquare_Transparent_FullyLit_median -0.0631 -0.0631 2157339 2021156 2157036 2020874
DunRenderBenchmark/TransparentSquare_Transparent_FullyLit_stddev -0.1511 -0.1511 793554 673670 793451 673555
DunRenderBenchmark/TransparentSquare_Transparent_FullyLit_cv -0.0699 -0.0699 0 0 0 0
DunRenderBenchmark/TransparentSquare_Transparent_FullyDark_pvalue 0.0757 0.0757 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/TransparentSquare_Transparent_FullyDark_mean -0.2913 -0.2913 2168904 1537149 2168665 1536932
DunRenderBenchmark/TransparentSquare_Transparent_FullyDark_median -0.2906 -0.2906 2169825 1539371 2169553 1539149
DunRenderBenchmark/TransparentSquare_Transparent_FullyDark_stddev -0.2952 -0.2952 773577 545208 773499 545150
DunRenderBenchmark/TransparentSquare_Transparent_FullyDark_cv -0.0055 -0.0055 0 0 0 0
DunRenderBenchmark/TransparentSquare_Transparent_PartiallyLit_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/TransparentSquare_Transparent_PartiallyLit_mean -0.0228 -0.0227 2215243 2164785 2214801 2164528
DunRenderBenchmark/TransparentSquare_Transparent_PartiallyLit_median -0.0105 -0.0105 2206971 2183841 2206650 2183583
DunRenderBenchmark/TransparentSquare_Transparent_PartiallyLit_stddev -0.0493 -0.0492 794968 755773 794792 755680
DunRenderBenchmark/TransparentSquare_Transparent_PartiallyLit_cv -0.0271 -0.0271 0 0 0 0
DunRenderBenchmark/Square_Solid_FullyLit_pvalue 0.4274 0.4274 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/Square_Solid_FullyLit_mean -0.1018 -0.1018 106111 95306 106093 95293
DunRenderBenchmark/Square_Solid_FullyLit_median -0.1039 -0.1039 106890 95786 106879 95776
DunRenderBenchmark/Square_Solid_FullyLit_stddev -0.1415 -0.1414 31405 26959 31394 26956
DunRenderBenchmark/Square_Solid_FullyLit_cv -0.0442 -0.0440 0 0 0 0
DunRenderBenchmark/Square_Solid_FullyDark_pvalue 0.6232 0.6232 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/Square_Solid_FullyDark_mean -0.0624 -0.0623 76148 71400 76137 71390
DunRenderBenchmark/Square_Solid_FullyDark_median -0.0533 -0.0533 75419 71398 75409 71388
DunRenderBenchmark/Square_Solid_FullyDark_stddev -0.1158 -0.1158 23287 20590 23284 20587
DunRenderBenchmark/Square_Solid_FullyDark_cv -0.0570 -0.0570 0 0 0 0
DunRenderBenchmark/Square_Solid_PartiallyLit_pvalue 0.0140 0.0140 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/Square_Solid_PartiallyLit_mean -0.4191 -0.4191 1856509 1078451 1856141 1078317
DunRenderBenchmark/Square_Solid_PartiallyLit_median -0.4220 -0.4220 1865303 1078075 1864830 1077921
DunRenderBenchmark/Square_Solid_PartiallyLit_stddev -0.4194 -0.4193 661581 384134 661390 384090
DunRenderBenchmark/Square_Solid_PartiallyLit_cv -0.0005 -0.0004 0 0 0 0
DunRenderBenchmark/Square_Transparent_FullyLit_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/Square_Transparent_FullyLit_mean -0.0599 -0.0599 1777629 1671062 1777373 1670858
DunRenderBenchmark/Square_Transparent_FullyLit_median -0.0599 -0.0599 1777353 1670891 1777080 1670709
DunRenderBenchmark/Square_Transparent_FullyLit_stddev -0.0605 -0.0605 633282 594964 633184 594903
DunRenderBenchmark/Square_Transparent_FullyLit_cv -0.0006 -0.0006 0 0 0 0
DunRenderBenchmark/Square_Transparent_FullyDark_pvalue 0.0211 0.0211 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/Square_Transparent_FullyDark_mean -0.3763 -0.3762 1772392 1105501 1772116 1105383
DunRenderBenchmark/Square_Transparent_FullyDark_median -0.3766 -0.3766 1772282 1104753 1772089 1104637
DunRenderBenchmark/Square_Transparent_FullyDark_stddev -0.4402 -0.4402 631014 353260 630951 353231
DunRenderBenchmark/Square_Transparent_FullyDark_cv -0.1025 -0.1025 0 0 0 0
DunRenderBenchmark/Square_Transparent_PartiallyLit_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/Square_Transparent_PartiallyLit_mean -0.0272 -0.0271 1970857 1917285 1970523 1917053
DunRenderBenchmark/Square_Transparent_PartiallyLit_median -0.0268 -0.0267 1970258 1917452 1969801 1917178
DunRenderBenchmark/Square_Transparent_PartiallyLit_stddev -0.0294 -0.0293 703415 682714 703280 682642
DunRenderBenchmark/Square_Transparent_PartiallyLit_cv -0.0023 -0.0023 0 0 0 0
DunRenderBenchmark/LeftTrapezoid_Solid_FullyLit_pvalue 0.0004 0.0004 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTrapezoid_Solid_FullyLit_mean -0.5359 -0.5359 59253 27500 59242 27497
DunRenderBenchmark/LeftTrapezoid_Solid_FullyLit_median -0.5336 -0.5336 58982 27509 58975 27506
DunRenderBenchmark/LeftTrapezoid_Solid_FullyLit_stddev -0.5374 -0.5373 17150 7933 17144 7932
DunRenderBenchmark/LeftTrapezoid_Solid_FullyLit_cv -0.0034 -0.0032 0 0 0 0
DunRenderBenchmark/LeftTrapezoid_Solid_FullyDark_pvalue 0.0046 0.0046 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTrapezoid_Solid_FullyDark_mean +0.7013 +0.7013 56973 96926 56963 96913
DunRenderBenchmark/LeftTrapezoid_Solid_FullyDark_median +0.6907 +0.6908 57326 96921 57317 96909
DunRenderBenchmark/LeftTrapezoid_Solid_FullyDark_stddev +0.8879 +0.8880 16361 30888 16358 30885
DunRenderBenchmark/LeftTrapezoid_Solid_FullyDark_cv +0.1097 +0.1098 0 0 0 0
DunRenderBenchmark/LeftTrapezoid_Solid_PartiallyLit_pvalue 0.0091 0.0091 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTrapezoid_Solid_PartiallyLit_mean -0.3988 -0.3988 511666 307603 511589 307567
DunRenderBenchmark/LeftTrapezoid_Solid_PartiallyLit_median -0.3993 -0.3993 511913 307523 511851 307491
DunRenderBenchmark/LeftTrapezoid_Solid_PartiallyLit_stddev -0.3971 -0.3971 162799 98150 162774 98139
DunRenderBenchmark/LeftTrapezoid_Solid_PartiallyLit_cv +0.0028 +0.0029 0 0 0 0
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyLit_pvalue 0.6232 0.6232 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyLit_mean -0.0820 -0.0820 514358 472170 514290 472112
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyLit_median -0.0821 -0.0821 514335 472090 514264 472018
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyLit_stddev -0.0828 -0.0828 163969 150389 163949 150372
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyLit_cv -0.0009 -0.0009 0 0 0 0
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyDark_pvalue 0.0058 0.0058 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyDark_mean -0.4180 -0.4180 512755 298434 512692 298398
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyDark_median -0.4187 -0.4187 513116 298290 513049 298258
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyDark_stddev -0.4181 -0.4181 163460 95123 163439 95112
DunRenderBenchmark/LeftTrapezoid_Transparent_FullyDark_cv -0.0001 -0.0001 0 0 0 0
DunRenderBenchmark/LeftTrapezoid_Transparent_PartiallyLit_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/LeftTrapezoid_Transparent_PartiallyLit_mean +0.0149 +0.0149 544744 552873 544676 552807
DunRenderBenchmark/LeftTrapezoid_Transparent_PartiallyLit_median +0.0167 +0.0167 544823 553899 544761 553834
DunRenderBenchmark/LeftTrapezoid_Transparent_PartiallyLit_stddev +0.0110 +0.0110 173683 175592 173672 175580
DunRenderBenchmark/LeftTrapezoid_Transparent_PartiallyLit_cv -0.0039 -0.0039 0 0 0 0
DunRenderBenchmark/RightTrapezoid_Solid_FullyLit_pvalue 0.0010 0.0010 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTrapezoid_Solid_FullyLit_mean -0.4654 -0.4654 51804 27693 51798 27690
DunRenderBenchmark/RightTrapezoid_Solid_FullyLit_median -0.4648 -0.4648 51787 27718 51779 27713
DunRenderBenchmark/RightTrapezoid_Solid_FullyLit_stddev -0.4702 -0.4702 14885 7886 14884 7885
DunRenderBenchmark/RightTrapezoid_Solid_FullyLit_cv -0.0090 -0.0090 0 0 0 0
DunRenderBenchmark/RightTrapezoid_Solid_FullyDark_pvalue 0.0002 0.0002 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTrapezoid_Solid_FullyDark_mean +1.3529 +1.3529 43904 103301 43898 103287
DunRenderBenchmark/RightTrapezoid_Solid_FullyDark_median +1.3371 +1.3372 44199 103297 44192 103285
DunRenderBenchmark/RightTrapezoid_Solid_FullyDark_stddev +1.4168 +1.4167 12350 29848 12349 29843
DunRenderBenchmark/RightTrapezoid_Solid_FullyDark_cv +0.0272 +0.0271 0 0 0 0
DunRenderBenchmark/RightTrapezoid_Solid_PartiallyLit_pvalue 0.0091 0.0091 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTrapezoid_Solid_PartiallyLit_mean -0.3977 -0.3977 493458 297225 493385 297188
DunRenderBenchmark/RightTrapezoid_Solid_PartiallyLit_median -0.3973 -0.3973 493440 297377 493364 297342
DunRenderBenchmark/RightTrapezoid_Solid_PartiallyLit_stddev -0.3965 -0.3965 157323 94947 157300 94934
DunRenderBenchmark/RightTrapezoid_Solid_PartiallyLit_cv +0.0020 +0.0020 0 0 0 0
DunRenderBenchmark/RightTrapezoid_Transparent_FullyLit_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTrapezoid_Transparent_FullyLit_mean -0.0668 -0.0668 501015 467552 500947 467496
DunRenderBenchmark/RightTrapezoid_Transparent_FullyLit_median -0.0661 -0.0661 500672 467557 500607 467504
DunRenderBenchmark/RightTrapezoid_Transparent_FullyLit_stddev -0.0641 -0.0642 159233 149019 159215 148998
DunRenderBenchmark/RightTrapezoid_Transparent_FullyLit_cv +0.0028 +0.0028 0 0 0 0
DunRenderBenchmark/RightTrapezoid_Transparent_FullyDark_pvalue 0.0046 0.0046 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTrapezoid_Transparent_FullyDark_mean -0.4295 -0.4295 494445 282076 494382 282043
DunRenderBenchmark/RightTrapezoid_Transparent_FullyDark_median -0.4300 -0.4300 494497 281875 494434 281841
DunRenderBenchmark/RightTrapezoid_Transparent_FullyDark_stddev -0.4287 -0.4287 157383 89911 157370 89902
DunRenderBenchmark/RightTrapezoid_Transparent_FullyDark_cv +0.0014 +0.0014 0 0 0 0
DunRenderBenchmark/RightTrapezoid_Transparent_PartiallyLit_pvalue 0.7337 0.7337 U Test, Repetitions: 10 vs 10
DunRenderBenchmark/RightTrapezoid_Transparent_PartiallyLit_mean -0.0574 -0.0573 556031 524113 555924 524044
DunRenderBenchmark/RightTrapezoid_Transparent_PartiallyLit_median -0.0758 -0.0757 565940 523059 565802 522984
DunRenderBenchmark/RightTrapezoid_Transparent_PartiallyLit_stddev -0.1094 -0.1093 186798 166360 186758 166346
DunRenderBenchmark/RightTrapezoid_Transparent_PartiallyLit_cv -0.0552 -0.0551 0 0 0 0
OVERALL_GEOMEAN -0.1671 -0.1671 0 0 0 0
```
2 years ago
Gleb Mazovetskiy
451f1fd70a
Re-encode dungeon tiles to remove bloat
...
Triangles in the dungeon CEL data have two redundant 0x00 pixels every other row.
Re-encodes the dungeon CEL data to remove these pixels in order to save RAM and simplify the rendering code.
Example RAM savings:
```
VERBOSE: Re-encoding dungeon CELs: 1,119 frames, 738,836 bytes
VERBOSE: Re-encoded dungeon CELs: 1,119 frames, 722,552 bytes
```
Performance remains the same. The rendering code is now a bit simpler.
2 years ago
Gleb Mazovetskiy
d41c7e4221
dun_render: Optimize triangle rendering
...
A small performance improvement at the cost of ~1 KiB binary size.
1143 -> 1147 FPS on the timedemo
2 years ago
Gleb Mazovetskiy
e9c29fa806
Switch to ankerl::unordered_dense
2 years ago
obligaron
4b7424949f
Make IsFullyDark/IsFullyLit respect hell and hellfire levels
2 years ago
obligaron
56044b7021
Introduce IsFullyDark/IsFullyLit
2 years ago
Gleb Mazovetskiy
e5881688f4
`text_render`: Replace optional args with struct
...
4 options args are a bit unwieldy, especially when you want
to pass only the first and the last one.
With a struct, there is no need to specify the default values
for the args in between.
2 years ago
Gleb Mazovetskiy
fa155d4ffd
Dungeon tiles: Port over some cleanups from #6636
3 years ago
Gleb Mazovetskiy
3477d2f33f
Revert "dun_render: Add `DunTileColorMap` for baked light"
...
This reverts commit 827eb9705d .
3 years ago
Gleb Mazovetskiy
827eb9705d
dun_render: Add `DunTileColorMap` for baked light
...
Refs #6631
3 years ago
Gleb Mazovetskiy
b64ee0e190
Use `if constexpr` in clx/dun_render
3 years ago
Gleb Mazovetskiy
5355146d51
Use structured bindings
3 years ago
Gleb Mazovetskiy
8c1a847f41
Remove utils/stdcompat/string_view.hpp
3 years ago
Gleb Mazovetskiy
c19bfe87fa
Remove utils/stdcompat/algorithm.hpp
3 years ago
qndel
c362808165
debug path command ( #6101 )
3 years ago
Anders Jenbo
1d90730b0a
Correct use of local instead of global lightTableIndex
...
It looks like this was mistakenly using LightTableIndex instead of lightTableIndex. Found by @qndel
3 years ago
Anders Jenbo
dc2d97c112
Split lighting shades from trn tables
3 years ago
Gleb Mazovetskiy
e81f8affba
Fix rendering issues introduced by #5913
...
Fixes #5914
3 years ago
Gleb Mazovetskiy
774993c6d0
dun_renderer: Avoid calling 0-width `Blit*`
...
A slight optimization to avoid calling blit functions entirely
when the width is zero.
3 years ago
Gleb Mazovetskiy
397529bf0f
Rendering: Unify and optimize pixel blitters
...
1. Unifies the underlying CLX and dun_render blitters.
2. Optimizes them by unrolling loops and using pointer comparison rather
than length comparison (saves a length decrement).
3. In `dun_render`, extracts `RenderLineTransparent/Opaque` branches into
functions via explicit template specialization.
Example RG-99 FPS (non-PGO'd): 17.4->18.4
3 years ago
Gleb Mazovetskiy
1788d2f8ec
Remove miniwin
...
Event handling code moved to `engine/events.{hpp,cpp}`.
3 years ago
Gleb Mazovetskiy
f4b8edb5dc
Surface.pitch(): int -> uint16_t
3 years ago
Gleb Mazovetskiy
e06ca9a016
dun_render: Remove unused argument from RenderTile
...
Now that we pass the mask into `RenderTile`, we no longer need to pass
`levelPieceId`.
3 years ago
Gleb Mazovetskiy
1addfc9e54
dun_render: Deduplicate trapezoid upper half
3 years ago
Gleb Mazovetskiy
63a042d0e3
dun_render: Simplify non-masked primitives
...
As we recently confirmed, Square and Left/RightTriangle primitives
never use masks other than Transparent and Solid.
Simplify the code to take advantage of that.
3 years ago
Gleb Mazovetskiy
55d25fd079
dun_render: Swap32LE the data offset
3 years ago
Gleb Mazovetskiy
79b330825d
dun_render: Avoid `Invalid` tile type
...
1. Do not call `RenderTile` with invalid values to begin with.
2. Move mask selection out of `RenderTile`.
3 years ago
Gleb Mazovetskiy
44ed0296d8
dun_render: Overhaul mask handling
...
We notice that masks can be described by 2 parameters:
1. Whether they have 0 or 1 as their high bits.
2. Whether they shift to the left or to the right on the next line.
Describing masks this way allows us to lift them to template variables and simplify the code.
We also avoid handling the mask in the `RenderLine` loop entirely.
Also fixes a foliage rendering bug: Transparent foliage pixels were previously blended but they should have been simply skipped.
3 years ago
Gleb Mazovetskiy
aca4aae3c1
dun_render: Remove the use of `LightTableIndex`
...
Replaces the global with an argument.
3 years ago
Gleb Mazovetskiy
3afef6299f
Level renderer: Remove `cel_transparency/foliage_active` globals
3 years ago
Gleb Mazovetskiy
1293dfb86d
Level renderer: Remove `level_piece_id` global
...
`DrawFloor` now passes the piece ID into RenderTile.
Previously, `DrawFloor` did not set `level_piece_id`.
3 years ago
Gleb Mazovetskiy
c616e0d6d2
Level renderer: Remove `arch_draw_type` global
3 years ago
Gleb Mazovetskiy
69c429bb68
Level renderer: Remove `level_cel_block` global
3 years ago
Gleb Mazovetskiy
4cf0053ece
Set underlying type for all the enums
...
Reduces rg99 binary size by 3 KiB.
4 years ago
Gleb Mazovetskiy
a4ac41cece
Replace `DVL_VK` virtual key codes with `SDLK`
4 years ago
Anders Jenbo
3ae834148a
Split event handeling from general miniwin features
4 years ago
Anders Jenbo
2d21fc372e
Remove more miniwin code
4 years ago
Gleb Mazovetskiy
eb8721885d
Fix clang warnings
...
As seen in the Xbox NDK build.
4 years ago
Anders Jenbo
860bd1cebf
Operate directly on SOL data
4 years ago
Anders Jenbo
0508311959
Cleanup block_lvid checks
4 years ago
Anders Jenbo
b6bdbcfc98
Stip stippled transparency
4 years ago
obligaron
6273f700fa
Add some Graphic Settings to Settingsmenu ( #3617 )
4 years ago