/Unity-WebCamTexture-WebGL-Sample

UnityのWebカメラ入力をWebGLビルドしたサンプルです。

Primary LanguageC#Apache License 2.0Apache-2.0

Unity-WebCamTexture-WebGL-Sample

UnityのWebカメラ入力をWebGLビルドしたサンプルです。

Demo

動作確認用ページは以下。
https://kazuhito00.github.io/Unity-WebCamTexture-WebGL-Sample/WebGL-Build

Requirement

  • Unity 2020.1.6f1 or later

Memo

WebGLビルドをGithub Pagesにホストする際には無圧縮でビルドする
[Edit] -> [Project Setting...] -> [Player]

[HTML5]タブ

[Publishing Settings] -> [Compression Format]
[Disabled]に変更

映像が上下もしくは左右反転している場合

Plane>Transform>Scaleの値をマイナスにして反転させる。

映像が暗い場合

ProjectウィンドウのAssetフォルダ内で右クリックしてCreate>Materialを選択。
作成したマテリアルを選択し、Inspectorビュー>Shader>Unlit/Textureに変更。
Planeに適用する。

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

Unity-WebCamTexture-WebGL-Sample is under Apache-2.0 License.