1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

15
1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309

Transcript of 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

Page 1: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

1

Quakelight : le making of

Julien FrelatChef de projetInnoveWare Solutions

Code Session : RIA309

Page 2: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

2

Agenda

Le projet QuakelightAffichage bitmapGestion sonoreLe futur avec Silverlight 3 ?

Page 3: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

3

Le projet QuakelightPrésentation

Portage du jeu “Quake” en Silverlight 2Jeu 3D open-sourceChallenge favori sur les nouvelles plateformesInspiré par une version Flash

ObjectifsAffichage bitmap fluide du moteur 3DSpatialisation des sons (effet surround)Utiliser Silverlight 2 avec ses limitations

Page 4: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

4

Affichage bitmap

Limitations de Silverlight 2JPEG ou PNG, pas de format brut

Techniques existantes1 pixel = 1 rectangleEncodage PNG sans compression

La solution InnoveWare : PNG wrapperPré-encodage et organisation mémoire optimiséeHack Silverlight 2 : pas de CRC sur les donnéesEncodage/décodage en 256 couleurs (PNG 8-bit)

Page 5: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

5

PNG wrapper

MemoryStream PNG pré-encodéeEntête PNG

(fixe) Largeur Hauteur Flags(PNG 8-bit)

Bloc PALETTE RGB(modifiable)

RGB(modifiable) ... RGB

(modifiable)Bloc IMAGE

(non compressé) Flags Ligne de pixels(modifiable)

CRC 0(hack)

... Flags ... CRC 0(hack)

... Flags Ligne de pixels(modifiable)

CRC 0(hack)

CRC IMAGE 0(hack)

Bloc FIN

Page 6: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

6

Affichage bitmap optimisé en Silverlight 2

démo

Page 7: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

7

Gestion sonore

Limitations de Silverlight 2Sons pré-encodés au format MP3Jouer un son en continu (délai)

Effets surround (3D)Effets sonores de mitraillageEffets sonores d’ambiance (musique continue)

Page 8: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

8

Effets surround et alternance

Utilisation de canaux pour limiter le nombre de sons MP3 à mixer simultanément

channels[x].media = new MediaElement();

Spatialiser les sonschannels[x].media.Volume = master_volume;channels[x].media.Balance = right_volume – left_volume;

Alterner des sons rapidementif (channels[x].media.CurrentState != MediaElementState.Playing

|| channels[x].looping){

channels[x].media.Stop();

parentCanvas.Children.Remove(channels[x].media);}

Page 9: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

9

Gestion sonore

Limitations de Silverlight 2Sons pré-encodés au format MP3Jouer un son en continu (délai)

Effets surround (3D)Effets sonores de mitraillageEffets sonores d’ambiance (musique continue)

Solution en cours d’étude : MediaStreamSourceLecture asynchrone de samples audio ou vidéowww.smoothhd.com

Page 10: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

10

Lecture asynchrone de samples

Fichier audio MP3 (N samples)Sample 1 Sample 2 ... Sample N Sample 1

GetSampleAsync GetSampleAsync GetSampleAsync GetSampleAsync GetSampleAsync

Page 11: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

11

Le futur avec Silverlight 3 ?

Améliorations graphiquesSupport natif de la 3DAccélération matérielle

Fonctionnalités souhaitéesAffichage bitmap (WriteableBitmap) ?Gestion sonore dynamique et en boucle ?

Page 12: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

12

Synthèse A retenir

Performances et potentiel de Silverlight pour les jeux vidéosTechniques avancées pour l’affichage bitmap et le son en Silverlight 2Promesses de Silverlight 3Pour plus d’informations : www.innoveware.com

Page 13: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

13

Quakelight

démo

Page 14: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

14

Questions / Réponses

Page 15: 1 Quakelight : le making of Julien Frelat Chef de projet InnoveWare Solutions Code Session : RIA309.

15

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED

OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Votre potentiel, notre passion TM