Skip to content

Commit

Permalink
Section about video optimizations
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Earnshaw <[email protected]>
  • Loading branch information
nearnshaw authored Dec 4, 2024
1 parent 632b553 commit d146838
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions content/creator/sdk7/media/video-playing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,21 @@ In all cases, you'll need:
- A [material]({{< ref "/content/creator/sdk7/3d-essentials/materials.md" >}}) with a A `VideoTexture` assigned to its texture
- A `VideoPlayer` component to control the state of the video.

{{< hint warning >}}
**📔 Note**: Keep in mind that streaming video demands a significant effort from the player's machine. For this reason, we recommend never having more than one video stream displayed at a time per scene. Videos are also not played if the player is standing on a different scene. Also avoid streaming videos that are in very high resolution, don't use anything above _HD_.
## Performance considerations

It's also ideal to play videos on Basic (unlit) materials, to reduce the performance load.
{{< /hint >}}
Keep in mind that streaming video demands a significant effort from the player's machine. It's recommended to avoid playing more than one video at a time.

If too many videos are playing at the same time in your scene, some will be paused by the engine. The priority is determined based on proximity to the player, direction of the camera and size of the screen. The maximum amount of simultaneous videos depends on the player's quality settings.

- Low: 1
- Medium: 5
- High: 10

We also recommend starting to play the video when the player is near or performs an action to do that. Starting to play a video when your scene is loaded far in the horizon will unnecessarily affect performance while players visit neighboring scenes.

Also avoid streaming videos that are in very high resolution, don't use anything above _HD_.

It's also ideal to play videos on Basic (unlit) materials, to reduce the performance load, as is the case on all of the example snippets below.

## Show a video

Expand Down Expand Up @@ -149,7 +159,7 @@ Material.setBasicMaterial(screen, {
})
```

If you instead want to project a video onto a PBR material, keep in mind that the default properties make the video look rather opaque. You can enhance that by altering other properties of the material. Here are some recommended settings for the video to stand out more:
It's usually recommended to play videos on Basic unlit materials, as this is better for performance, but if you instead want to project a video onto a PBR material, keep in mind that the default properties make the video look rather opaque. You can enhance that by altering other properties of the material. Here are some recommended settings for the video to stand out more:

```ts
Material.setPbrMaterial(screen, {
Expand Down

0 comments on commit d146838

Please sign in to comment.