Upload
simone-viard
View
105
Download
1
Tags:
Embed Size (px)
Citation preview
1
Quakelight : le making of
Julien FrelatChef de projetInnoveWare Solutions
Code Session : RIA309
2
Agenda
Le projet QuakelightAffichage bitmapGestion sonoreLe futur avec Silverlight 3 ?
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
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)
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
6
Affichage bitmap optimisé en Silverlight 2
démo
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)
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);}
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
10
Lecture asynchrone de samples
Fichier audio MP3 (N samples)Sample 1 Sample 2 ... Sample N Sample 1
GetSampleAsync GetSampleAsync GetSampleAsync GetSampleAsync GetSampleAsync
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 ?
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
13
Quakelight
démo
14
Questions / Réponses
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