1
Computer Graphics
Marco Tarini Università dell’Insubria
Facoltà di Scienze MFN di Varese Corso di Laurea in Informatica Anno Accademico 2012/13
Lezione Lezione Lezione
Lezione 15 15 15 bis 15 bis bis bis:::: display lists
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 2 / 1 3 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Display Lists
• Codice (es. in C++) che fa rendering:
mix di
– istruzioni openGL che mandano primitive – comandi vari
• (cicli, guardie...)
• Idea:
– la prima volta,
registrare tutte le primitive e i comandi in una struttura (in RAM);
le volte successive mandare solo le primitive (senza comandi intermedi)
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 2 / 1 3 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Display Lists
• Esempio di codice
sedia = glGenLists( 1 );
glNewList( sedia, GL_COMPILE );
... /* qui tutto il rendering ... dell oggetto “sedia" */
glEndList();
/* quando la voglio richiamare: */
glCallList( sedia );
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 2 / 1 3 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Colli di bottiglia...
F ram m enti & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti in te rp o la ti in te rp o la ti in te rp o la ti in te rp o la ti Ver ti c i & l o ro a ttr ib u ti & l o ro a ttr ib u ti & l o ro a ttr ib u ti & l o ro a ttr ib u ti
Screen buffer Ver ti c i por iettati & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti co m p u ta ti co m p u ta ti co m p u ta ti co m p u ta ti
rasterizer triangoli set-
up rasterizer segmenti set-
up rasterizer
punti set-
up
c om put az ioni per v er tic e c om put az ioni per f ram m ent o
Qui? Allora applicazione
“transofrm limited”
(o “gemoetry limited”)
QUI?
Allora applicazione
“fill limited”
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 2 / 1 3 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a
Può essere anche la comunicazione!
F ram m enti & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti in te rp o la ti in te rp o la ti in te rp o la ti in te rp o la ti Ver ti c i & l o ro a ttr ib u ti & l o ro a ttr ib u ti & l o ro a ttr ib u ti & l o ro a ttr ib u ti
Screen buffer Ver ti c i por iettati & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti & a ttr ib u ti co m p u ta ti co m p u ta ti co m p u ta ti co m p u ta ti
rasterizer triangoli set-
up rasterizer segmenti set-
up rasterizer
punti set-
up
c om put az ioni per v er tic e c om put az ioni per f ram m ent o
collo di bottiglia qui?
applicazione BUS LIMITED (o BANDWIDTH LIMITED)
M a r c o T a r i n i ‧ C o m p u t e r G r a p h i c s ‧ 2 0 1 2 / 1 3 ‧ U n i v e r s i t à d e l l ’ I n s u b r i a