diff --git a/fps.txt b/fps.txt new file mode 100644 index 0000000..106e5a7 --- /dev/null +++ b/fps.txt @@ -0,0 +1,2846 @@ +0 0 +1 143 +2 196 +3 266 +4 215 +5 201 +6 155 +7 210 +8 241 +9 261 +10 239 +11 271 +12 265 +13 239 +14 248 +15 209 +16 229 +17 270 +18 264 +19 229 +20 261 +21 255 +22 235 +23 193 +24 216 +25 225 +26 242 +27 265 +28 246 +29 226 +30 254 +31 266 +32 250 +33 267 +34 248 +35 239 +36 258 +37 230 +38 233 +39 251 +40 251 +41 230 +42 49 +43 228 +44 245 +45 246 +46 238 +47 255 +48 243 +49 212 +50 209 +51 255 +52 227 +53 215 +54 243 +55 260 +56 234 +57 252 +58 270 +59 245 +60 266 +61 256 +62 259 +63 268 +64 237 +65 206 +66 268 +67 265 +68 242 +69 215 +70 261 +71 244 +72 266 +73 225 +74 238 +75 270 +76 259 +77 215 +78 257 +79 262 +80 240 +81 274 +82 253 +83 260 +84 270 +85 246 +86 261 +87 245 +88 241 +89 242 +90 234 +91 243 +92 250 +93 279 +94 248 +95 255 +96 275 +97 239 +98 270 +99 273 +100 244 +101 268 +102 258 +103 259 +104 265 +105 259 +106 277 +107 267 +108 239 +109 232 +110 249 +111 253 +112 262 +113 62 +114 178 +115 190 +116 192 +117 204 +118 202 +119 203 +120 199 +121 207 +122 197 +123 176 +124 175 +125 199 +126 190 +127 191 +128 175 +129 171 +130 182 +131 164 +132 157 +133 173 +134 169 +135 184 +136 194 +137 200 +138 198 +139 214 +140 199 +141 211 +142 217 +143 202 +144 191 +145 198 +146 205 +147 212 +148 208 +149 201 +150 203 +151 201 +152 215 +153 202 +154 192 +155 189 +156 203 +157 196 +158 234 +159 190 +160 188 +161 183 +162 188 +163 175 +164 201 +165 216 +166 213 +167 210 +168 216 +169 206 +170 215 +171 190 +172 171 +173 196 +174 201 +175 206 +176 223 +177 200 +178 191 +179 211 +180 228 +181 211 +182 189 +183 210 +184 204 +185 206 +186 203 +187 210 +188 213 +189 212 +190 224 +191 202 +192 195 +193 212 +194 216 +195 191 +196 191 +197 208 +198 195 +199 201 +200 215 +201 220 +202 206 +203 210 +204 221 +205 213 +206 209 +207 265 +208 244 +209 264 +210 252 +211 257 +212 233 +213 228 +214 281 +215 240 +216 233 +217 273 +218 253 +219 259 +220 266 +221 245 +222 253 +223 252 +224 260 +225 268 +226 243 +227 229 +228 247 +229 250 +230 207 +231 217 +232 247 +233 206 +234 256 +235 271 +236 236 +237 212 +238 223 +239 237 +240 235 +241 203 +242 262 +243 208 +244 204 +245 206 +246 207 +247 201 +248 210 +249 214 +250 197 +251 207 +252 227 +253 198 +254 242 +255 253 +256 217 +257 254 +258 259 +259 276 +260 248 +261 284 +262 232 +263 251 +264 229 +265 254 +266 258 +267 272 +268 253 +269 260 +270 269 +271 266 +272 240 +273 258 +274 247 +275 247 +276 252 +277 233 +278 239 +279 280 +280 257 +281 281 +282 261 +283 257 +284 261 +285 245 +286 224 +287 256 +288 223 +289 241 +290 272 +291 273 +292 234 +293 269 +294 254 +295 260 +296 264 +297 268 +298 276 +299 263 +300 258 +301 236 +302 205 +303 246 +304 254 +305 259 +306 250 +307 265 +308 259 +309 253 +310 278 +311 252 +312 262 +313 236 +314 247 +315 277 +316 243 +317 257 +318 230 +319 269 +320 222 +321 255 +322 219 +323 248 +324 246 +325 267 +326 256 +327 271 +328 241 +329 247 +330 253 +331 250 +332 250 +333 244 +334 265 +335 238 +336 215 +337 253 +338 230 +339 243 +340 265 +341 246 +342 257 +343 270 +344 233 +345 246 +346 272 +347 242 +348 245 +349 278 +350 262 +351 276 +352 252 +353 249 +354 257 +355 251 +356 178 +357 187 +358 185 +359 220 +360 201 +361 197 +362 178 +363 213 +364 220 +365 193 +366 199 +367 194 +368 191 +369 172 +370 212 +371 227 +372 210 +373 200 +374 214 +375 225 +376 219 +377 218 +378 189 +379 193 +380 208 +381 187 +382 178 +383 205 +384 209 +385 207 +386 207 +387 203 +388 195 +389 216 +390 207 +391 189 +392 190 +393 210 +394 190 +395 210 +396 217 +397 220 +398 207 +399 213 +400 198 +401 181 +402 218 +403 197 +404 193 +405 213 +406 210 +407 203 +408 192 +409 206 +410 189 +411 202 +412 184 +413 204 +414 193 +415 210 +416 210 +417 209 +418 218 +419 202 +420 192 +421 195 +422 203 +423 220 +424 179 +425 203 +426 207 +427 185 +428 205 +429 212 +430 205 +431 211 +432 198 +433 181 +434 212 +435 206 +436 190 +437 171 +438 196 +439 269 +440 252 +441 251 +442 240 +443 247 +444 233 +445 219 +446 265 +447 236 +448 231 +449 277 +450 237 +451 247 +452 268 +453 252 +454 258 +455 241 +456 246 +457 248 +458 258 +459 249 +460 255 +461 267 +462 257 +463 268 +464 251 +465 262 +466 254 +467 231 +468 249 +469 246 +470 236 +471 252 +472 252 +473 246 +474 223 +475 247 +476 240 +477 250 +478 272 +479 217 +480 222 +481 195 +482 248 +483 233 +484 249 +485 248 +486 221 +487 239 +488 265 +489 279 +490 237 +491 270 +492 258 +493 242 +494 234 +495 242 +496 244 +497 274 +498 251 +499 248 +500 256 +501 251 +502 241 +503 257 +504 244 +505 241 +506 258 +507 255 +508 265 +509 264 +510 244 +511 267 +512 254 +513 252 +514 235 +515 247 +516 218 +517 236 +518 256 +519 253 +520 254 +521 272 +522 251 +523 258 +524 242 +525 251 +526 265 +527 243 +528 241 +529 224 +530 239 +531 255 +532 269 +533 228 +534 233 +535 222 +536 246 +537 257 +538 138 +539 232 +540 219 +541 252 +542 235 +543 263 +544 259 +545 249 +546 255 +547 257 +548 241 +549 264 +550 262 +551 255 +552 272 +553 249 +554 235 +555 261 +556 241 +557 255 +558 252 +559 248 +560 246 +561 276 +562 245 +563 253 +564 232 +565 237 +566 227 +567 209 +568 238 +569 253 +570 264 +571 251 +572 244 +573 276 +574 225 +575 254 +576 273 +577 250 +578 238 +579 282 +580 260 +581 257 +582 254 +583 248 +584 194 +585 221 +586 208 +587 220 +588 211 +589 220 +590 179 +591 222 +592 208 +593 209 +594 218 +595 217 +596 204 +597 195 +598 194 +599 210 +600 214 +601 199 +602 202 +603 201 +604 209 +605 231 +606 222 +607 212 +608 222 +609 216 +610 184 +611 195 +612 214 +613 219 +614 214 +615 208 +616 201 +617 215 +618 234 +619 210 +620 207 +621 206 +622 213 +623 211 +624 200 +625 194 +626 214 +627 229 +628 212 +629 183 +630 206 +631 215 +632 216 +633 176 +634 196 +635 201 +636 190 +637 185 +638 188 +639 200 +640 183 +641 184 +642 174 +643 202 +644 212 +645 223 +646 231 +647 207 +648 218 +649 214 +650 211 +651 211 +652 185 +653 189 +654 186 +655 201 +656 220 +657 207 +658 190 +659 203 +660 197 +661 198 +662 215 +663 216 +664 193 +665 208 +666 221 +667 209 +668 209 +669 219 +670 218 +671 189 +672 233 +673 264 +674 275 +675 243 +676 262 +677 250 +678 263 +679 232 +680 254 +681 267 +682 263 +683 266 +684 262 +685 275 +686 256 +687 224 +688 277 +689 240 +690 251 +691 267 +692 250 +693 277 +694 266 +695 231 +696 249 +697 254 +698 264 +699 232 +700 235 +701 251 +702 266 +703 237 +704 227 +705 267 +706 253 +707 246 +708 270 +709 228 +710 244 +711 268 +712 246 +713 248 +714 275 +715 190 +716 221 +717 242 +718 263 +719 243 +720 246 +721 256 +722 237 +723 273 +724 237 +725 245 +726 260 +727 263 +728 250 +729 266 +730 231 +731 231 +732 254 +733 256 +734 227 +735 264 +736 259 +737 232 +738 265 +739 251 +740 252 +741 241 +742 230 +743 244 +744 250 +745 250 +746 215 +747 243 +748 267 +749 246 +750 264 +751 237 +752 248 +753 277 +754 228 +755 245 +756 256 +757 249 +758 225 +759 256 +760 251 +761 218 +762 259 +763 273 +764 237 +765 254 +766 241 +767 245 +768 253 +769 261 +770 224 +771 281 +772 254 +773 264 +774 271 +775 258 +776 250 +777 273 +778 224 +779 254 +780 260 +781 240 +782 240 +783 255 +784 233 +785 243 +786 236 +787 229 +788 250 +789 264 +790 214 +791 240 +792 265 +793 254 +794 243 +795 270 +796 253 +797 245 +798 241 +799 242 +800 236 +801 282 +802 246 +803 244 +804 253 +805 242 +806 240 +807 270 +808 254 +809 261 +810 240 +811 240 +812 263 +813 263 +814 242 +815 177 +816 210 +817 200 +818 188 +819 212 +820 203 +821 219 +822 215 +823 204 +824 204 +825 213 +826 226 +827 216 +828 213 +829 211 +830 206 +831 224 +832 199 +833 195 +834 209 +835 210 +836 210 +837 196 +838 200 +839 200 +840 199 +841 202 +842 205 +843 192 +844 211 +845 211 +846 221 +847 197 +848 215 +849 205 +850 209 +851 224 +852 198 +853 198 +854 210 +855 224 +856 220 +857 200 +858 208 +859 211 +860 216 +861 214 +862 210 +863 192 +864 202 +865 202 +866 174 +867 192 +868 192 +869 201 +870 207 +871 220 +872 216 +873 208 +874 199 +875 213 +876 217 +877 211 +878 198 +879 188 +880 192 +881 220 +882 198 +883 199 +884 204 +885 212 +886 201 +887 224 +888 201 +889 204 +890 214 +891 225 +892 184 +893 200 +894 188 +895 202 +896 222 +897 209 +898 254 +899 237 +900 279 +901 236 +902 264 +903 220 +904 228 +905 256 +906 250 +907 256 +908 235 +909 268 +910 238 +911 45 +912 258 +913 244 +914 264 +915 258 +916 270 +917 262 +918 234 +919 227 +920 269 +921 247 +922 231 +923 252 +924 251 +925 233 +926 263 +927 259 +928 234 +929 249 +930 262 +931 238 +932 260 +933 260 +934 248 +935 237 +936 259 +937 248 +938 282 +939 236 +940 247 +941 271 +942 240 +943 231 +944 254 +945 241 +946 256 +947 207 +948 238 +949 200 +950 231 +951 252 +952 252 +953 249 +954 274 +955 238 +956 249 +957 279 +958 255 +959 264 +960 249 +961 249 +962 259 +963 255 +964 238 +965 277 +966 248 +967 246 +968 259 +969 248 +970 260 +971 268 +972 239 +973 261 +974 257 +975 241 +976 280 +977 231 +978 239 +979 267 +980 257 +981 236 +982 258 +983 241 +984 243 +985 263 +986 249 +987 239 +988 276 +989 255 +990 245 +991 251 +992 245 +993 251 +994 261 +995 255 +996 264 +997 263 +998 228 +999 215 +1000 262 +1001 258 +1002 264 +1003 268 +1004 245 +1005 269 +1006 252 +1007 222 +1008 274 +1009 248 +1010 256 +1011 263 +1012 259 +1013 254 +1014 279 +1015 216 +1016 238 +1017 244 +1018 254 +1019 237 +1020 255 +1021 252 +1022 243 +1023 242 +1024 259 +1025 255 +1026 276 +1027 245 +1028 268 +1029 258 +1030 246 +1031 254 +1032 244 +1033 250 +1034 272 +1035 252 +1036 257 +1037 260 +1038 260 +1039 233 +1040 266 +1041 271 +1042 265 +1043 190 +1044 199 +1045 200 +1046 197 +1047 189 +1048 213 +1049 197 +1050 200 +1051 204 +1052 206 +1053 208 +1054 215 +1055 207 +1056 189 +1057 213 +1058 222 +1059 224 +1060 212 +1061 206 +1062 211 +1063 207 +1064 215 +1065 209 +1066 202 +1067 228 +1068 216 +1069 194 +1070 163 +1071 206 +1072 202 +1073 224 +1074 216 +1075 190 +1076 188 +1077 216 +1078 223 +1079 216 +1080 210 +1081 211 +1082 219 +1083 216 +1084 207 +1085 209 +1086 191 +1087 231 +1088 201 +1089 192 +1090 197 +1091 201 +1092 209 +1093 208 +1094 201 +1095 198 +1096 210 +1097 226 +1098 213 +1099 196 +1100 204 +1101 216 +1102 211 +1103 207 +1104 213 +1105 214 +1106 220 +1107 226 +1108 220 +1109 208 +1110 219 +1111 209 +1112 196 +1113 204 +1114 203 +1115 214 +1116 232 +1117 210 +1118 215 +1119 223 +1120 219 +1121 213 +1122 195 +1123 202 +1124 212 +1125 230 +1126 250 +1127 275 +1128 264 +1129 231 +1130 242 +1131 254 +1132 240 +1133 262 +1134 241 +1135 254 +1136 277 +1137 264 +1138 252 +1139 290 +1140 245 +1141 281 +1142 244 +1143 255 +1144 256 +1145 259 +1146 251 +1147 272 +1148 242 +1149 238 +1150 264 +1151 242 +1152 245 +1153 277 +1154 251 +1155 273 +1156 215 +1157 250 +1158 226 +1159 262 +1160 260 +1161 275 +1162 247 +1163 261 +1164 254 +1165 246 +1166 229 +1167 271 +1168 270 +1169 251 +1170 261 +1171 255 +1172 237 +1173 259 +1174 223 +1175 244 +1176 253 +1177 246 +1178 250 +1179 263 +1180 255 +1181 258 +1182 248 +1183 235 +1184 226 +1185 271 +1186 75 +1187 230 +1188 231 +1189 231 +1190 273 +1191 247 +1192 238 +1193 278 +1194 240 +1195 262 +1196 269 +1197 249 +1198 264 +1199 236 +1200 253 +1201 267 +1202 256 +1203 237 +1204 260 +1205 249 +1206 258 +1207 248 +1208 255 +1209 260 +1210 270 +1211 259 +1212 256 +1213 251 +1214 244 +1215 272 +1216 256 +1217 240 +1218 249 +1219 235 +1220 238 +1221 279 +1222 246 +1223 249 +1224 248 +1225 244 +1226 262 +1227 283 +1228 257 +1229 267 +1230 247 +1231 231 +1232 213 +1233 270 +1234 256 +1235 259 +1236 264 +1237 247 +1238 262 +1239 256 +1240 204 +1241 258 +1242 257 +1243 252 +1244 276 +1245 272 +1246 258 +1247 267 +1248 258 +1249 245 +1250 245 +1251 263 +1252 253 +1253 272 +1254 249 +1255 220 +1256 257 +1257 256 +1258 278 +1259 221 +1260 228 +1261 249 +1262 272 +1263 232 +1264 265 +1265 252 +1266 237 +1267 245 +1268 267 +1269 266 +1270 260 +1271 247 +1272 255 +1273 269 +1274 256 +1275 223 +1276 216 +1277 210 +1278 216 +1279 181 +1280 210 +1281 227 +1282 198 +1283 210 +1284 212 +1285 188 +1286 219 +1287 209 +1288 190 +1289 189 +1290 194 +1291 193 +1292 205 +1293 207 +1294 214 +1295 216 +1296 231 +1297 229 +1298 206 +1299 227 +1300 208 +1301 211 +1302 179 +1303 219 +1304 218 +1305 232 +1306 215 +1307 221 +1308 204 +1309 216 +1310 213 +1311 218 +1312 191 +1313 213 +1314 213 +1315 202 +1316 208 +1317 206 +1318 213 +1319 229 +1320 200 +1321 199 +1322 182 +1323 214 +1324 218 +1325 203 +1326 215 +1327 201 +1328 209 +1329 222 +1330 209 +1331 208 +1332 183 +1333 209 +1334 222 +1335 207 +1336 198 +1337 216 +1338 198 +1339 203 +1340 187 +1341 200 +1342 172 +1343 184 +1344 205 +1345 220 +1346 207 +1347 218 +1348 178 +1349 208 +1350 204 +1351 213 +1352 208 +1353 211 +1354 190 +1355 198 +1356 232 +1357 262 +1358 235 +1359 290 +1360 244 +1361 255 +1362 253 +1363 243 +1364 271 +1365 227 +1366 236 +1367 267 +1368 249 +1369 237 +1370 259 +1371 241 +1372 228 +1373 255 +1374 270 +1375 235 +1376 269 +1377 272 +1378 233 +1379 262 +1380 233 +1381 252 +1382 280 +1383 256 +1384 246 +1385 250 +1386 242 +1387 242 +1388 221 +1389 208 +1390 234 +1391 276 +1392 261 +1393 243 +1394 271 +1395 243 +1396 211 +1397 249 +1398 242 +1399 257 +1400 263 +1401 234 +1402 251 +1403 275 +1404 251 +1405 238 +1406 279 +1407 272 +1408 240 +1409 250 +1410 180 +1411 221 +1412 258 +1413 264 +1414 260 +1415 270 +1416 260 +1417 224 +1418 258 +1419 268 +1420 246 +1421 221 +1422 181 +1423 154 +1424 188 +1425 226 +1426 208 +1427 272 +1428 245 +1429 227 +1430 252 +1431 270 +1432 260 +1433 265 +1434 243 +1435 224 +1436 267 +1437 224 +1438 232 +1439 272 +1440 244 +1441 236 +1442 266 +1443 264 +1444 254 +1445 252 +1446 235 +1447 261 +1448 273 +1449 267 +1450 254 +1451 245 +1452 242 +1453 278 +1454 233 +1455 232 +1456 266 +1457 275 +1458 218 +1459 261 +1460 255 +1461 247 +1462 249 +1463 227 +1464 253 +1465 281 +1466 241 +1467 207 +1468 243 +1469 257 +1470 228 +1471 242 +1472 268 +1473 260 +1474 268 +1475 239 +1476 248 +1477 254 +1478 222 +1479 242 +1480 274 +1481 266 +1482 228 +1483 199 +1484 267 +1485 260 +1486 254 +1487 237 +1488 225 +1489 266 +1490 225 +1491 228 +1492 231 +1493 252 +1494 232 +1495 228 +1496 268 +1497 257 +1498 214 +1499 256 +1500 241 +1501 251 +1502 282 +1503 229 +1504 252 +1505 218 +1506 220 +1507 193 +1508 204 +1509 200 +1510 225 +1511 186 +1512 195 +1513 210 +1514 183 +1515 205 +1516 226 +1517 191 +1518 211 +1519 220 +1520 210 +1521 209 +1522 209 +1523 213 +1524 197 +1525 203 +1526 223 +1527 218 +1528 99 +1529 216 +1530 188 +1531 196 +1532 215 +1533 188 +1534 200 +1535 226 +1536 208 +1537 189 +1538 206 +1539 224 +1540 205 +1541 218 +1542 214 +1543 205 +1544 217 +1545 216 +1546 204 +1547 201 +1548 209 +1549 191 +1550 188 +1551 209 +1552 189 +1553 205 +1554 198 +1555 211 +1556 196 +1557 191 +1558 206 +1559 215 +1560 231 +1561 204 +1562 208 +1563 194 +1564 198 +1565 229 +1566 213 +1567 219 +1568 194 +1569 200 +1570 200 +1571 196 +1572 201 +1573 195 +1574 204 +1575 203 +1576 215 +1577 205 +1578 198 +1579 199 +1580 218 +1581 220 +1582 181 +1583 194 +1584 186 +1585 255 +1586 275 +1587 236 +1588 273 +1589 243 +1590 244 +1591 267 +1592 201 +1593 210 +1594 243 +1595 287 +1596 212 +1597 253 +1598 254 +1599 273 +1600 251 +1601 253 +1602 248 +1603 260 +1604 257 +1605 250 +1606 252 +1607 243 +1608 232 +1609 209 +1610 273 +1611 243 +1612 273 +1613 261 +1614 255 +1615 256 +1616 235 +1617 221 +1618 226 +1619 245 +1620 261 +1621 232 +1622 259 +1623 261 +1624 263 +1625 92 +1626 241 +1627 241 +1628 238 +1629 231 +1630 234 +1631 276 +1632 235 +1633 248 +1634 272 +1635 269 +1636 263 +1637 261 +1638 265 +1639 231 +1640 221 +1641 193 +1642 240 +1643 277 +1644 203 +1645 251 +1646 260 +1647 275 +1648 209 +1649 253 +1650 255 +1651 251 +1652 229 +1653 242 +1654 250 +1655 257 +1656 239 +1657 257 +1658 223 +1659 247 +1660 242 +1661 245 +1662 263 +1663 238 +1664 252 +1665 247 +1666 235 +1667 223 +1668 262 +1669 247 +1670 235 +1671 259 +1672 242 +1673 258 +1674 267 +1675 242 +1676 251 +1677 283 +1678 246 +1679 267 +1680 248 +1681 232 +1682 259 +1683 263 +1684 251 +1685 270 +1686 259 +1687 257 +1688 250 +1689 250 +1690 221 +1691 259 +1692 260 +1693 260 +1694 259 +1695 258 +1696 283 +1697 261 +1698 221 +1699 253 +1700 244 +1701 250 +1702 264 +1703 262 +1704 241 +1705 276 +1706 248 +1707 255 +1708 274 +1709 274 +1710 282 +1711 252 +1712 236 +1713 247 +1714 214 +1715 239 +1716 253 +1717 252 +1718 242 +1719 262 +1720 255 +1721 240 +1722 248 +1723 248 +1724 234 +1725 233 +1726 235 +1727 254 +1728 254 +1729 263 +1730 235 +1731 238 +1732 260 +1733 242 +1734 191 +1735 222 +1736 218 +1737 205 +1738 199 +1739 205 +1740 221 +1741 195 +1742 207 +1743 217 +1744 211 +1745 219 +1746 206 +1747 210 +1748 211 +1749 220 +1750 209 +1751 203 +1752 196 +1753 197 +1754 207 +1755 213 +1756 201 +1757 202 +1758 205 +1759 216 +1760 177 +1761 216 +1762 202 +1763 200 +1764 214 +1765 211 +1766 197 +1767 213 +1768 218 +1769 221 +1770 188 +1771 191 +1772 205 +1773 195 +1774 204 +1775 196 +1776 195 +1777 211 +1778 215 +1779 212 +1780 225 +1781 207 +1782 207 +1783 178 +1784 209 +1785 227 +1786 203 +1787 207 +1788 205 +1789 191 +1790 228 +1791 213 +1792 183 +1793 180 +1794 215 +1795 209 +1796 219 +1797 222 +1798 206 +1799 214 +1800 223 +1801 206 +1802 185 +1803 206 +1804 194 +1805 207 +1806 204 +1807 205 +1808 210 +1809 218 +1810 216 +1811 205 +1812 198 +1813 208 +1814 272 +1815 232 +1816 235 +1817 267 +1818 244 +1819 219 +1820 286 +1821 239 +1822 221 +1823 215 +1824 256 +1825 245 +1826 265 +1827 260 +1828 257 +1829 270 +1830 251 +1831 236 +1832 270 +1833 270 +1834 252 +1835 262 +1836 259 +1837 265 +1838 239 +1839 236 +1840 236 +1841 253 +1842 236 +1843 228 +1844 252 +1845 255 +1846 241 +1847 224 +1848 198 +1849 230 +1850 258 +1851 247 +1852 230 +1853 242 +1854 289 +1855 205 +1856 245 +1857 264 +1858 256 +1859 251 +1860 257 +1861 257 +1862 258 +1863 272 +1864 240 +1865 272 +1866 226 +1867 253 +1868 258 +1869 245 +1870 238 +1871 243 +1872 241 +1873 238 +1874 262 +1875 237 +1876 231 +1877 253 +1878 264 +1879 241 +1880 257 +1881 248 +1882 245 +1883 280 +1884 240 +1885 238 +1886 248 +1887 237 +1888 240 +1889 263 +1890 250 +1891 243 +1892 255 +1893 247 +1894 234 +1895 263 +1896 250 +1897 239 +1898 198 +1899 266 +1900 232 +1901 250 +1902 277 +1903 236 +1904 266 +1905 248 +1906 251 +1907 273 +1908 251 +1909 249 +1910 271 +1911 248 +1912 256 +1913 266 +1914 240 +1915 227 +1916 267 +1917 260 +1918 252 +1919 258 +1920 243 +1921 255 +1922 224 +1923 251 +1924 271 +1925 253 +1926 49 +1927 248 +1928 247 +1929 277 +1930 215 +1931 223 +1932 247 +1933 255 +1934 206 +1935 263 +1936 260 +1937 264 +1938 227 +1939 241 +1940 262 +1941 264 +1942 254 +1943 263 +1944 280 +1945 271 +1946 224 +1947 277 +1948 251 +1949 271 +1950 268 +1951 258 +1952 274 +1953 278 +1954 245 +1955 260 +1956 248 +1957 251 +1958 247 +1959 241 +1960 236 +1961 245 +1962 189 +1963 201 +1964 202 +1965 222 +1966 216 +1967 213 +1968 195 +1969 183 +1970 215 +1971 222 +1972 205 +1973 223 +1974 209 +1975 218 +1976 222 +1977 217 +1978 204 +1979 215 +1980 200 +1981 203 +1982 207 +1983 212 +1984 220 +1985 203 +1986 197 +1987 197 +1988 202 +1989 209 +1990 230 +1991 202 +1992 223 +1993 215 +1994 222 +1995 203 +1996 216 +1997 204 +1998 214 +1999 217 +2000 208 +2001 202 +2002 191 +2003 215 +2004 204 +2005 203 +2006 207 +2007 228 +2008 219 +2009 197 +2010 187 +2011 197 +2012 217 +2013 228 +2014 205 +2015 214 +2016 229 +2017 230 +2018 227 +2019 217 +2020 222 +2021 189 +2022 197 +2023 200 +2024 204 +2025 198 +2026 199 +2027 224 +2028 205 +2029 190 +2030 217 +2031 209 +2032 210 +2033 191 +2034 212 +2035 201 +2036 208 +2037 218 +2038 210 +2039 218 +2040 223 +2041 217 +2042 211 +2043 202 +2044 211 +2045 194 +2046 215 +2047 211 +2048 255 +2049 255 +2050 253 +2051 227 +2052 259 +2053 208 +2054 267 +2055 263 +2056 245 +2057 242 +2058 279 +2059 227 +2060 258 +2061 276 +2062 283 +2063 252 +2064 298 +2065 245 +2066 289 +2067 229 +2068 240 +2069 254 +2070 269 +2071 239 +2072 284 +2073 267 +2074 264 +2075 252 +2076 233 +2077 226 +2078 264 +2079 194 +2080 224 +2081 269 +2082 268 +2083 241 +2084 273 +2085 253 +2086 263 +2087 248 +2088 269 +2089 239 +2090 232 +2091 256 +2092 263 +2093 226 +2094 255 +2095 254 +2096 261 +2097 252 +2098 263 +2099 259 +2100 230 +2101 266 +2102 239 +2103 237 +2104 256 +2105 233 +2106 230 +2107 217 +2108 265 +2109 245 +2110 236 +2111 252 +2112 231 +2113 250 +2114 246 +2115 250 +2116 235 +2117 253 +2118 245 +2119 250 +2120 237 +2121 219 +2122 245 +2123 261 +2124 235 +2125 239 +2126 261 +2127 229 +2128 228 +2129 260 +2130 257 +2131 257 +2132 207 +2133 273 +2134 227 +2135 249 +2136 276 +2137 246 +2138 270 +2139 267 +2140 221 +2141 261 +2142 235 +2143 233 +2144 232 +2145 260 +2146 258 +2147 257 +2148 270 +2149 248 +2150 256 +2151 257 +2152 213 +2153 270 +2154 240 +2155 238 +2156 267 +2157 269 +2158 225 +2159 240 +2160 269 +2161 243 +2162 263 +2163 263 +2164 253 +2165 254 +2166 259 +2167 228 +2168 251 +2169 261 +2170 268 +2171 271 +2172 267 +2173 281 +2174 276 +2175 265 +2176 265 +2177 268 +2178 258 +2179 259 +2180 215 +2181 267 +2182 249 +2183 241 +2184 271 +2185 216 +2186 261 +2187 268 +2188 246 +2189 267 +2190 266 +2191 251 +2192 238 +2193 263 +2194 259 +2195 238 +2196 192 +2197 217 +2198 205 +2199 199 +2200 207 +2201 232 +2202 188 +2203 204 +2204 214 +2205 207 +2206 215 +2207 199 +2208 207 +2209 211 +2210 222 +2211 236 +2212 190 +2213 210 +2214 198 +2215 215 +2216 205 +2217 228 +2218 224 +2219 200 +2220 228 +2221 212 +2222 187 +2223 219 +2224 233 +2225 207 +2226 211 +2227 220 +2228 234 +2229 212 +2230 216 +2231 215 +2232 209 +2233 205 +2234 192 +2235 198 +2236 179 +2237 217 +2238 224 +2239 196 +2240 229 +2241 229 +2242 211 +2243 207 +2244 205 +2245 192 +2246 178 +2247 210 +2248 215 +2249 204 +2250 208 +2251 224 +2252 226 +2253 217 +2254 197 +2255 208 +2256 200 +2257 209 +2258 211 +2259 214 +2260 220 +2261 227 +2262 195 +2263 208 +2264 202 +2265 191 +2266 204 +2267 234 +2268 211 +2269 204 +2270 223 +2271 216 +2272 227 +2273 219 +2274 266 +2275 238 +2276 217 +2277 265 +2278 253 +2279 261 +2280 268 +2281 238 +2282 261 +2283 246 +2284 242 +2285 237 +2286 276 +2287 246 +2288 205 +2289 281 +2290 233 +2291 236 +2292 267 +2293 233 +2294 234 +2295 239 +2296 256 +2297 268 +2298 280 +2299 248 +2300 240 +2301 266 +2302 276 +2303 259 +2304 240 +2305 257 +2306 269 +2307 276 +2308 250 +2309 279 +2310 243 +2311 238 +2312 226 +2313 261 +2314 261 +2315 258 +2316 231 +2317 245 +2318 262 +2319 261 +2320 237 +2321 260 +2322 259 +2323 264 +2324 248 +2325 260 +2326 251 +2327 260 +2328 220 +2329 252 +2330 244 +2331 240 +2332 223 +2333 253 +2334 251 +2335 262 +2336 253 +2337 245 +2338 250 +2339 270 +2340 211 +2341 250 +2342 269 +2343 256 +2344 253 +2345 241 +2346 244 +2347 271 +2348 263 +2349 277 +2350 273 +2351 241 +2352 242 +2353 277 +2354 234 +2355 272 +2356 255 +2357 264 +2358 283 +2359 270 +2360 253 +2361 251 +2362 231 +2363 229 +2364 232 +2365 260 +2366 262 +2367 284 +2368 254 +2369 250 +2370 253 +2371 236 +2372 234 +2373 274 +2374 260 +2375 264 +2376 212 +2377 229 +2378 250 +2379 243 +2380 200 +2381 252 +2382 273 +2383 262 +2384 261 +2385 255 +2386 243 +2387 239 +2388 240 +2389 259 +2390 248 +2391 274 +2392 261 +2393 260 +2394 271 +2395 254 +2396 249 +2397 260 +2398 256 +2399 254 +2400 238 +2401 243 +2402 241 +2403 230 +2404 231 +2405 279 +2406 258 +2407 229 +2408 256 +2409 249 +2410 237 +2411 271 +2412 222 +2413 258 +2414 275 +2415 249 +2416 251 +2417 245 +2418 257 +2419 245 +2420 272 +2421 246 +2422 257 +2423 233 +2424 239 +2425 245 +2426 247 +2427 243 +2428 241 +2429 260 +2430 268 +2431 228 +2432 190 +2433 226 +2434 214 +2435 212 +2436 209 +2437 210 +2438 176 +2439 203 +2440 215 +2441 208 +2442 221 +2443 208 +2444 217 +2445 225 +2446 219 +2447 218 +2448 203 +2449 218 +2450 215 +2451 207 +2452 206 +2453 206 +2454 209 +2455 212 +2456 206 +2457 207 +2458 185 +2459 208 +2460 222 +2461 211 +2462 227 +2463 206 +2464 194 +2465 203 +2466 201 +2467 201 +2468 210 +2469 202 +2470 224 +2471 203 +2472 207 +2473 204 +2474 209 +2475 221 +2476 211 +2477 188 +2478 175 +2479 212 +2480 220 +2481 214 +2482 194 +2483 194 +2484 212 +2485 227 +2486 214 +2487 213 +2488 221 +2489 226 +2490 198 +2491 191 +2492 206 +2493 209 +2494 198 +2495 229 +2496 218 +2497 213 +2498 212 +2499 215 +2500 196 +2501 207 +2502 208 +2503 230 +2504 219 +2505 220 +2506 212 +2507 223 +2508 218 +2509 201 +2510 214 +2511 204 +2512 253 +2513 231 +2514 207 +2515 268 +2516 252 +2517 265 +2518 227 +2519 229 +2520 197 +2521 243 +2522 224 +2523 263 +2524 228 +2525 251 +2526 255 +2527 247 +2528 262 +2529 255 +2530 241 +2531 265 +2532 242 +2533 247 +2534 253 +2535 254 +2536 236 +2537 249 +2538 237 +2539 255 +2540 236 +2541 263 +2542 257 +2543 256 +2544 229 +2545 207 +2546 269 +2547 258 +2548 240 +2549 254 +2550 242 +2551 245 +2552 247 +2553 258 +2554 250 +2555 268 +2556 254 +2557 235 +2558 232 +2559 255 +2560 242 +2561 243 +2562 233 +2563 215 +2564 224 +2565 241 +2566 237 +2567 246 +2568 207 +2569 229 +2570 246 +2571 251 +2572 232 +2573 265 +2574 261 +2575 249 +2576 249 +2577 279 +2578 229 +2579 257 +2580 239 +2581 245 +2582 236 +2583 264 +2584 205 +2585 249 +2586 241 +2587 247 +2588 242 +2589 259 +2590 247 +2591 242 +2592 252 +2593 223 +2594 220 +2595 209 +2596 235 +2597 242 +2598 253 +2599 272 +2600 258 +2601 272 +2602 256 +2603 220 +2604 254 +2605 241 +2606 239 +2607 270 +2608 259 +2609 243 +2610 259 +2611 229 +2612 230 +2613 262 +2614 254 +2615 222 +2616 229 +2617 265 +2618 235 +2619 197 +2620 259 +2621 242 +2622 228 +2623 252 +2624 246 +2625 237 +2626 268 +2627 252 +2628 244 +2629 253 +2630 224 +2631 257 +2632 256 +2633 240 +2634 242 +2635 267 +2636 243 +2637 250 +2638 276 +2639 270 +2640 250 +2641 269 +2642 216 +2643 233 +2644 266 +2645 257 +2646 206 +2647 252 +2648 142 +2649 248 +2650 249 +2651 252 +2652 249 +2653 256 +2654 277 +2655 283 +2656 259 +2657 245 +2658 252 +2659 226 +2660 265 +2661 252 +2662 181 +2663 211 +2664 217 +2665 202 +2666 215 +2667 211 +2668 191 +2669 214 +2670 202 +2671 200 +2672 212 +2673 222 +2674 204 +2675 203 +2676 219 +2677 199 +2678 209 +2679 218 +2680 203 +2681 201 +2682 217 +2683 225 +2684 203 +2685 213 +2686 212 +2687 205 +2688 191 +2689 205 +2690 192 +2691 197 +2692 208 +2693 215 +2694 203 +2695 210 +2696 208 +2697 214 +2698 203 +2699 200 +2700 215 +2701 195 +2702 208 +2703 218 +2704 193 +2705 217 +2706 205 +2707 208 +2708 217 +2709 217 +2710 218 +2711 184 +2712 222 +2713 206 +2714 197 +2715 207 +2716 208 +2717 180 +2718 221 +2719 209 +2720 206 +2721 199 +2722 195 +2723 215 +2724 209 +2725 223 +2726 217 +2727 229 +2728 202 +2729 213 +2730 202 +2731 184 +2732 211 +2733 224 +2734 214 +2735 192 +2736 211 +2737 207 +2738 195 +2739 220 +2740 197 +2741 217 +2742 261 +2743 206 +2744 245 +2745 267 +2746 248 +2747 237 +2748 212 +2749 256 +2750 228 +2751 278 +2752 213 +2753 260 +2754 275 +2755 253 +2756 73 +2757 224 +2758 229 +2759 274 +2760 240 +2761 252 +2762 251 +2763 239 +2764 218 +2765 240 +2766 242 +2767 230 +2768 250 +2769 239 +2770 253 +2771 246 +2772 236 +2773 225 +2774 265 +2775 228 +2776 256 +2777 235 +2778 273 +2779 216 +2780 213 +2781 258 +2782 238 +2783 235 +2784 224 +2785 246 +2786 206 +2787 252 +2788 251 +2789 238 +2790 241 +2791 251 +2792 223 +2793 246 +2794 238 +2795 233 +2796 236 +2797 260 +2798 238 +2799 235 +2800 217 +2801 253 +2802 249 +2803 245 +2804 266 +2805 249 +2806 259 +2807 265 +2808 236 +2809 263 +2810 259 +2811 232 +2812 258 +2813 249 +2814 231 +2815 249 +2816 241 +2817 246 +2818 219 +2819 255 +2820 236 +2821 257 +2822 218 +2823 260 +2824 256 +2825 271 +2826 240 +2827 219 +2828 237 +2829 216 +2830 230 +2831 232 +2832 265 +2833 255 +2834 238 +2835 268 +2836 248 +2837 260 +2838 215 +2839 248 +2840 270 +2841 277 +2842 231 +2843 262 +2844 254 +2845 247 diff --git a/imgui.ini b/imgui.ini index 4f896f9..f8f7b0d 100644 --- a/imgui.ini +++ b/imgui.ini @@ -4,13 +4,17 @@ Size=400,400 [Window][Camera] Pos=1652,11 -Size=259,192 +Size=259,200 [Window][Material] -Pos=1650,202 +Pos=1650,214 Size=266,285 [Window][Fog settings] -Pos=1679,495 +Pos=1654,501 Size=247,157 +[Window][Debug] +Pos=1650,665 +Size=260,294 + diff --git a/includes/RT/Scene.hpp b/includes/RT/Scene.hpp index 0eff0c1..ba09864 100644 --- a/includes/RT/Scene.hpp +++ b/includes/RT/Scene.hpp @@ -64,6 +64,14 @@ struct GPUVolume int enabled; }; +struct GPUDebug +{ + int enabled; + int mode; + int triangle_treshold; + int box_treshold; +}; + struct GPUBvh { alignas(16) glm::vec3 min; @@ -99,9 +107,11 @@ class Scene const std::vector &getTriangleData() const; std::vector &getMaterialData(); - GPUVolume &getVolume(); std::vector &getBVH(); + GPUVolume &getVolume(); + GPUDebug &getDebug(); + Camera *getCamera(void) const; GPUMaterial getMaterial(int material_index); @@ -116,6 +126,7 @@ class Scene std::set _gpu_lights; GPUVolume _gpu_volume; + GPUDebug _gpu_debug; Camera *_camera; }; diff --git a/scenes/dragon.rt b/scenes/dragon.rt new file mode 100644 index 0000000..245a171 --- /dev/null +++ b/scenes/dragon.rt @@ -0,0 +1,27 @@ +CAM 1.93858 0.961594 -0.0117614 -25 180 0.05 2.1639994842342176 29.263 5 + + +MAT 255 255 255 0.0 1. 0.5 // white 0 + +MAT 255 10 10 0.0 0.0 0.0 // red 1 +MAT 30 30 30 0.0 0.0 0.0 // gray 2 +MAT 10 255 10 0.0 0.0 0.0 // green 3 +MAT 255 255 255 0.0 0.0 0.0 // white 4 +MAT 50 50 255 0.0 0.0 0.0 // white 5 + +MAT 255 255 255 5.0 0.0 0.0 // white light 6 + + +MAT 255 255 255 0.0 0.0 0.0 TRN // glass 7 + +pl 0 0 -2 0 0 1 1 // back wall +pl 0 0 2 0 0 -1 5 // front wall +pl 2 0 0 -1 0 0 3 // right wall +pl -2 0 0 1 0 0 2 // left wall +pl 0 2 0 0 -1 0 0 // ceiling +pl 0 -2 0 0 1 0 2 // floor + +qu -1 1.999 -1 2 0 0 0 0 2 6 + +OBJ obj/Dragon_80K.obj + diff --git a/scenes/test.rt b/scenes/test.rt index 31a4a12..614df5b 100644 --- a/scenes/test.rt +++ b/scenes/test.rt @@ -1,7 +1,6 @@ -CAM 1.29625 0.667446 0.00169364 -24.6 178.8 0.03 1.3 45 5 +CAM -1 0 0 0 0 0 1 90 5 - -MAT 255 255 255 0.0 0.75 1.0 // white 0 +MAT 255 255 255 0.0 1. 0.5 // white 0 MAT 255 10 10 0.0 0.0 0.0 // red 1 MAT 30 30 30 0.0 0.0 0.0 // gray 2 @@ -14,14 +13,13 @@ MAT 255 255 255 5.0 0.0 0.0 // white light 6 MAT 255 255 255 0.0 0.0 0.0 TRN // glass 7 -pl 0 0 -2 0 0 1 1 // back wall -pl 0 0 2 0 0 -1 5 // front wall -pl 2 0 0 -1 0 0 3 // right wall -pl -2 0 0 1 0 0 2 // left wall -pl 0 2 0 0 -1 0 0 // ceiling -pl 0 -2 0 0 1 0 2 // floor +# pl 0 0 -40 0 0 1 1 // back wall +# pl 0 0 40 0 0 -1 5 // front wall +# pl 40 0 0 -1 0 0 3 // right wall +# pl -40 0 0 1 0 0 2 // left wall +# pl 0 60 0 0 -1 0 4 // ceiling +# pl 0 -10 0 0 1 0 2 // floor -qu -1 1.999 -1 2 0 0 0 0 2 6 +# qu -20 59 -20 40 0 0 0 0 40 6 OBJ obj/Dragon_80K.obj - diff --git a/shaders/debug.glsl b/shaders/debug.glsl index bb03554..bafb9d5 100644 --- a/shaders/debug.glsl +++ b/shaders/debug.glsl @@ -20,6 +20,18 @@ layout(std140, binding = 0) uniform CameraData GPUCamera camera; }; +struct GPUDebug +{ + int enabled; + int mode; + int triangle_treshold; + int box_treshold; +}; +layout(std140, binding = 2) uniform DebugData +{ + GPUDebug debug; +}; + struct GPUObject { mat4 rotation; @@ -95,6 +107,12 @@ struct hitInfo int mat_index; }; +struct Stats +{ + int triangle_count; + int box_count; +}; + #include "shaders/intersect.glsl" int traceRay(Ray ray) @@ -114,7 +132,7 @@ int traceRay(Ray ray) return (num_hit); } -hitInfo traceBVH(Ray ray, inout int num_hit) +hitInfo traceBVH(Ray ray, inout Stats stats) { hitInfo hit; @@ -137,12 +155,12 @@ hitInfo traceBVH(Ray ray, inout int num_hit) if (intersectRayBVH(ray, node)) { - num_hit++; + stats.box_count++; if (node.is_leaf != 0) { for (int i = 0; i < node.primitive_count; i++) - { + { GPUTriangle obj = triangles[node.first_primitive + i]; hitInfo temp_hit; @@ -152,6 +170,7 @@ hitInfo traceBVH(Ray ray, inout int num_hit) hit.normal = temp_hit.normal; hit.obj_index = node.first_primitive + i; } + stats.triangle_count++; } } @@ -181,6 +200,29 @@ Ray initRay(vec2 uv) return (Ray(origin, ray_direction)); } +vec3 debugColor(vec2 uv) +{ + Ray ray = initRay(uv); + Stats stats = Stats(0, 0); + + hitInfo hit = traceBVH(ray, stats); + + float box_display = float(stats.box_count) / float(debug.box_treshold); + float triangle_display = float(stats.triangle_count) / float(debug.triangle_treshold); + + switch (debug.mode) + { + case 0: + return (hit.normal * 0.5 + 0.5) * int(hit.obj_index != -1); + case 1: + return (box_display < 1. ? vec3(box_display) : vec3(1., 0., 0.)); + case 2: + return (triangle_display < 1. ? vec3(triangle_display) : vec3(1., 0., 0.)); + } + + return (vec3(0.)); +} + void main() { ivec2 pixel_coords = ivec2(gl_GlobalInvocationID.xy); @@ -190,19 +232,7 @@ void main() vec2 uv = ((vec2(pixel_coords)) / u_resolution) * 2.0 - 1.0;; uv.x *= u_resolution.x / u_resolution.y; - - Ray ray = initRay(uv); - - int hits = 0; - hitInfo hit = traceBVH(ray, hits); - - vec3 color = vec3(0.); - // if (hit.obj_index != -1) - // color = vec3(hit.normal); - if (hits > 150) - color = vec3(1., 0., 0.); - else - color = vec3(float(hits) / float(100)); + vec3 color = debugColor(uv); imageStore(output_image, pixel_coords, vec4(color, 1.)); } \ No newline at end of file diff --git a/srcs/RT.cpp b/srcs/RT.cpp index b431ca6..39855fe 100644 --- a/srcs/RT.cpp +++ b/srcs/RT.cpp @@ -20,8 +20,8 @@ int main(int argc, char **argv) return (1); Window window(&scene, WIDTH, HEIGHT, "RT_GPU", 0); - Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl"); - // Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl"); + // Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl"); + Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl"); GLint max_gpu_size; glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_gpu_size); @@ -80,6 +80,12 @@ int main(int argc, char **argv) glBufferData(GL_UNIFORM_BUFFER, sizeof(GPUVolume), nullptr, GL_STATIC_DRAW); glBindBufferBase(GL_UNIFORM_BUFFER, 1, volumeUBO); + GLuint debugUBO; + glGenBuffers(1, &debugUBO); + glBindBuffer(GL_UNIFORM_BUFFER, debugUBO); + glBufferData(GL_UNIFORM_BUFFER, sizeof(GPUDebug), nullptr, GL_STATIC_DRAW); + glBindBufferBase(GL_UNIFORM_BUFFER, 2, debugUBO); + shader.attach(); @@ -87,8 +93,11 @@ int main(int argc, char **argv) size_t size = sizeof(vertices) / sizeof(Vertex) / 3; shader.setupVertexBuffer(vertices, size); + std::vector recorded_fps; + while (!window.shouldClose()) { + glUseProgram(shader.getProgramCompute()); glBindBuffer(GL_SHADER_STORAGE_BUFFER, objectSSBO); @@ -110,13 +119,36 @@ int main(int argc, char **argv) glBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, gpu_bvh.size() * sizeof(GPUBvh), gpu_bvh.data()); - GPUCamera camera_data = scene.getCamera()->getGPUData(); + Camera *camera = scene.getCamera(); + + // performance profiling + if (true && window.getFps() < 2000) + { + float time = (float)(glfwGetTime()) ; + + recorded_fps.push_back((int)window.getFps()); + + camera->setPosition(glm::vec3(cos((time + 6.28) * 0.5), 0., sin((time + 6.28) * 0.5))); + glm::vec3 direction = glm::normalize(camera->getPosition()); + float yaw = glm::degrees(atan2(direction.z, direction.x)); + + if ((int)yaw == 179) + break; + + camera->setDirection(0, yaw - 180); + camera->updateCameraVectors(); + } + // + + GPUCamera camera_data = camera->getGPUData(); glBindBuffer(GL_UNIFORM_BUFFER, cameraUBO); glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(GPUCamera), &camera_data); glBindBuffer(GL_UNIFORM_BUFFER, volumeUBO); glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(GPUVolume), &scene.getVolume()); + glBindBuffer(GL_UNIFORM_BUFFER, debugUBO); + glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(GPUDebug), &scene.getDebug()); shader.set_int("u_frameCount", window.getFrameCount()); shader.set_int("u_objectsNum", object_data.size()); @@ -146,5 +178,12 @@ int main(int argc, char **argv) ImGui_ImplGlfw_Shutdown(); ImGui::DestroyContext(); + // performance profiling + std::ofstream file("fps.txt"); + for (int i = 0; i < recorded_fps.size(); i++) + file << i << " " << recorded_fps[i] << std::endl; + file.close(); + // + return (0); } diff --git a/srcs/class/Scene.cpp b/srcs/class/Scene.cpp index ac291d5..1b54128 100644 --- a/srcs/class/Scene.cpp +++ b/srcs/class/Scene.cpp @@ -17,10 +17,15 @@ Scene::Scene() _camera = new Camera(glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f), -90.0f, 0.0f); _gpu_volume.enabled = 0; - _gpu_volume.sigma_a = glm::vec3(0.0001f); + _gpu_volume.sigma_a = glm::vec3(0.0000f); _gpu_volume.sigma_s = glm::vec3(0.0800f); _gpu_volume.sigma_t = _gpu_volume.sigma_a + _gpu_volume.sigma_s; - _gpu_volume.g = 0.9f; + _gpu_volume.g = 1.0f; + + _gpu_debug.enabled = 0; + _gpu_debug.mode = 0; + _gpu_debug.triangle_treshold = 1; + _gpu_debug.box_treshold = 1; } Scene::~Scene() @@ -193,6 +198,11 @@ GPUVolume &Scene::getVolume() return (_gpu_volume); } +GPUDebug &Scene::getDebug() +{ + return (_gpu_debug); +} + std::vector &Scene::getBVH() { return (_gpu_bvh); diff --git a/srcs/class/Window.cpp b/srcs/class/Window.cpp index cfd90d0..409269b 100644 --- a/srcs/class/Window.cpp +++ b/srcs/class/Window.cpp @@ -248,6 +248,15 @@ void Window::imGuiRender() ImGui::End(); + ImGui::Begin("Debug"); + + has_changed |= ImGui::Checkbox("Enable", (bool *)(&_scene->getDebug().enabled)); + ImGui::Separator(); + has_changed |= ImGui::SliderInt("Debug mode", &_scene->getDebug().mode, 0, 2); + has_changed |= ImGui::SliderInt("Box treshold", &_scene->getDebug().box_treshold, 1, 2000); + has_changed |= ImGui::SliderInt("Triangle treshold", &_scene->getDebug().triangle_treshold, 1, 2000); + + ImGui::End(); ImGui::Render(); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());