Top Related Projects
GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
Quick Overview
Unity Render Streaming is an open-source project that enables real-time streaming of Unity content to web browsers. It utilizes WebRTC technology to achieve low-latency streaming of both video and audio, making it suitable for interactive applications and remote rendering scenarios.
Pros
- Low-latency streaming of Unity content to web browsers
- Cross-platform support, including mobile devices
- Enables remote rendering and interactive applications
- Integrates well with Unity's existing rendering pipeline
Cons
- Requires a good network connection for optimal performance
- May have compatibility issues with older browsers or devices
- Learning curve for developers new to WebRTC technology
- Limited documentation and examples compared to some other Unity packages
Code Examples
- Setting up a render streaming connection:
using Unity.RenderStreaming;
public class StreamingSetup : MonoBehaviour
{
private RenderStreaming renderStreaming;
void Start()
{
renderStreaming = GetComponent<RenderStreaming>();
renderStreaming.Run(HandleOnStarted);
}
void HandleOnStarted(string connectionId)
{
Debug.Log($"Streaming started. Connection ID: {connectionId}");
}
}
- Adding a video stream:
using Unity.RenderStreaming;
using UnityEngine.UI;
public class VideoStreamer : MonoBehaviour
{
[SerializeField] private RawImage displayImage;
private VideoStreamSender streamSender;
void Start()
{
streamSender = GetComponent<VideoStreamSender>();
streamSender.OnStartedStream += HandleStreamStarted;
}
void HandleStreamStarted(RenderTexture texture)
{
displayImage.texture = texture;
}
}
- Handling input from the remote client:
using Unity.RenderStreaming.InputSystem;
public class RemoteInput : MonoBehaviour
{
private RemoteInputReceiver inputReceiver;
void Start()
{
inputReceiver = GetComponent<RemoteInputReceiver>();
inputReceiver.OnDeviceChange += HandleDeviceChange;
}
void HandleDeviceChange(InputDevice device, InputDeviceChange change)
{
if (change == InputDeviceChange.Added)
{
Debug.Log($"New input device connected: {device.name}");
}
}
}
Getting Started
- Install the Unity Render Streaming package via the Package Manager.
- Add the RenderStreaming component to a GameObject in your scene.
- Configure the Signaling Settings in the RenderStreaming component.
- Add StreamingSender components for video/audio you want to stream.
- Build and run your Unity project.
- Open the provided web application to connect and view the stream.
For detailed setup instructions, refer to the official documentation on the GitHub repository.
Competitor Comparisons
GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
Pros of Moonlight-qt
- Cross-platform support for Windows, macOS, and Linux
- Optimized for low-latency game streaming
- Supports a wide range of NVIDIA GPUs
Cons of Moonlight-qt
- Limited to NVIDIA GameStream technology
- Requires a compatible NVIDIA GPU on the host machine
- Less flexibility for custom rendering pipelines
Code Comparison
UnityRenderStreaming:
public class RenderStreaming : MonoBehaviour
{
[SerializeField] private RenderStreamingSettings settings;
private RTCPeerConnection peerConnection;
// ...
}
Moonlight-qt:
class Session : public QObject
{
Q_OBJECT
public:
explicit Session(QObject *parent = nullptr);
// ...
};
UnityRenderStreaming focuses on integrating streaming capabilities within the Unity engine, allowing for more customization of rendering and streaming processes. It's designed to work with various platforms and doesn't require specific GPU hardware.
Moonlight-qt, on the other hand, is tailored for game streaming using NVIDIA's GameStream protocol. It offers a more streamlined setup for supported hardware but is limited to NVIDIA GPUs.
Both projects aim to provide low-latency streaming solutions, but they cater to different use cases and have distinct hardware requirements.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Unity Render Streaming
Unity Render Streaming is a solution that provides Unity's high quality rendering abilities via browser. It's designed to meet the needs of tasks like viewing car configurators or architectural models on mobile devices. This solution's streaming technology takes advantage of WebRTC, and developers can even use the WebRTC package to create their own unique solutions.
Requirements
Please see Requirements section.
License
-
com.unity.renderstreaming
- LICENSE.md -
com.unity.template.renderstreaming-hd
- LICENSE.md -
com.unity.template.renderstreaming-rtx
- LICENSE.md
Repository Structure
<root>
âââ BuildScripts~ // Build scripts for CI system
âââ com.unity.renderstreaming // Unity Render Streaming Package
âââ com.unity.template.renderstreaming-hd // HDRP template
âââ com.unity.template.renderstreaming-rtx // HDRP Raytracing template
âââ RenderStreaming~ // Sample project for package
âââ WebApp // Web application for signaling
Roadmap
Version | Focus | When |
---|---|---|
1.0.0-preview | - First release | Aug 2019 |
1.1.0-preview | - Upgrade HDRP version 5.16 | Sep 2019 |
1.2.0-preview | - Unity 2019.3 support | Feb 2020 |
2.0.0-preview | - Multi camera - DirectX12 (DXR) Support | Apr 2020 |
2.1.0-preview | - Unity 2019.4 support - Add bitrate control sample | Aug 2020 |
2.2.0-preview | - Add video receiver - HDRP/URP on Linux support | Nov 2020 |
3.0.0-preview | - iOS platform support - AR Foundation sample | Mar 2021 |
3.1.0-exp.1 | - Android platform support | Jun 2021 |
3.1.0-exp.2 | - Audio Renderer support - Multiplay sample - M1 Mac support | Dec 2021 |
3.1.0-exp.3 | - Fix bugs | Feb 2022 |
3.1.0-exp.4 | - Streaming settings API - Unity 2022.1 support - Remove Unity 2019.4 from support list | Oct 2022 |
3.1.0-exp.5 | - Fix bugs | Jan 2023 |
3.1.0-exp.6 | - Streaming Settings Window - Auto Configuration - Command line option | Feb 2023 |
3.1.0-exp.7 | - Fix bugs | Jul 2023 |
3.1.0-exp.8 | - Fix bugs | Nov 2023 |
FAQ
Please read this page and Unity Forum.
Contributors
Top Related Projects
GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot