Перейти к содержимому

3Dvibe64 - Gouraud Shading - Commodore 64 3D Engine

Commodore Computer Blog

0:00 / 0:00

3Dvibe64 - Gouraud Shading - Commodore 64 3D Engine

102 просмотра · 2 недели назад
Commodore Computer Blog
138 подписчиков
102 просмотра · 2 недели назад
https://github.com/Librologica/3Dvibe64 🇮🇹 La demo mostra un esperimento di grafica 3D in tempo reale su architettura C=64 con CPU espansa. L’esecuzione utilizza una CPU accelerata a 64 MHz. La cattura è stata realizzata tramite una build sperimentale di VICE capace di simulare le frequenze CPU del C64 Ultimate reale mantenendo invariato il timing video del VIC-II. Le prestazioni mostrate si riferiscono quindi a questa configurazione accelerata e non al C64 originale a 1 MHz. La registrazione proviene inoltre dall’emulatore e non direttamente dall’hardware reale. Il rendering utilizza Gouraud shading con normali mediate, interpolando l’illuminazione tra i vertici per rendere visivamente più morbide le superfici delle navette low-poly senza alterarne geometria e silhouette. Le gradazioni luminose vengono ottenute attraverso ordered dithering, con 33 livelli applicati alle navette tramite una matrice Bayer 4×4 ancorata allo schermo. Lo shading include inoltre una stabilizzazione temporale che attenua le variazioni luminose troppo brusche, mantenendo uno stato indipendente per ciascuna navetta. Il terreno utilizza una tecnica 2,5D di tipo Voxel Space basata su una heightmap renderizzata a colonne, alla quale viene applicato anche il Gouraud shading. L’illuminazione viene calcolata a partire dalle pendenze del terreno, con interpolazione bilineare della luce e interpolazione lungo le colonne durante il rendering. Le superfici delle mesh possono utilizzare materiali differenti per ogni faccia, con parametri indipendenti per risposta alla luce e riflettività. Le facce posteriori mantengono inoltre una colorazione distinta. Terreno e mesh poligonali vengono composti nello stesso framebuffer multicolor, affrontando direttamente i vincoli cromatici condivisi delle celle grafiche del VIC-II. Le due navette riutilizzano la stessa geometria, mentre animazione, orientamento e storia temporale dell’illuminazione vengono gestiti separatamente per ciascuna istanza. Circa 30.000 righe di codice Assembly. 🇬🇧 The demo shows a real-time 3D graphics experiment on an expanded C=64 architecture. The demo runs with the CPU accelerated to 64 MHz. The footage was captured using an experimental build of VICE capable of simulating the CPU frequencies of the real C64 Ultimate while preserving the original VIC-II video timing. The performance shown therefore refers to this accelerated configuration rather than to the original 1 MHz C64. The footage was also captured from the emulator rather than directly from real hardware. The renderer uses Gouraud shading with averaged normals, interpolating lighting across vertices to visually smooth the surfaces of the low-poly spacecraft without altering their geometry or silhouette. Lighting gradients are produced through ordered dithering, providing 33 intensity levels on the spacecraft using a screen-anchored 4×4 Bayer matrix. The shading system also includes temporal stabilization to reduce abrupt lighting changes, with an independent state maintained for each spacecraft. The terrain is rendered using a 2.5D Voxel Space-style technique based on a column-rendered heightmap, with Gouraud shading applied to it as well. Lighting is derived from terrain slopes, with bilinear light interpolation and additional interpolation along the rendered columns. Mesh surfaces can use different materials on each face, with independently adjustable lighting response and reflectivity. Back-facing surfaces also retain a distinct coloration. Terrain and polygonal meshes are composited inside the same multicolor framebuffer, while handling the shared color constraints imposed by VIC-II graphics cells. Both spacecraft reuse the same geometry, while animation, orientation and temporal lighting history are maintained independently for each instance. Approximately 30,000 lines of Assembly code.