Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Changelog
All notable changes to com.unity.renderstreaming package will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.1.1] - 2019-09-14

- Fixed: Fix image links for documentation on Unity website

## [1.1.0] - 2019-09-13

- Added: Adding menu to download web app
- Changed: Upgrading input system to 0.9.4-preview
- Changed: Upgrading HDRP to 5.16.1-preview
- Changed: Adding keyboard event to reset camera position

## [1.0.0] - 2019-08-22

- Added: Eliminates the necessity of user interaction when installing an HDRP sample
- Added: Adding a check to automatically set HDRP render pipeline settings on initial setup
- Changed: Refactor RenderStreamingHDRPAutomator to use json instead of ScriptableObject
- Fixed: Blit Render Texture using customRender instead of beginCameraRendering

## [0.2.0] - 2019-07-30

- Changed: Removed the direct dependency to HDRP package
- Added: Added a unitypackage file containing an HDRP sample, and a menu editor to install it

## [0.1.0] - 2019-07-22

- Initial Release
- Added: Added a sample project which uses RenderStreaming tech.
  • Loading branch information
Unity Technologies committed Sep 19, 2019
0 parents commit fa4dd7b
Show file tree
Hide file tree
Showing 57 changed files with 1,061 additions and 0 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changelog
All notable changes to com.unity.renderstreaming package will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.1.1] - 2019-09-14

- Fixed: Fix image links for documentation on Unity website

## [1.1.0] - 2019-09-13

- Added: Adding menu to download web app
- Changed: Upgrading input system to 0.9.4-preview
- Changed: Upgrading HDRP to 5.16.1-preview
- Changed: Adding keyboard event to reset camera position

## [1.0.0] - 2019-08-22

- Added: Eliminates the necessity of user interaction when installing an HDRP sample
- Added: Adding a check to automatically set HDRP render pipeline settings on initial setup
- Changed: Refactor RenderStreamingHDRPAutomator to use json instead of ScriptableObject
- Fixed: Blit Render Texture using customRender instead of beginCameraRendering

## [0.2.0] - 2019-07-30

- Changed: Removed the direct dependency to HDRP package
- Added: Added a unitypackage file containing an HDRP sample, and a menu editor to install it

## [0.1.0] - 2019-07-22

- Initial Release
- Added: Added a sample project which uses RenderStreaming tech.
7 changes: 7 additions & 0 deletions CHANGELOG.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Documentation~/images/browser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/download_webapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/hdrp_sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/hdrp_unitypackage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/input_system_backend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/play_mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/show_preview_packages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/simplescene.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/webserver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions Documentation~/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# com.unity.renderstreaming

- [Japanese](./jp/index.md)

This package contains public APIs and project samples that are built on top of our [**Unity Render Streaming**](../../com.unity.template.renderstreaming/Documentation~/index.md).

Currently, there is one sample:

- HDRP.
> Importing this sample will automatically install and setup our HDRP sample assets along with the HDRP *(com.unity.render-pipelines.high-definition)* package.
## Simple Tutorial on Windows

1. Open an existing or create a new project
2. Click on the `Window` Menu and open `Package Manager`. Then, click on `Advanced` and make sure `Show preview packages` is checked

<img src="./images/show_preview_packages.png" width="480">

3. Make sure to search `All packages`, and type `RenderStreaming` in the text box.

<img src="./images/render_streaming_package.png" width="480">

4. Click `Install` on the bottom right.

5. If an input system dialog box appears, click `Yes`

<img src="./images/input_system_backend.png" width="360">

6. Click on `Import in project` to import the HDRP sample.
This will also automatically install the HDRP package *(com.unity.render-pipelines.high-definition)*.

<img src="./images/hdrp_sample.png" width="480" >

7. When this `Import Unity Package` dialog box appears, click `Import` to import all assets.

<img src="./images/hdrp_unitypackage.png" width="240" >

8. After all the import process has been finished, open `Assets/SimpleScene` in the Project View.

<img src="./images/simplescene.png" width="240" >

9. Click on `Edit/Render Streaming/Download web app` menu item to download our web server

<img src="./images/download_webapp.png" width="300" >

10. When the select download folder window appears, click on `Select Folder` to download the file to the default folder

<img src="./images/select_download_folder.png" width="240" >


11. After the download is finished and a new explorer window is opened, click on `webserver.exe` to start
Unity RenderStreaming web server.

<img src="./images/webserver.png" width="240">

12. Enter play mode in Unity

<img src="./images/play_mode.png" width="240">

13. Open your browser and type `localhost` on the URL bar. Then click on the play button in the middle.
The view in Unity should then appear on your browser.

<img src="./images/browser.png" width="240">


71 changes: 71 additions & 0 deletions Documentation~/jp/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# com.unity.renderstreaming

- [English](../index.md)

このパッケージには Unity の [**Unity Render Streaming**](../../../com.unity.template.renderstreaming/Documentation~/index.md) を基に作られた公開 API とサンプルプロジェクトが含まれます。

現在、1 つのサンプルがあります。

- HDRP.
> このサンプルをインポートすると、HDRP *(com.unity.render-pipelines.high-definition)* パッケージと Unity が提供している HDRP サンプルアセットのインストールと設定が自動的に行われます。
## Windows 向けの簡単なチュートリアル

1. 既存のプロジェクトを開きます。または、新しいプロジェクトを作成します。
2. `Window` メニューをクリックし、`Package Manager` を開きます。次に、`Advanced` をクリックして `Show preview packages` にチェックを入れます。

<img src="../images/show_preview_packages.png" width=480 align=center>

3. 検索のモードを `All packages` にして、テキストボックスに `RenderStreaming` と入力します。

<img src="../images/render_streaming_package.png" width=480 align=center>

4. 右下の `Install` をクリックします。

5. 入力システムに関するダイアログボックスが表示された場合は、`Yes` をクリックします。

<img src="../images/input_system_backend.png" width=360 align=center>

6. `Import in project` をクリックして HDRP サンプルをインポートします。
この操作によって、HDRP パッケージ *(com.unity.render-pipelines.high-definition)* が自動的にインストールされます。

<img src="../images/hdrp_sample.png" width=480 align=center>

7. 下図の `Import Unity Package` ダイアログボックスが表示されたら、`Import` をクリックしてすべてのアセットをインポートします。

<img src="../images/hdrp_unitypackage.png" width=240 align=center>

8. すべてのインポートプロセスが終わった後、Project ビューから `Assets/SimpleScene` を開きます。

<img src="../images/simplescene.png" width=240 align=center>

9. `Edit/Render Streaming/Download web app` メニューアイテムをクリックして、あらかじめ用意されているウェブサーバーをダウンロードします。

<img src="../images/download_webapp.png" width=300 align=center>

10. ダウンロード先フォルダーを選択するウィンドウが表示されたら、`Select Folder` をクリックしてデフォルトのフォルダーにファイルをダウンロードします。

<img src="../images/select_download_folder.png" width=240 align=center>


11. ダウンロードが終了して、エクスプローラーの新しいウィンドウが開いたら、`webserver.exe` をクリックして Unity RenderStreaming ウェブサーバーを起動します。

<img src="../images/webserver.png" width=240 align=center>

12. Unity で再生モードに入ります。

<img src="../images/play_mode.png" width=240 align=center>

13. ブラウザーを立ち上げ、URL バーに `localhost` と入力し、中央に表示されている再生ボタンをクリックします。
クリックすると、Unity のビューがブラウザーに表示されます。

<img src="../images/browser.png" width=240 align=center>









8 changes: 8 additions & 0 deletions Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Editor/IRequestJob.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using UnityEditor.PackageManager; //StatusCode

namespace Unity.RenderStreaming.Editor {

internal interface IRequestJob {
StatusCode Update();

}


} //namespace Unity.RenderStreaming.Editor
11 changes: 11 additions & 0 deletions Editor/IRequestJob.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions Editor/RenderStreamingMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
using System.Net;

namespace Unity.RenderStreaming.Editor
{
public static class RenderStreamingMenu
{
const string URLRoot = "https://github.com/Unity-Technologies/UnityRenderStreaming";
const string PathWebAppForMac = "releases/download/{0}/webserver";
const string PathWebAppForWin = "releases/download/{0}/webserver.exe";
const string PathWebAppSourceCode = "tree/release/{0}/WebApp";
const string PathWebAppDocumentation = "blob/release/{0}/Packages/com.unity.template.renderstreaming/Documentation~/en/webserver.md";

[MenuItem("Edit/Render Streaming/Download web app")]
static void DownloadWepApp()
{
RequestPackageVersion("com.unity.renderstreaming", (version) =>
{
#if UNITY_EDITOR_WIN
var url = System.IO.Path.Combine(URLRoot, string.Format(PathWebAppForWin, version));
#elif UNITY_EDITOR_OSX
var url = System.IO.Path.Combine(URLRoot, string.Format(PathWebAppForMac, version));
#endif
var client = new WebClient();
var filename = System.IO.Path.GetFileName(url);
var tmpFilePath = System.IO.Path.Combine(Application.temporaryCachePath, filename);

client.DownloadFileCompleted += (object sender, System.ComponentModel.AsyncCompletedEventArgs e) =>
{
EditorUtility.ClearProgressBar();

if (!System.IO.File.Exists(tmpFilePath))
{
Debug.LogErrorFormat("Download failed. url:{0}", url);
return;
}

var dstPath = EditorUtility.OpenFolderPanel("Select download folder", "", "");
if (string.IsNullOrEmpty(dstPath))
{
return;
}
dstPath = System.IO.Path.Combine(dstPath, filename);
if (System.IO.File.Exists(dstPath))
{
System.IO.File.Delete(dstPath);
}
System.IO.File.Move(tmpFilePath, dstPath);
EditorUtility.RevealInFinder(dstPath);
};
client.DownloadProgressChanged += (object sender, DownloadProgressChangedEventArgs e) =>
{
var progress = e.ProgressPercentage / 100f;
if(EditorUtility.DisplayCancelableProgressBar("Downloading", url, progress))
{
client.CancelAsync();
}
};
client.DownloadFileAsync(new System.Uri(url), tmpFilePath);
});
}

static void RequestPackageVersion(string packageName, System.Action<string> callback)
{
// request package list to get package version
RequestJobManager.CreateListRequest(false, true, (req) =>
{
var packageInfo = req.FindPackage(packageName);
if (null == packageInfo)
{
Debug.LogErrorFormat("Not found package \"{0}\"", packageName);
return;
}
callback(packageInfo.version);
}, null);
}

[MenuItem("Edit/Render Streaming/Show web app documentation")]
static void ShowWepAppDocumentation()
{
RequestPackageVersion("com.unity.renderstreaming", (version) =>
{
var pattern = @"\d+.\d+.\d+";
var result = System.Text.RegularExpressions.Regex.Match(version, pattern);
var url = System.IO.Path.Combine(URLRoot, string.Format(PathWebAppDocumentation, result.Value));
Application.OpenURL(url);
});
}
[MenuItem("Edit/Render Streaming/Show web app source code")]
static void ShowWepAppSourceCode()
{
RequestPackageVersion("com.unity.renderstreaming", (version) =>
{
var pattern = @"\d+.\d+.\d+";
var result = System.Text.RegularExpressions.Regex.Match(version, pattern);
var url = System.IO.Path.Combine(URLRoot, string.Format(PathWebAppSourceCode, result.Value));
Application.OpenURL(url);
});
}
}
}

11 changes: 11 additions & 0 deletions Editor/RenderStreamingMenu.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions Editor/RequestExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using UnityEditor.PackageManager.Requests; //ListRequest
using UnityEditor.PackageManager; //PackageCollection
using System.Collections.Generic; //IEnumerable


namespace Unity.RenderStreaming.Editor {

/// <summary>
/// An extension class to extend the functionalities of UnityEditor.PackageManager.Requests classes
/// </summary>
public static class RequestExtensions
{
/// <summary>
/// Find a PackageInfo which has the passed parameter
/// </summary>
/// <param name="listRequest">this Request<PackageCollection> object</param>
/// <param name="packageName">the package name</param>
/// <returns>The PackageInfo if found, otherwise null</returns>
///
public static PackageInfo FindPackage(this Request<PackageCollection> listRequest, string packageName) {
IEnumerable<PackageInfo> packageInfoCollection = listRequest.Result as IEnumerable<PackageInfo>;
if (null == packageInfoCollection) {
return null;
}

var enumerator = packageInfoCollection.GetEnumerator();
while (enumerator.MoveNext()) {
PackageInfo curInfo = enumerator.Current;
if (curInfo.name == packageName) {
return curInfo;
}
}

return null;
}
}

} //namespace Unity.RenderStreaming.Editor
11 changes: 11 additions & 0 deletions Editor/RequestExtensions.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Editor/RequestInfo.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fa4dd7b

Please sign in to comment.