Media Extension
Orillusion
provides the @orillusion/media-extention extension package to support multimedia, enabling easy loading and display of images, videos and audios, as well as providing corresponding processing capabilities. Please note that it needs to be installed separately, and the usage method after installation is similar to that of ordinary textures, materials and components.
Installation
Same as the engine installation, we can import physic plugins through two methods: NPM
and CDN
linking:
1. Install by NPM
npm install @orillusion/core --save
npm install @orillusion/media-extention --save
import { Engine3D } from "@orillusion/core"
import { VideoMaterial } from "@orillusion/media-extention"
2. Import via CDN
Links
We recommend using the ESModule
build version:
<script type="module">
import { Engine3D } from "https://unpkg.com/@orillusion/core/dist/orillusion.es.js"
import { VideoMaterial } from "https://unpkg.com/@orillusion/media-extention/dist/media.es.js"
</script>
Or load the UMD
version through <script>
tag, and get the VideoMaterial
module from the global Orillusion
variable:
<script src="https://unpkg.com/@orillusion/core/orillusion.umd.js"></script>
<script src="https://unpkg.com/@orillusion/media-extention/dist/media.umd.js"></script>
<script>
const {Engine3D, VideoMaterial} = Orillusion
</script>
Media Material
Currently, media-extention supports the following types of materials:
Material | Description |
---|---|
ImageMaterial | Base material that does not calculate lighting and only renders through Image pixel colors |
VideoMaterial | Base material that does not calculate lighting and only renders through the color of Video pixels |
ChromaKeyMaterial | Does not calculate lighting, only renders the base material through Video pixel colors, and filters the background color |
Audio Components
media-extention also supports the following common audio components:
Component | Description |
---|---|
AudioListener | Virtual audio listener, used in conjunction PositionAudio or StaticAudio |
StaticAudio | non-positional audio,volume level does not vary depending on the position of the monitor |
PositionAudio | position based audio,volume varying based on the relative position of the monitor |