Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Clean up depth and stencil buffers

Aperta
#7,325 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
cpp

Direzione di ricerca

Inizia in gropengldraw.cpp nei siti di creazione citati intorno alle righe 165-181, 274-315 e 533-559, quindi traccia gli usi elencati di depth e stencil attraverso i percorsi di rendering e shader. Scegli e convalida una strategia di pulizia, rimuovi solo i buffer ridondanti e conferma che il rendering, le letture di depth e le operazioni di stencil continuino a funzionare senza lo storage sprecato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

cleanup discussion graphics opengl

FSO keeps a whole bunch of partially redundant or unused render buffers, which should be tidied up to not waste storage and bandwidth.
Notably we have:

Type Storage Format Attachment Type Usage Created in
Position Texture 16-bit float, compressed z Color Attachment (G-Buffer) MSAA, deferred shading, soft particles gropengldraw.cpp, L165-181
Depth Component Texture 24-bit implementation defined Depth Attachment Depth testing, (volumetric) nebula depth fogging, post-proc depth, lightshafts, decals, distortions gropengldraw.cpp, L295-310
Cockpit Depth Component Texture 24-bit implementation defined Depth Attachment Depth testing in cockpit pass gropengldraw.cpp, L274-292
Stencil Buffer 24-bit implementation defined (depth) + 8-bit implementation defined (stencil) non-attached Renderbuffer likely none (possibly some stencil purpose, but I'd imagine it should be attached to that then) gropengldraw.cpp, L313-315
Back Depth Component Texture 24-bit implementation defined Depth Attachment likely none, can serve as depth testing in immediate rendering if back stencil buffer is disabled gropengldraw.cpp, L533-550
Back Stencil Buffer 24-bit implementation defined (depth) + 8-bit implementation defined (stencil) Depth-Stencil attached Renderbuffer Depth testing in immediate rendering (i.e. techroom) and stencil operations gropengldraw.cpp, L556-559

That's 6 depth buffers, 2 of which likely do nothing at all, and with usages all over the place when we likely should really be using either the position texture or the depth component texture for everything.

I suppose there's three different strategies to solving this:

  1. Remove all depth-attachment-based buffers, and use the renderbuffers instead, and create an additional renderbuffer for the cockpit pass. This implies changing the shader uses of the depth texture to the position texture, since you cannot read from renderbuffers from shaders. Likely the most performant option.
  2. Remove all renderbuffer-based buffers. This requires adding stencil bits to the depth textures and attaching them. That in turn likely means we'll need to either change the reads from the depth texture to only pull from the depth bits, or use the position texture instead.
  3. Keep the current setup, and change the renderbuffers to only store 8-bit stencil data and no depth data. And also properly attach the stencil buffer for the main scene. By far the least invasive change.
Lingua principale
C++
Stelle
488
Fork
184
Merge medio
2g 9h
PR unite (30g)
39

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scp-fs2open/fs2open.github.com

Tutte le issue di scp-fs2open/fs2open.github.com

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.