Images, sound and movie formats

This tutorial shows what type of image, sound and movie formats can be used in X3DOM and what are the features and restrictions.

Images

You can use PNG, JPEG or GIF to encode your static Texture data. JPG has a low memory profile but has a lossy compression and it does not support alpha channels. PNG compression is lossless and can handle alpha. GIF is also lossless and has alpha.

General: If you do not need an alpha channel and the content does not have hard edges (e.g. Text) use JPG. Otherwise use PNG. You should really not use GIF anymore. PNG is more flexible for future content (e.g. 16-bit channels).

<ImageTexture url=’foo.jpg’ />

Sound

You can use WAV, MP3 and OGG for sound sources. All UA should support WAV. If you would like to use compressed formats (e.g. MP3 or OGG) provide alternative encodings in your AudioClip node.

<AudioClip url=’”foo.wav”,”foo.ogg”‘ />

Movies

There is right now no single movie file supported by all user agents. Use the X3DOM formats exmaple to check your browser.

The best solution right now is to encode your content as MP4 and OGV movie and provide alternative sources in your MovieTexture node.

<MovieTexture url=’”foo.mp4″,”foo.ogv”‘ />