Browse Source

display performance

main
gsd 6 months ago
parent
commit
817420c8d5
  1. 9
      pipboy-setup.sh
  2. 5
      pipboyUI/dist/pipboy-ui/index.html
  3. 2
      pipboyUI/dist/pipboy-ui/main.30dd391d117b260e.js
  4. 2
      pipboyUI/dist/pipboy-ui/styles.8d5c33a9ea7e810f.css
  5. 2
      pipboyUI/package.json
  6. 1
      pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts
  7. 1
      pipboyUI/src/index.html
  8. 15
      pipboyUI/src/styles.scss
  9. 129
      pipboyUI/src/styles/crt-16bit.scss
  10. 191
      pipboyUI/src/styles/crt.scss
  11. 24
      pipboyUI/src/styles/settings.scss
  12. 10
      readme.md

9
pipboy-setup.sh

@ -26,7 +26,14 @@ cd fbcp-ili9341
mkdir build && cd build
#append to fix -DDISPLAY_INVERT_COLORS=ON -DSTATISTICS=0
cmake -DUSE_GPU=ON -DSPI_BUS_CLOCK_DIVISOR=12 -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_RESET_PIN=17 -DILI9488=ON -DUSE_DMA_TRANSFERS=OFF -DDISPLAY_INVERT_COLORS=ON -DSTATISTICS=0 ..
#stable but slowle
#cmake -DUSE_GPU=ON -DSPI_BUS_CLOCK_DIVISOR=12 -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_RESET_PIN=17 -DILI9488=ON -DUSE_DMA_TRANSFERS=OFF -DDISPLAY_INVERT_COLORS=ON -DSTATISTICS=0 ..
#uncoma define RUN_WITH_REALTIME_THREAD_PRIORITY in config.h
#use DMA
# #define TARGET_FRAME_RATE 24 in display.h
cmake -DUSE_GPU=ON -DSPI_BUS_CLOCK_DIVISOR=12 -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_RESET_PIN=17 -DILI9488=ON -DUSE_DMA_TRANSFERS=ON -DDISPLAY_INVERT_COLORS=ON -DSTATISTICS=1 ..
make -j$(nproc)
sudo install fbcp-ili9341 /usr/local/bin/
./config.sh

5
pipboyUI/dist/pipboy-ui/index.html

File diff suppressed because one or more lines are too long

2
pipboyUI/dist/pipboy-ui/main.b6c51b3b3e8bb158.js → pipboyUI/dist/pipboy-ui/main.30dd391d117b260e.js

File diff suppressed because one or more lines are too long

2
pipboyUI/dist/pipboy-ui/styles.d02872c9162ec3e3.css → pipboyUI/dist/pipboy-ui/styles.8d5c33a9ea7e810f.css

File diff suppressed because one or more lines are too long

2
pipboyUI/package.json

@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start": "ng serve --host 0.0.0.0 --disable-host-check",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"

1
pipboyUI/src/app/components/LowerHeaders/Inventory/inventory-apps.component.ts

@ -64,6 +64,7 @@ export class InventoryAppsComponent extends AbsListSelect<InvApp, any> {
}
override elements: InvApp[] = [
{name: "ReloadUI", action: () => location.reload(), matIcon: true, icon:"help", about: "reload window"},
{name: "Clock", action: () => {
this.openApp(ClockDialogApp);
}, matIcon: true, icon: "access_time", about: "Забытые часы самого тодда говарда. Он забыл их в своей прекрастной игре каллаут76."},

1
pipboyUI/src/index.html

@ -11,6 +11,7 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div class="scanline"></div>
<app-root></app-root>
</body>
</html>

15
pipboyUI/src/styles.scss

@ -1,5 +1,6 @@
/* You can add global styles to this file, and also import other style files */
@import "styles/crt";
@import "styles/crt-16bit";
@import "styles/settings";
@font-face {
font-family: 'RobotoTodd';
@ -22,15 +23,19 @@
font-style: normal;
}
$primary-color: rgb(0, 242, 0);
$secondary-color: rgb(0 242 0 / 30%);
$screen-width: 460px;
$screen-height: 308px;
html, body {
height: $screen-height;
width: $screen-width;
background-color: black
}
html, body { height: 308px; width: $screen-width; background-color: black }
body {
margin: 0;
font-family: RobotoTodd, "Helvetica Neue", sans-serif;
color: rgb(0, 0.949*255, 0)
color: rgb(0, g(0.949 * 255), 0)
}
.activeHeader {

129
pipboyUI/src/styles/crt-16bit.scss

@ -0,0 +1,129 @@
@import "settings";
$z-main: 20000;
$z-scanline: 10000;
$z-3: 30000;
.crt-screen {
position: relative;
background: piprgb(0, 17, 0); /* Тёмно-зелёный фон 0 17 0*/
color: piprgb(0, 255, 0); /* Ярко-зелёный текст */
overflow: hidden;
}
//пердит полосками
.crt-screen::before {
content: " ";
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: linear-gradient(
//18 16 16
piprgba(18, 16, 16, 0) 50%,
piprgba(0, 0, 0, 0.2) 25%
);
background-size: 100% 1.5px;
z-index: $z-main;
pointer-events: none;
}
.crt-screen::after {
content: " ";
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: piprgba(0, 63, 0, 0.05);
opacity: 0.1;
z-index: $z-main;
pointer-events: none;
//animation: flicker 0.15s infinite;//убивает весь фпс
}
/* Эффект виньетирования */
.crt-screen {
box-shadow:
inset 0 0 60px piprgba(0, 255, 0, 0.1),
inset 0 0 100px piprgba(0, 20, 0, 0.8),
inset 0 0 150px piprgba(0, 10, 0, 0.9);
}
/* Эффект сканирования */
.scanline {
width: 100%;
height: 15px;
background: linear-gradient(
0deg,
piprgba(0, 255, 0, 0) 0%,
piprgba(0, 255, 0, 0.5) 50%,
piprgba(0, 255, 0, 0) 100%
);
position: absolute;
animation: scan 8s linear infinite;
z-index: $z-scanline;
pointer-events: none;
}
/* Свечение для текста */
.crt-text {
text-shadow:
0 0 5px piprgb(0,255,0),
0 0 10px piprgb(0,255,0),
0 0 15px piprgb(0,255,0);
}
/* Эффект мерцания */
@keyframes flicker {
0% { opacity: 0.1; }
5% { opacity: 0.1; }
10% { opacity: 0.2; }
15% { opacity: 0.1; }
20% { opacity: 0.3; }
25% { opacity: 0.1; }
30% { opacity: 0.2; }
35% { opacity: 0.1; }
40% { opacity: 0.25; }
45% { opacity: 0.1; }
50% { opacity: 0.15; }
55% { opacity: 0.1; }
60% { opacity: 0.2; }
65% { opacity: 0.1; }
70% { opacity: 0.3; }
75% { opacity: 0.1; }
80% { opacity: 0.25; }
85% { opacity: 0.1; }
90% { opacity: 0.2; }
95% { opacity: 0.1; }
100% { opacity: 0.15; }
}
/* Движение сканирующей линии */
@keyframes scan {
0% {
top: -100px;
}
100% {
top: 100%;
}
}
/* Дополнительные эффекты для контента */
.crt-screen img,
.crt-screen video {
filter:
contrast(1.2)
brightness(0.8)
hue-rotate(90deg)
saturate(0.5);
}
/* Эффект кривизны экрана (опционально) */
.crt-curve {
transform: perspective(400px) rotateX(2deg);
transform-origin: center top;
}

191
pipboyUI/src/styles/crt.scss

@ -1,191 +0,0 @@
$z-main: 20000;
$z-scanline: 10000;
$z-3: 30000;
.crt-fallout {
position: relative;
background: #000 !important;
color: #0F0 !important;
image-rendering: pixelated;
image-rendering: crisp-edges;
}
/* 16-битная палитра с ограниченными цветами */
.crt-fallout::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
repeating-linear-gradient(
0deg,
rgba(0, 32, 0, 0.8) 0px,
rgba(0, 32, 0, 0.8) 1px,
transparent 1px,
transparent 2px
),
repeating-linear-gradient(
90deg,
rgba(0, 16, 0, 0.4) 0px,
rgba(0, 16, 0, 0.4) 1px,
transparent 1px,
transparent 2px
);
pointer-events: none;
z-index: $z-scanline;
}
/* Полосы развёртки (оптимизированные под 24 FPS) */
.crt-fallout::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
rgba(0, 255, 0, 0.06) 50%,
transparent 50%
);
background-size: 100% 3px;
z-index: $z-main;
animation: scanlines 0.666s linear infinite;
/* 1 / 24 FPS * 16 кадров = 0.666s */
}
/* 16-битное свечение текста */
.crt-fallout .text {
color: #0F0;
text-shadow:
0 0 2px #0F0,
0 0 4px #0C0,
0 0 6px #090;
font-smooth: never;
-webkit-font-smoothing: none;
}
/* 16-битный фильтр для изображений */
.crt-fallout img,
.crt-fallout video,
.crt-fallout canvas {
filter:
brightness(0.7)
contrast(1.3)
hue-rotate(90deg)
saturate(0.6)
url('#crtFilter');
}
/* SVG фильтр для 16-битного эффекта */
.filter-svg {
position: absolute;
width: 0;
height: 0;
}
/* Статический шум с пониженной частотой */
.noise-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image:
url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23noise)' opacity='0.15'/%3E%3C/svg%3E");
background-repeat: repeat;
opacity: 0.1;
animation: noise 2s steps(24) infinite;
z-index: $z-3;
pointer-events: none;
}
/* Анимации, синхронизированные с 24 FPS */
@keyframes scanlines {
0% {
transform: translateY(0px);
}
100% {
transform: translateY(3px);
}
}
@keyframes flicker {
0%, 100% { opacity: 0.97; }
4.166% { opacity: 0.95; } /* 1/24 кадра */
8.333% { opacity: 0.93; } /* 2/24 кадра */
12.5% { opacity: 0.95; } /* 3/24 кадра */
16.666% { opacity: 0.97; } /* 4/24 кадра */
20.833% { opacity: 0.94; } /* 5/24 кадра */
25% { opacity: 0.96; } /* 6/24 кадра */
29.166% { opacity: 0.95; } /* 7/24 кадра */
33.333% { opacity: 0.97; } /* 8/24 кадра */
37.5% { opacity: 0.93; } /* 9/24 кадра */
41.666% { opacity: 0.96; } /* 10/24 кадра */
45.833% { opacity: 0.95; } /* 11/24 кадра */
50% { opacity: 0.97; } /* 12/24 кадра */
54.166% { opacity: 0.94; } /* 13/24 кадра */
58.333% { opacity: 0.96; } /* 14/24 кадра */
62.5% { opacity: 0.95; } /* 15/24 кадра */
66.666% { opacity: 0.97; } /* 16/24 кадра */
70.833% { opacity: 0.93; } /* 17/24 кадра */
75% { opacity: 0.95; } /* 18/24 кадра */
79.166% { opacity: 0.96; } /* 19/24 кадра */
83.333% { opacity: 0.94; } /* 20/24 кадра */
87.5% { opacity: 0.97; } /* 21/24 кадра */
91.666% { opacity: 0.95; } /* 22/24 кадра */
95.833% { opacity: 0.96; } /* 23/24 кадра */
}
@keyframes noise {
0% { background-position: 0 0; }
100% { background-position: 256px 256px; }
}
/* Эффект низкого FPS и ограниченной палитры */
.fps-24 {
animation-duration: 0.041666s; /* 24 FPS */
animation-timing-function: steps(1, end);
}
/* Пиксельный эффект для 16-битной графики */
.pixel-grid {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image:
linear-gradient(rgba(0, 16, 0, 0.1) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 16, 0, 0.1) 1px, transparent 1px);
background-size: 4px 4px;
pointer-events: none;
z-index: $z-scanline;
}
/* Упрощённый эффект виньетирования для 16-бит */
.vignette-16bit {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-shadow:
inset 0 0 40px #000,
inset 0 0 60px rgba(0, 32, 0, 0.5),
inset 0 0 80px #000;
pointer-events: none;
z-index: $z-main;
}
/* Мерцание (оптимизированное под 24 FPS) */
.crt-fallout {
animation: flicker 1s infinite;
}
/* Оптимизация производительности */
.crt-fallout * {
will-change: transform, opacity;
backface-visibility: hidden;
}

24
pipboyUI/src/styles/settings.scss

@ -0,0 +1,24 @@
$deep_g: 255; //63 - 16bit, 255 - 24bit
$deep_rb: 255; //31 - 16bit, 255- 24bit
@function r($v) {
@return ($v/255) * $deep_rb;
}
@function g($v) {
@return ($v/255) * $deep_g;
}
@function b($v) {
@return ($v/255) * $deep_rb;
}
@function piprgb($rv, $gv, $bv) {
@return rgb(r($rv), g($gv), b($bv));
}
@function piprgba($rv, $gv, $bv, $av) {
@return rgba(r($rv), g($gv), b($bv), $av);
}
$primary-color: rgb(0, g(242), 0);
$secondary-color: rgba(0, g(242), 0, 30%);//rgba(0 242 0 / 30%);

10
readme.md

@ -0,0 +1,10 @@
display connect
TFT Pin Description Raspberry Pi Pin Pin Number
VDD Power (VCC) 5V or 3.3V Pin 2 or Pin 1
GND Ground Ground Pin 6
CS Chip Select (SPI) GPIO 8 Pin 24
RST Reset GPIO 17 Pin 11
D/C Data/Command (SPI) GPIO 25 Pin 22
SDI Serial Data In (MOSI) GPIO 10 Pin 19
SCK Serial Clock (SPI) GPIO 11 Pin 23
BL Backlight 5V or GPIO 27 Pin 2 or Pin 13
Loading…
Cancel
Save