From e12b4ffa449b24c86acb9cf4829282c06512d1c3 Mon Sep 17 00:00:00 2001 From: IzayoiJiichan Date: Sun, 15 Mar 2020 00:00:00 +0900 Subject: [PATCH] version 0.8.0 --- CHANGELOG.md | 4 + Documentation~/UniVGO/Installation.ja.md | 11 +- Documentation~/UniVGO/Installation.md | 10 +- Documentation~/UniVGO/Usage.ja.md | 40 ++- Documentation~/UniVGO/Usage.md | 40 ++- .../VGO/instructions/schema.json.materials.md | 50 ++- .../VGO/instructions/schema.json.md | 14 +- .../VGO/instructions/schema.json.nodes.md | 12 +- .../0.6/schema/VGO_materials.schema.json | 11 + .../schema/VGO_materials_particle.schema.json | 132 ++++++++ .../schema/VGO_materials_skybox.schema.json | 99 ++++++ .../0.6/schema/VGO_nodes.schema.json | 28 ++ .../schema/VRMC_materials_mtoon.schema.json | 212 ++++++++++++ .../schema/materials.extensions.schema.json | 22 ++ .../0.6/schema/node.vgo.collider.schema.json | 51 +++ .../0.6/schema/node.vgo.colliders.schema.json | 8 + .../schema/node.vgo.gameobject.schema.json | 25 ++ .../0.6/schema/node.vgo.light.schema.json | 110 ++++++ .../node.vgo.particleSystem.schema.json | 75 +++++ .../0.6/schema/node.vgo.rigidbody.schema.json | 47 +++ .../0.6/schema/node.vgo.skybox.schema.json | 9 + .../0.6/schema/node.vgo.transform.schema.json | 33 ++ .../0.6/schema/nodes.extensions.schema.json | 10 + .../0.6/schema/vgo.animationCurve.schema.json | 33 ++ .../0.6/schema/vgo.gradient.schema.json | 27 ++ .../schema/vgo.gradientAlphakey.schema.json | 12 + .../schema/vgo.gradientColorKey.schema.json | 15 + .../0.6/schema/vgo.keyframe.schema.json | 33 ++ .../0.6/schema/vgo.meta.schema.json | 19 ++ .../0.6/schema/vgo.physicMaterial.schema.json | 35 ++ .../0.6/schema/vgo.ps.burst.schema.json | 25 ++ .../schema/vgo.ps.collisionModule.schema.json | 4 + .../vgo.ps.colorBySpeedModule.schema.json | 25 ++ ...vgo.ps.colorOverLifetimeModule.schema.json | 16 + .../vgo.ps.customDataModule.schema.json | 4 + .../0.6/schema/vgo.ps.emission.module.json | 29 ++ .../schema/vgo.ps.emissionModule.schema.json | 40 +++ .../vgo.ps.externalForcesModule.schema.json | 30 ++ ...vgo.ps.forceOverLifetimeModule.schema.json | 50 +++ .../vgo.ps.inheritVelocityModule.schema.json | 26 ++ .../schema/vgo.ps.lightsModule.schema.json | 54 +++ ...imitVelocityOverLifetimeModule.schema.json | 69 ++++ .../0.6/schema/vgo.ps.main.module.json | 140 ++++++++ .../0.6/schema/vgo.ps.mainModule.schema.json | 232 +++++++++++++ .../0.6/schema/vgo.ps.minMaxCurve.schema.json | 48 +++ .../schema/vgo.ps.minMaxGradient.schema.json | 64 ++++ .../0.6/schema/vgo.ps.noiseModule.schema.json | 129 +++++++ .../0.6/schema/vgo.ps.renderer.schema.json | 161 +++++++++ .../vgo.ps.rotationBySpeedModule.schema.json | 51 +++ ....ps.rotationOverLifetimeModule.schema.json | 42 +++ .../0.6/schema/vgo.ps.shapeModule.schema.json | 215 ++++++++++++ .../vgo.ps.sizeBySpeedModule.schema.json | 51 +++ .../vgo.ps.sizeOverLifetimeModule.schema.json | 42 +++ .../vgo.ps.subEmittersModule.schema.json | 4 + ...ps.textureSheetAnimationModule.schema.json | 4 + .../0.6/schema/vgo.ps.trailModule.schema.json | 95 ++++++ .../schema/vgo.ps.triggerModule.schema.json | 4 + ....ps.velocityOverLifetimeModule.schema.json | 127 +++++++ .../0.6/schema/vgo.right.schema.json | 39 +++ .../specification/0.6/schema/vgo.schema.json | 13 + README.ja.md | 10 +- README.md | 10 +- .../Runtime/Format/glTF.partial.cs | 5 + UniGLTFforUniVgo/Runtime/IO/gltfExporter.cs | 40 ++- .../Materials/VGO_materials_skybox.cs | 172 ++++++++++ .../Materials/VGO_materials_skybox.cs.meta | 11 + .../Materials/glTFMaterial_extensions.cs | 4 + .../Schema/Extensions/Nodes/VGO_Skybox.cs | 78 +++++ .../Extensions/Nodes/VGO_Skybox.cs.meta | 11 + .../Schema/Extensions/Nodes/VGO_nodes.cs | 4 + .../Serialization/VgoContractResolver.cs | 10 + UniSkybox.meta | 8 + UniSkybox/LICENSE.md | 21 ++ UniSkybox/LICENSE.md.meta | 7 + UniSkybox/Runtime.meta | 8 + UniSkybox/Runtime/Enums.cs | 46 +++ UniSkybox/Runtime/Enums.cs.meta | 11 + UniSkybox/Runtime/Skybox6SidedDefinition.cs | 43 +++ .../Runtime/Skybox6SidedDefinition.cs.meta | 11 + UniSkybox/Runtime/SkyboxCubemapDefinition.cs | 28 ++ .../Runtime/SkyboxCubemapDefinition.cs.meta | 11 + .../Runtime/SkyboxPanoramicDefinition.cs | 40 +++ .../Runtime/SkyboxPanoramicDefinition.cs.meta | 11 + .../Runtime/SkyboxProceduralDefinition.cs | 39 +++ .../SkyboxProceduralDefinition.cs.meta | 11 + UniSkybox/Runtime/UniSkybox.asmdef | 3 + UniSkybox/Runtime/UniSkybox.asmdef.meta | 7 + UniSkybox/Runtime/Utils.cs | 145 ++++++++ UniSkybox/Runtime/Utils.cs.meta | 11 + UniSkybox/Runtime/UtilsGetter.cs | 317 ++++++++++++++++++ UniSkybox/Runtime/UtilsGetter.cs.meta | 11 + UniSkybox/Runtime/UtilsSetter.cs | 245 ++++++++++++++ UniSkybox/Runtime/UtilsSetter.cs.meta | 11 + UniVgo/Runtime/IO/VgoExporter.cs | 41 +++ UniVgo/Runtime/IO/VgoImporter.cs | 48 +++ UniVgo/Runtime/IO/VgoMaterialExporter.cs | 113 ++++++- UniVgo/Runtime/IO/VgoMaterialImporter.cs | 108 +++++- UniVgo/Runtime/IO/VgoShaderStore.cs | 81 +++++ UniVgo/Runtime/UniVgo.asmdef | 1 + UniVgo/Runtime/Utils/ShaderName.cs | 14 +- UniVgo/Runtime/Vgo.cs | 2 +- UniVgo/Runtime/VgoVersion.cs | 4 +- package.json | 3 +- 103 files changed, 4805 insertions(+), 70 deletions(-) create mode 100644 Documentation~/VGO/specification/0.6/schema/VGO_materials.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/VGO_materials_particle.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/VGO_materials_skybox.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/VGO_nodes.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/VRMC_materials_mtoon.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/materials.extensions.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.collider.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.colliders.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.gameobject.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.light.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.particleSystem.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.rigidbody.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.skybox.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/node.vgo.transform.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/nodes.extensions.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.animationCurve.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.gradient.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.gradientAlphakey.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.gradientColorKey.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.keyframe.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.meta.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.physicMaterial.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.burst.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.collisionModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.colorBySpeedModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.colorOverLifetimeModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.customDataModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.emission.module.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.emissionModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.externalForcesModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.forceOverLifetimeModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.inheritVelocityModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.lightsModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.limitVelocityOverLifetimeModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.main.module.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.mainModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxCurve.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxGradient.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.noiseModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.renderer.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationBySpeedModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationOverLifetimeModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.shapeModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeBySpeedModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeOverLifetimeModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.subEmittersModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.textureSheetAnimationModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.trailModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.triggerModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.ps.velocityOverLifetimeModule.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.right.schema.json create mode 100644 Documentation~/VGO/specification/0.6/schema/vgo.schema.json create mode 100644 UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs create mode 100644 UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs.meta create mode 100644 UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs create mode 100644 UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs.meta create mode 100644 UniSkybox.meta create mode 100644 UniSkybox/LICENSE.md create mode 100644 UniSkybox/LICENSE.md.meta create mode 100644 UniSkybox/Runtime.meta create mode 100644 UniSkybox/Runtime/Enums.cs create mode 100644 UniSkybox/Runtime/Enums.cs.meta create mode 100644 UniSkybox/Runtime/Skybox6SidedDefinition.cs create mode 100644 UniSkybox/Runtime/Skybox6SidedDefinition.cs.meta create mode 100644 UniSkybox/Runtime/SkyboxCubemapDefinition.cs create mode 100644 UniSkybox/Runtime/SkyboxCubemapDefinition.cs.meta create mode 100644 UniSkybox/Runtime/SkyboxPanoramicDefinition.cs create mode 100644 UniSkybox/Runtime/SkyboxPanoramicDefinition.cs.meta create mode 100644 UniSkybox/Runtime/SkyboxProceduralDefinition.cs create mode 100644 UniSkybox/Runtime/SkyboxProceduralDefinition.cs.meta create mode 100644 UniSkybox/Runtime/UniSkybox.asmdef create mode 100644 UniSkybox/Runtime/UniSkybox.asmdef.meta create mode 100644 UniSkybox/Runtime/Utils.cs create mode 100644 UniSkybox/Runtime/Utils.cs.meta create mode 100644 UniSkybox/Runtime/UtilsGetter.cs create mode 100644 UniSkybox/Runtime/UtilsGetter.cs.meta create mode 100644 UniSkybox/Runtime/UtilsSetter.cs create mode 100644 UniSkybox/Runtime/UtilsSetter.cs.meta diff --git a/CHANGELOG.md b/CHANGELOG.md index e43bf78..a93f6b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.8.0] - 2020-03-15 +- Added `VGO_materials_skybox` property to materials extension. +- Added `skybox` property to VGO_nodes extension. + ## [0.7.0] - 2020-01-23 - Added `VGO_materials_particle` property to materials extension. - Added `particleSystem` property to VGO_nodes extension. diff --git a/Documentation~/UniVGO/Installation.ja.md b/Documentation~/UniVGO/Installation.ja.md index ab1af61..26dfb99 100644 --- a/Documentation~/UniVGO/Installation.ja.md +++ b/Documentation~/UniVGO/Installation.ja.md @@ -22,7 +22,7 @@ ___ |パッケージ名|所有者|リポジトリー|仕様バージョン|プログラム バージョン|リリース日| |:---:|:---:|:---:|:---:|:---:|:---:| |newtonsoft-json-for-unity|jillejr|GitHub|12.0.3|12.0.301|2020年1月20日| -|UniVGO|IzayoiJiichan|GitHub|VGO 0.5|0.7.0|2020年1月23日| +|UniVGO|IzayoiJiichan|GitHub|VGO 0.6|0.8.0|2020年3月15日| ___ ## インストール @@ -120,11 +120,12 @@ https://github.com/izayoijiichan/VGO/releases ``` Packages - izayoi.univgo@0.7.0-preview + izayoi.univgo@0.8.0-preview DepthFirstScheduler MToon ShaderProperty UniGLTFforUniVgo + UniSkybox UniStandardParticle UniUnlit UniVgo @@ -162,7 +163,9 @@ ___ |MToon.Editor|MToon シェーダー ユーティリティー|-|*| |ShaderProperty.Runtime|シェーダーのプロパティー情報|*|*| |UniGLTFforUniVgo|UniGLTF(UniVGO用)|*|*| +|UniSkybox|Skybox シェーダー ユーティリティー|*|*| |UniStandardParticle|Particle シェーダー ユーティリティー|*|*| +|UniUnlit|Unlit シェーダー ユーティリティー|*|*| |UniUnlit.Editor|Unlit シェーダー ユーティリティー|-|*| |UniVgo|VGO メインプログラム|*|*| |UniVgo.Editor|VGO の入出力|-|*| @@ -170,10 +173,10 @@ ___ - UniVgo, UniVgo.Editor それぞれについて、依存関係にあるDLLに * を付けています。 - DepthFirstScheduler, MToon, ShaderProperty, UniUnlit は UniVRM (©vrm-c) に梱包されているプログラムです。 - UniVRM と UniVGO を併用する場合は、UniVgo を取得した際に梱包されていた 重複するファイル(DepthFirstScheduler, MToon, ShaderProperty, UniUnlit)を削除する必要があります。 - また、それにより UniVgo にてエラーが表示される場合、UniVgo, UniGLTFforUniVgo を `Assets`フォルダーに移動してください。 + また、それにより UniVgo にてエラーが表示される場合、UniVgo, UniGLTFforUniVgo, UniSkybox, UniStandardParticle を `Assets`フォルダーに移動してください。 ___ -最終更新日:2020年2月6日 +最終更新日:2020年3月15日 編集者:十六夜おじいちゃん *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/UniVGO/Installation.md b/Documentation~/UniVGO/Installation.md index c7bd24c..45fe2d8 100644 --- a/Documentation~/UniVGO/Installation.md +++ b/Documentation~/UniVGO/Installation.md @@ -22,7 +22,7 @@ As of the start of 2020, we are developing and confirming in `Unity 2019.3` Wind |package name|owner|Repository|specification version|program version|release date| |:---:|:---:|:---:|:---:|:---:|:---:| |newtonsoft-json-for-unity|jillejr|GitHub|12.0.3|12.0.301|20 Jan, 2020| -|UniVGO|IzayoiJiichan|GitHub|VGO 0.5|0.7.0|23 Jan, 2020| +|UniVGO|IzayoiJiichan|GitHub|VGO 0.6|0.8.0|15 Mar, 2020| ___ ## Install @@ -120,11 +120,12 @@ Unzip the file and place it in the `Packages` folder. ``` Packages - izayoi.univgo@0.7.0-preview + izayoi.univgo@0.8.0-preview DepthFirstScheduler MToon ShaderProperty UniGLTFforUniVgo + UniSkybox UniStandardParticle UniUnlit UniVgo @@ -163,6 +164,7 @@ When the package is installed in the project, the script is automatically compil |MToon.Editor|MToon shader utility|-|*| |ShaderProperty.Runtime|Shader property information|*|*| |UniGLTFforUniVgo|UniGLTF for UniVGO|*|*| +|UniSkybox|Skybox shader utility|*|*| |UniStandardParticle|Particle shader utility|*|*| |UniUnlit|Unlit shader utility|*|*| |UniUnlit.Editor|Unlit shader utility|-|*| @@ -172,10 +174,10 @@ When the package is installed in the project, the script is automatically compil - For each of UniVgo, and UniVgo.Editor, * is attached to the dependent DLL. - DepthFirstScheduler, MToon, ShaderProperty, UniUnlit is a program packed in UniVRM (© vrm-c). - When using UniVRM and UniVGO together, it is necessary to delete the duplicate files (DepthFirstScheduler, MToon, ShaderProperty, UniUnlit) that were packed when UniVgo was obtained. - Also, if the error is displayed by UniVgo, please move UniVgo, UniGLTFforUniVgo to the `Assets` folder. + Also, if the error is displayed by UniVgo, please move UniVgo, UniGLTFforUniVgo, UniSkybox, UniStandardParticle to the `Assets` folder. ___ -Last updated: 6 February, 2020 +Last updated: 15 March, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/UniVGO/Usage.ja.md b/Documentation~/UniVGO/Usage.ja.md index b50e8ec..7668b84 100644 --- a/Documentation~/UniVGO/Usage.ja.md +++ b/Documentation~/UniVGO/Usage.ja.md @@ -12,8 +12,8 @@ ___ |No|項目|値| |:---:|:---|:---:| |1|Unity バージョン|2019.3| -|2|UniVGO バージョン|0.7.0| -|3|VGO 仕様バージョン|0.5| +|2|UniVGO バージョン|0.8.0| +|3|VGO 仕様バージョン|0.6| ### 対応 Unity コンポーネント @@ -27,6 +27,7 @@ VGOが対応する Unity コンポーネントは以下の通りです |4|Rigidbody|Child|GameObjectに物理特性を設定し、動かすことができるようになります。| |5|Light|Child|GameObjectに光源を設定することができます。| |6|Particle System|Child|GameObjectにパーティクルを設定することができます。| +|7|Skybox|Child|シーンにスカイボックスを設定することができます。| ### 使用可能シェーダー @@ -37,14 +38,18 @@ VGOが対応する Unity コンポーネントは以下の通りです |1|Standard|標準シェーダー| |2|Particles/Standard Surface|Particle System 専用シェーダー| |3|Particles/Standard Unlit|Particle System 専用 Unlit シェーダー| -|4|Unlit/Color|| -|5|Unlit/Texture|| -|6|Unlit/Transparent|| -|7|Unlit/Transparent Cutout|| -|8|UniGLTF/Unlit|| -|9|VRM/MToon|| - -Unlit系のシェーダーは光源の影響を受けません。その代わり処理負荷が小さくなります。 +|4|Skybox/6 Sided|Skybox 6面 シェーダー| +|5|Skybox/Panoramic|Skybox パノラマ シェーダー| +|6|Skybox/Procedural|Skybox 手続型 シェーダー| +|7|Unlit/Color|| +|8|Unlit/Texture|| +|9|Unlit/Transparent|| +|10|Unlit/Transparent Cutout|| +|11|UniGLTF/Unlit|| +|12|VRM/MToon|| + +- Unlit系のシェーダーは光源の影響を受けません。その代わり処理負荷が小さくなります。 +- Skybox/Cubemap には対応していません。 ___ ## VGO の作成 @@ -115,17 +120,24 @@ UniVGO サンプル プロジェクトを使用する場合は`ExportScene`を 「VGO」の子に`GameObject`を配置していきます。 自由に配置することができます。 -#### 3-1. Light +#### 3-1. Skybox + +シーン内に1つだけ配置することができます。 +Skyboxマテリアルを設定します。 +設定値をシーンに反映するためにはスクリプトに処理が必要です。 +`Cubemap`はサポートされていません。 + +#### 3-2. Light `Realtime`設定のみ機能し、`Baked`は反映されません。 また、`Directional Light`をVGOに含める場合、シーン内に初期配置されている`Directional Light`を削除するか非アクティブにしておきます。 -#### 3-2. Particle System +#### 3-3. Particle System `Scene View`にてエフェクトを確認しながら設定することができます。 シェーダーはパーティクル用のシェーダーが使用できます。 -#### 3-3. それ以外の通常オブジェクト +#### 3-4. それ以外の通常オブジェクト `Light`, `Particle System`以外の通常のオブジェクトです。 タイプ別に A か B か C かに分かれます。 @@ -310,7 +322,7 @@ https://vovola.wixsite.com/website https://izayoi16.wixsite.com/vishop ___ -最終更新日:2020年2月6日 +最終更新日:2020年3月15日 編集者:十六夜おじいちゃん *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/UniVGO/Usage.md b/Documentation~/UniVGO/Usage.md index 3de73cd..2a9a603 100644 --- a/Documentation~/UniVGO/Usage.md +++ b/Documentation~/UniVGO/Usage.md @@ -12,8 +12,8 @@ The contents described in this manual are for the following versions. |No|item|value| |:---:|:---|:---:| |1|Unity version|2019.3| -|2|UniVGO version|0.7.0| -|3|VGO spec version|0.5| +|2|UniVGO version|0.8.0| +|3|VGO spec version|0.6| ### Supported Unity components @@ -27,6 +27,7 @@ The following Unity components are supported by VGO |4|Rigidbody|Child|You can set physics to GameObject and move it| |5|Light|Child|You can set the light source for GameObject.| |6|Particle System|Child|You can set particles to GameObject.| +|7|Skybox|Child|You can set skybox to Scene.| ### Usable shaders @@ -37,14 +38,18 @@ The supported shaders are as follows. |1|Standard|Standard shader| |2|Particles/Standard Surface|Particle System dedicated shader| |3|Particles/Standard Unlit|Particle System dedicated shader| -|4|Unlit/Color|| -|5|Unlit/Texture|| -|6|Unlit/Transparent|| -|7|Unlit/Transparent Cutout|| -|8|UniGLTF/Unlit|| -|9|VRM/MToon|| - -Unlit shaders are not affected by light sources. Instead, the processing load is reduced. +|4|Skybox/6 Sided|Skybox 6 sided shader| +|5|Skybox/Panoramic|Skybox panoramic shader| +|6|Skybox/Procedural|Skybox procedural shader| +|7|Unlit/Color|| +|8|Unlit/Texture|| +|9|Unlit/Transparent|| +|10|Unlit/Transparent Cutout|| +|11|UniGLTF/Unlit|| +|12|VRM/MToon|| + +- Unlit shaders are not affected by light sources. Instead, the processing load is reduced. +- Skybox / Cubemap is not supported. ___ ## Create VGO @@ -115,17 +120,24 @@ If the meta information is old, delete the component once and attach it again. Place `GameObject` as a child of" VGO ". You can place them freely. -#### 3-1. Light +#### 3-1. Skybox + +Only one can be placed in a scene. +Set Skybox material. +The script needs to be processed in order to reflect the setting value in the scene. +`Cubemap` is not supported. + +#### 3-2. Light Only `Realtime` settings work, not `Baked`. Also, if you want to include `Directional Light` in VGO, delete or deactivate` Directional Light` which is initially placed in the scene. -#### 3-2. Particle System +#### 3-3. Particle System You can set while checking the effect in `Scene View`. Shaders for particles can be used. -#### 3-3. Any other regular object +#### 3-4. Any other regular object Normal objects other than `Light` and` Particle System`. It is divided into A, B and C by type. @@ -309,7 +321,7 @@ You can specify a VGO file for your shop. https://izayoi16.wixsite.com/vishop ___ -Last updated: 6 February, 2020 +Last updated: 15 March, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/VGO/instructions/schema.json.materials.md b/Documentation~/VGO/instructions/schema.json.materials.md index 00853a3..718ecaf 100644 --- a/Documentation~/VGO/instructions/schema.json.materials.md +++ b/Documentation~/VGO/instructions/schema.json.materials.md @@ -48,6 +48,32 @@ |emissionColor||float[3]|r, g, b|| |emissionMapIndex||int||| +### VRMC_materials_skybox + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|sunDisk||string|None / Simple / HighQuality|None| +|sunSize||float|[0.0, 1.0]|| +|sunSizeConvergence||int|[1, 10]|| +|atmosphereThickness||float|[0.0, 5.0]|| +|tint||float[4]|r, g, b, a|| +|skyTint||float[4]|r, g, b, a|| +|groundColor||float[4]|r, g, b, a|| +|exposure||float|[0.0, 8.0]|| +|rotation||int|[0, 360]|| +|frontTexIndex||int||| +|backTexIndex||int||| +|leftTexIndex||int||| +|rightTexIndex||int||| +|upTexIndex||int||| +|downTexIndex||int||| +|texIndex||int||| +|mainTexIndex||int||| +|mapping||string|SixFramesLayout / LatitudeLongitudeLayout|SixFramesLayout| +|imageType||string|Degrees360 / Degrees180|Degrees360| +|mirrorOnBack||bool||| +|layout||string|None / SideBySide / OverUnder|None| + ### KHR_materials_unlit |definition name|description|type|setting value|default value| @@ -243,12 +269,34 @@ JSON{ } }, "extras": {} + }, + { + "name":"Skybox6SidedMaterial", + "pbrMetallicRoughness":{}, + "alphaCutoff":0.5, + "doubleSided":false, + "extensions":{ + "VGO_materials":{ + "shaderName":"Skybox/6 Sided" + }, + "VGO_materials_skybox":{ + "tint":[ 0.214,0.214,0.214,0.5 ], + "exposure":1.0, + "rotation":0, + "frontTexIndex":1, + "backTexIndex":2, + "leftTexIndex":3, + "rightTexIndex":4, + "upTexIndex":5, + "downTexIndex":6 + } + } } ] } ``` ___ -Last updated: 23 January, 2020 +Last updated: 15 March, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/VGO/instructions/schema.json.md b/Documentation~/VGO/instructions/schema.json.md index 87c4a30..8d1b773 100644 --- a/Documentation~/VGO/instructions/schema.json.md +++ b/Documentation~/VGO/instructions/schema.json.md @@ -10,6 +10,7 @@ |VGO_nodes|Declaration to use VGO_nodes.| |VGO_materials|Declaration to use VGO_materials.| |VGO_materials_particle|Declares that Particle shaders can be used for materials.| +|VGO_materials_skybox|Declares that Skybox shaders can be used for materials.| |KHR_materials_unlit|Declares that Unlit shaders can be used for materials.| |VRMC_materials_mtoon|Declares that MToon shaders can be used for materials.| @@ -21,6 +22,7 @@ |VGO_nodes|Requires support for VGO_nodes extension.| |VGO_materials|Requires support for VGO_materials extension.| |VGO_materials_particle|Requires support for the VGO_materials_particle extension.| +|VGO_materials_skybox|Requires support for the VGO_materials_skybox extension.| |KHR_materials_unlit|Requires support for the KHR_materials_unlit extension.| |VRMC_materials_mtoon|Requires support for the VRMC_materials_mtoon extension.| @@ -74,6 +76,7 @@ JSON{ "VGO_nodes", "VGO_materials", "VGO_materials_particle", + "VGO_materials_skybox", "KHR_materials_unlit", "VRMC_materials_mtoon" ], @@ -82,6 +85,7 @@ JSON{ "VGO_nodes", "VGO_materials", "VGO_materials_particle", + "VGO_materials_skybox", "KHR_materials_unlit", "VRMC_materials_mtoon" ], @@ -89,16 +93,16 @@ JSON{ "VGO": { "meta": { "generatorName": "UniVGO", - "generatorVersion": "0.7.0", - "specVersion": "0.5" + "generatorVersion": "0.8.0", + "specVersion": "0.6" }, "right": { "title": "Test Stage", "author": "Izayoi Jiichan", "organization": "Izayoi", "createdDate": "2020-01-01", - "updatedDate": "2020-01-23", - "version": "1.4", + "updatedDate": "2020-03-15", + "version": "1.5", "distributionUrl": "https://github.com/izayoijiichan/VGO", "licenseUrl": "https://github.com/izayoijiichan/VGO/blob/master/UniVgo/LICENSE.md" } @@ -108,7 +112,7 @@ JSON{ } ``` ___ -Last updated: 23 January, 2020 +Last updated: 15 March, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/VGO/instructions/schema.json.nodes.md b/Documentation~/VGO/instructions/schema.json.nodes.md index b14bf73..b7a765c 100644 --- a/Documentation~/VGO/instructions/schema.json.nodes.md +++ b/Documentation~/VGO/instructions/schema.json.nodes.md @@ -18,6 +18,7 @@ |light|Light information|VGO_Light| |particleSystem|Particle System information|VGO_ParticleSystem| |right|VGO rights information|VGO_Right| +|skybox|VGO skybox information|VGO_Skybox| ### VGO_GameObject @@ -596,6 +597,12 @@ unimplemented |alpha||float||| |time||float|[0,1]|| +### VGO_Skybox + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|materialIndex||int||| + ___ ## Example of glTF JSON structure @@ -1277,6 +1284,9 @@ JSON{ "reflectionProbeUsage":"Off" } }, + "skybox":{ + "materialIndex":1 + }, "right": { "title": "Capsule1", "author": "Izayoi Jiichan", @@ -1295,7 +1305,7 @@ JSON{ } ``` ___ -Last updated: 23 January, 2020 +Last updated: 15 March, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/VGO/specification/0.6/schema/VGO_materials.schema.json b/Documentation~/VGO/specification/0.6/schema/VGO_materials.schema.json new file mode 100644 index 0000000..e544d7c --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/VGO_materials.schema.json @@ -0,0 +1,11 @@ +{ + "title": "VGO_materials", + "description": "Material VGO.", + "type": "object", + "properties": { + "shaderName": { + "description": "The name of the shader.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/VGO_materials_particle.schema.json b/Documentation~/VGO/specification/0.6/schema/VGO_materials_particle.schema.json new file mode 100644 index 0000000..5521169 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/VGO_materials_particle.schema.json @@ -0,0 +1,132 @@ +{ + "VGO_materials_particle": { + "title": "VGO_materials_particle", + "type": "object", + "description": "", + "properties": { + "renderMode": { + "type": "string", + "enum": [ + "Opaque", + "Cutout", + "Fade", + "Transparent", + "Additive", + "Subtractive", + "Modulate" + ] + }, + "colorMode": { + "type": "string", + "enum": [ + "Multiply", + "Additive", + "Subtractive", + "Overlay", + "Color", + "Difference" + ] + }, + "flipBookMode": { + "type": "string", + "enum": [ + "Simple", + "Blended" + ] + }, + "cullMode": { + "title": "CullMode", + "type": "string", + "enum": [ + "Off", + "Front", + "Back" + ] + }, + "softParticlesEnabled": { + "type": "boolean" + }, + "softParticleFadeParams": { + "type": "array", + "items": { + "type": "number" + } + }, + "cameraFadingEnabled": { + "type": "boolean" + }, + "cameraFadeParams": { + "type": "array", + "items": { + "type": "number" + } + }, + "distortionEnabled": { + "type": "boolean" + }, + "grabTextureIndex": { + "type": "integer" + }, + "distortionStrengthScaled": { + "type": "number" + }, + "distortionBlend": { + "type": "number" + }, + "colorAddSubDiff": { + "type": "array", + "items": { + "type": "number" + } + }, + "mainTexIndex": { + "type": "integer" + }, + "mainTexSt": { + "type": "array", + "items": { + "type": "number" + } + }, + "color": { + "type": "array", + "items": { + "type": "number" + } + }, + "cutoff": { + "type": "number" + }, + "metallicGlossMapIndex": { + "type": "integer" + }, + "metallic": { + "type": "number" + }, + "glossiness": { + "type": "number" + }, + "bumpMapIndex": { + "type": "integer" + }, + "bumpScale": { + "type": "number" + }, + "lightingEnabled": { + "type": "boolean" + }, + "emissionEnabled": { + "type": "boolean" + }, + "emissionColor": { + "type": "array", + "items": { + "type": "number" + } + }, + "emissionMapIndex": { + "type": "integer" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/VGO_materials_skybox.schema.json b/Documentation~/VGO/specification/0.6/schema/VGO_materials_skybox.schema.json new file mode 100644 index 0000000..93299a4 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/VGO_materials_skybox.schema.json @@ -0,0 +1,99 @@ +{ + "VGO_materials_skybox": { + "title": "VGO_materials_skybox", + "type": "object", + "description": "", + "properties": { + "sunDisk": { + "type": "string", + "enum": [ + "None", + "Simple", + "HighQuality" + ] + }, + "sunSize": { + "type": "number" + }, + "sunSizeConvergence": { + "type": "integer" + }, + "atmosphereThickness": { + "type": "number" + }, + "tint": { + "type": "array", + "items": { + "type": "number" + } + }, + "skyTint": { + "type": "array", + "items": { + "type": "number" + } + }, + "groundColor": { + "type": "array", + "items": { + "type": "number" + } + }, + "exposure": { + "type": "number" + }, + "rotation": { + "type": "integer" + }, + "frontTexIndex": { + "type": "integer" + }, + "backTexIndex": { + "type": "integer" + }, + "leftTexIndex": { + "type": "integer" + }, + "rightTexIndex": { + "type": "integer" + }, + "upTexIndex": { + "type": "integer" + }, + "downTexIndex": { + "type": "integer" + }, + "texIndex": { + "type": "integer" + }, + "mainTexIndex": { + "type": "integer" + }, + "mapping": { + "type": "string", + "enum": [ + "SixFramesLayout", + "LatitudeLongitudeLayout" + ] + }, + "imageType": { + "type": "string", + "enum": [ + "Degrees360", + "Degrees180" + ] + }, + "mirrorOnBack": { + "type": "boolean" + }, + "layout": { + "type": "string", + "enum": [ + "None", + "SideBySide", + "OverUnder" + ] + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/VGO_nodes.schema.json b/Documentation~/VGO/specification/0.6/schema/VGO_nodes.schema.json new file mode 100644 index 0000000..56c8f20 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/VGO_nodes.schema.json @@ -0,0 +1,28 @@ +{ + "title": "VGO_nodes", + "description": "Node extension for VGO.", + "type": "object", + "properties": { + "gameObject": { + "$ref": "node.vgo.gameobject.schema.json" + }, + "colliders": { + "$ref": "node.vgo.colliders.schema.json" + }, + "rigidbody": { + "$ref": "node.vgo.rigidbody.schema.json" + }, + "light": { + "$ref": "node.vgo.light.schema.json" + }, + "particleSystem": { + "$ref": "node.vgo.particlesystem.schema.json" + }, + "right": { + "$ref": "vgo.right.schema.json" + }, + "skybox": { + "$ref": "node.vgo.skybox.schema.json" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/VRMC_materials_mtoon.schema.json b/Documentation~/VGO/specification/0.6/schema/VRMC_materials_mtoon.schema.json new file mode 100644 index 0000000..4041d9b --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/VRMC_materials_mtoon.schema.json @@ -0,0 +1,212 @@ +{ + "VRM.VRMC_materials_mtoon": { + "title": "VRMC_materials_mtoon", + "type": "object", + "description": "", + "properties": { + "version": { + "type": "string", + "description": "Meta" + }, + "renderMode": { + "title": "RenderMode", + "type": "string", + "enum": [ + "opaque", + "cutout", + "transparent", + "transparentWithZWrite" + ], + "description": "Rendering" + }, + "cullMode": { + "title": "CullMode", + "type": "string", + "enum": [ + "off", + "front", + "back" + ] + }, + "renderQueueOffsetNumber": { + "type": "integer", + "description": "" + }, + "litFactor": { + "type": "array", + "description": "Color", + "items": { + "type": "number" + } + }, + "litMultiplyTexture": { + "type": "integer", + "description": "" + }, + "shadeFactor": { + "type": "array", + "description": "", + "items": { + "type": "number" + } + }, + "shadeMultiplyTexture": { + "type": "integer", + "description": "" + }, + "cutoutThresholdFactor": { + "type": "number", + "description": "" + }, + "shadingShiftFactor": { + "type": "number", + "description": "Lighting" + }, + "shadingToonyFactor": { + "type": "number", + "description": "" + }, + "shadowReceiveMultiplierFactor": { + "type": "number", + "description": "" + }, + "shadowReceiveMultiplierMultiplyTexture": { + "type": "integer", + "description": "" + }, + "litAndShadeMixingMultiplierFactor": { + "type": "number", + "description": "" + }, + "litAndShadeMixingMultiplierMultiplyTexture": { + "type": "integer", + "description": "" + }, + "lightColorAttenuationFactor": { + "type": "number", + "description": "" + }, + "giIntensityFactor": { + "type": "number", + "description": "" + }, + "normalTexture": { + "type": "integer", + "description": "Normal" + }, + "normalScaleFactor": { + "type": "number", + "description": "" + }, + "emissionFactor": { + "type": "array", + "description": "Emission", + "items": { + "type": "number" + } + }, + "emissionMultiplyTexture": { + "type": "integer", + "description": "" + }, + "additiveTexture": { + "type": "integer", + "description": "MatCap" + }, + "rimFactor": { + "type": "array", + "description": "Rim", + "items": { + "type": "number" + } + }, + "rimMultiplyTexture": { + "type": "integer", + "description": "" + }, + "rimLightingMixFactor": { + "type": "number", + "description": "" + }, + "rimFresnelPowerFactor": { + "type": "number", + "description": "" + }, + "rimLiftFactor": { + "type": "number", + "description": "" + }, + "outlineWidthMode": { + "title": "OutlineWidthMode", + "type": "string", + "enum": [ + "none", + "worldCoordinates", + "screenCoordinates" + ], + "description": "Outline" + }, + "outlineWidthFactor": { + "type": "number", + "description": "" + }, + "outlineWidthMultiplyTexture": { + "type": "integer", + "description": "" + }, + "outlineScaledMaxDistanceFactor": { + "type": "number", + "description": "" + }, + "outlineColorMode": { + "title": "OutlineColorMode", + "type": "string", + "enum": [ + "fixedColor", + "mixedLighting" + ] + }, + "outlineFactor": { + "type": "array", + "description": "", + "items": { + "type": "number" + } + }, + "outlineLightingMixFactor": { + "type": "number", + "description": "" + }, + "mainTextureLeftBottomOriginScale": { + "type": "array", + "description": "TextureUvCoords", + "items": { + "type": "number" + } + }, + "mainTextureLeftBottomOriginOffset": { + "type": "array", + "description": "", + "items": { + "type": "number" + } + }, + "uvAnimationMaskTexture": { + "type": "integer", + "description": "" + }, + "uvAnimationScrollXSpeedFactor": { + "type": "number", + "description": "" + }, + "uvAnimationScrollYSpeedFactor": { + "type": "number", + "description": "" + }, + "uvAnimationRotationSpeedFactor": { + "type": "number", + "description": "" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/materials.extensions.schema.json b/Documentation~/VGO/specification/0.6/schema/materials.extensions.schema.json new file mode 100644 index 0000000..e733d03 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/materials.extensions.schema.json @@ -0,0 +1,22 @@ +{ + "title": "materials.extensions", + "description": "glTF material extension.", + "type": "object", + "properties": { + "VGO_materials": { + "$ref": "material.vgo.schema.json" + }, + "VGO_materials_particle": { + "$ref": "VGO_materials_particle.schema.json" + }, + "VGO_materials_skybox": { + "$ref": "VGO_materials_skybox.schema.json" + }, + "KHR_materials_unlit": { + "$ref": "glTF.KHR_materials_unlit.schema.json" + }, + "VRMC_materials_mtoon": { + "$ref": "VRMC_materials_mtoon.schema.json" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.collider.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.collider.schema.json new file mode 100644 index 0000000..71bd716 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.collider.schema.json @@ -0,0 +1,51 @@ +{ + "title": "node.vgo.collider", + "description": "Node collider.", + "type": "object", + "properties": { + "type": { + "description": "Type of collider.", + "type": "string", + "enum": ["Box","Capsule","Sphere"] + }, + "enabled": { + "description": "Whether collider is enabled.", + "type": "boolean" + }, + "isTrigger": { + "description": "Is the collider a trigger?", + "type": "boolean" + }, + "center": { + "description": "The center of the collider. [x, y, z]", + "type": "array", + "items": { + "type": "number" + } + }, + "size": { + "description": "The total size of the box. [x, y, z]", + "type": "array", + "items": { + "type": "number" + } + }, + "radius": { + "description": "The radius of the capsule or sphere, measured in the object's local space.", + "type": "number", + "minimum": 0 + }, + "height": { + "description": "The height of the capsule, measured in the object's local space.", + "type": "number", + "minimum": 0 + }, + "direction": { + "description": "The direction of the capsule. [0:x, 1:y, 2:z]", + "type": "integer" + }, + "physicMaterial": { + "$ref": "vgo.physicMaterial.schema.json" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.colliders.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.colliders.schema.json new file mode 100644 index 0000000..8e92d7c --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.colliders.schema.json @@ -0,0 +1,8 @@ +{ + "title": "node.vgo.colliders", + "description": "Node colliders.", + "type": "array", + "items": { + "$ref": "node.vgo.collider.schema.json" + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.gameobject.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.gameobject.schema.json new file mode 100644 index 0000000..3547a3e --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.gameobject.schema.json @@ -0,0 +1,25 @@ +{ + "title": "node.vgo.gameobject", + "description": "Node GameObject.", + "type": "object", + "properties": { + "isActive": { + "description": "Whether GameObject is active.", + "type": "boolean" + }, + "isStatic": { + "description": "Whether GameObject is static.", + "type": "boolean" + }, + "tag": { + "description": "Tag attached to GameObject.", + "type": "string" + } + "layer": { + "description": "Index of the layer where GameObject is located.", + "type": "integer", + "minimum": 0, + "maximum": 31 + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.light.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.light.schema.json new file mode 100644 index 0000000..04b4a0c --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.light.schema.json @@ -0,0 +1,110 @@ +{ + "title": "node.vgo.light", + "description": "Node light.", + "type": "object", + "properties": { + "enabled": { + "description": "Whether the light is enable.", + "type": "boolean", + }, + "type": { + "description": "The type of the light.", + "type": "string", + "enum": ["Spot","Directional","Point","Rectangle","Disc"] + }, + "shape": { + "description": "This property describes the shape of the spot light.", + "type": "string", + "enum": ["Cone","Pyramid","Box"] + }, + "range": { + "description": "The range of the light.", + "type": "number", + "minimum": 0 + }, + "spotAngle": { + "description": "The angle of the light's spotlight cone in degrees.", + "type": "number", + "minimum": 0 + }, + "areaSize": { + "description": "The size of the area light. [x, y]", + "type": "array", + "items": { + "type": "number" + } + }, + "areaRadius": { + "description": "The radius of the area light.", + "type": "number", + "minimum": 0 + }, + "color": { + "description": "The color of the light. [r, g, b, a]", + "type": "array", + "items": { + "type": "number" + } + }, + "lightmapBakeType": { + "description": "This property describes what part of a light's contribution can be baked.", + "type": "string", + "enum": ["Realtime","Baked","Mixed"] + }, + "intensity": { + "description": "The Intensity of a light is multiplied with the Light color.", + "type": "number", + "minimum": 0 + }, + "bounceIntensity": { + "description": "The multiplier that defines the strength of the bounce lighting.", + "type": "number", + "minimum": 0 + }, + "shadows": { + "description": "How this light casts shadows.", + "type": "string", + "enum": ["None","Hard","Soft"] + }, + "shadowAngle": { + "description": "Controls the amount of artificial softening applied to the edges of shadows cast by directional lights.", + "type": "number", + "minimum": 0 + }, + "shadowStrength": { + "description": "Strength of light's shadows.", + "type": "number", + "minimum": 0 + }, + "shadowResolution": { + "description": "The resolution of the shadow map.", + "type": "string", + "enum": ["FromQualitySettings","Low","Medium","High","VeryHigh"] + }, + "shadowBias": { + "description": "Shadow mapping constant bias.", + "type": "number", + "minimum": 0 + }, + "shadowNormalBias": { + "description": "Shadow mapping normal-based bias.", + "type": "number", + "minimum": 0 + }, + "shadowNearPlane": { + "description": "Near plane value to use for shadow frustums.", + "type": "number", + "minimum": 0 + }, + "renderMode": { + "description": "How to render the light.", + "type": "string", + "enum": ["Auto","ForcePixel","ForceVertex"] + }, + "cullingMask": { + "description": "This is used to light certain objects in the Scene selectively.", + "type": "integer", + "minimum": -1 + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.particleSystem.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.particleSystem.schema.json new file mode 100644 index 0000000..f39193e --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.particleSystem.schema.json @@ -0,0 +1,75 @@ +{ + "title": "node.vgo.particleSystem", + "type": "object", + "properties": { + "main": { + "$ref": "vgo.ps.main.module.json" + }, + "emission": { + "$ref": "vgo.ps.emission.module.json" + }, + "shape": { + "$ref": "vgo.ps.shape.module.json" + }, + "velocityOverLifetime": { + "$ref": "vgo.ps.velocityOverLifetime.module.json" + }, + "limitVelocityOverLifetime": { + "$ref": "vgo.ps.limitVelocityOverLifetime.module.json" + }, + "inheritVelocity": { + "$ref": "vgo.ps.inheritVelocity.module.json" + }, + "forceOverLifetime": { + "$ref": "vgo.ps.forceOverLifetime.module.json" + }, + "colorOverLifetime": { + "$ref": "vgo.ps.colorOverLifetime.module.json" + }, + "colorBySpeed": { + "$ref": "vgo.ps.colorBySpeed.module.json" + }, + "sizeOverLifetime": { + "$ref": "vgo.ps.sizeOverLifetime.module.json" + }, + "sizeBySpeed": { + "$ref": "vgo.ps.sizeBySpeed.module.json" + }, + "rotationOverLifetime": { + "$ref": "vgo.ps.rotationOverLifetime.module.json" + }, + "rotationBySpeed": { + "$ref": "vgo.ps.rotationBySpeed.module.json" + }, + "externalForces": { + "$ref": "vgo.ps.externalForces.module.json" + }, + "noise": { + "$ref": "vgo.ps.noise.module.json" + }, + "collision": { + "$ref": "vgo.ps.collision.module.json" + }, + "trigger": { + "$ref": "vgo.ps.trigger.module.json" + }, + "subEmitters": { + "$ref": "vgo.ps.subEmitters.module.json" + }, + "textureSheetAnimation": { + "$ref": "vgo.ps.textureSheetAnimation.module.json" + }, + "lights": { + "$ref": "vgo.ps.lights.module.json" + }, + "trails": { + "$ref": "vgo.ps.trails.module.json" + }, + "customData": { + "$ref": "vgo.ps.customData.module.json" + }, + "renderer": { + "$ref": "vgo.ps.renderer.module.json" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.rigidbody.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.rigidbody.schema.json new file mode 100644 index 0000000..972f501 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.rigidbody.schema.json @@ -0,0 +1,47 @@ +{ + "title": "node.vgo.rigidbody", + "description": "Node rigidbody.", + "type": "object", + "properties": { + "mass": { + "description": "The mass of the body. [0.0000001, 1000000000]", + "type": "number", + "minimum": 0.0000001, + "maximum": 1000000000 + }, + "drag": { + "description": "The linear drag coefficient. [0, infinity]", + "type": "number", + "minimum": 0 + }, + "angularDrag": { + "description": "The angular drag coefficient. [0, infinity]", + "type": "number", + "minimum": 0 + }, + "useGravity": { + "description": "Controls whether gravity affects this rigidbody.", + "type": "boolean" + }, + "isKinematic": { + "description": "Controls whether physics affects the rigidbody.", + "type": "boolean" + }, + "interpolation": { + "description": "Interpolation allows you to smooth out the effect of running physics at a fixed frame rate.", + "type": "string", + "enum": ["None","Interpolate","Extrapolate"] + }, + "collisionDetectionMode": { + "description": "The Rigidbody's collision detection mode.", + "type": "string", + "enum": ["Discrete","Continuous","ContinuousDynamic","ContinuousSpeculative"] + }, + "constraints": { + "description": "The flags to constrain motion of rigidbodies. [2|4|8|16|32|64]", + "type": "integer", + "minimum": 0, + "maximum": 126 + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.skybox.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.skybox.schema.json new file mode 100644 index 0000000..01c167b --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.skybox.schema.json @@ -0,0 +1,9 @@ +{ + "title": "node.vgo.skybox", + "type": "object", + "properties": { + "materialIndex": { + "type": "integer" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/node.vgo.transform.schema.json b/Documentation~/VGO/specification/0.6/schema/node.vgo.transform.schema.json new file mode 100644 index 0000000..e9cea09 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/node.vgo.transform.schema.json @@ -0,0 +1,33 @@ +{ + "$id": "node.vgo.transform", + "type": "object", + "properties": { + "position": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "rotation": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "scale": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/nodes.extensions.schema.json b/Documentation~/VGO/specification/0.6/schema/nodes.extensions.schema.json new file mode 100644 index 0000000..b99de87 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/nodes.extensions.schema.json @@ -0,0 +1,10 @@ +{ + "title": "nodes.extensions", + "description": "glTF node extension.", + "type": "object", + "properties": { + "VGO_nodes": { + "$ref": "VGO_nodes.schema.json" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.animationCurve.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.animationCurve.schema.json new file mode 100644 index 0000000..c22b008 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.animationCurve.schema.json @@ -0,0 +1,33 @@ +{ + "$id": "vgo.animationCurve", + "type": "object", + "properties": { + "keys": { + "$id": "VGO_Keyframe[]", + "type": [ + "array", + "null" + ] + }, + "preWrapMode": { + "type": "string", + "enum": [ + "Default", + "Once", + "Loop", + "PingPong", + "ClampForever" + ] + }, + "postWrapMode": { + "type": "string", + "enum": [ + "Default", + "Once", + "Loop", + "PingPong", + "ClampForever" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.gradient.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.gradient.schema.json new file mode 100644 index 0000000..a3d0d4e --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.gradient.schema.json @@ -0,0 +1,27 @@ +{ + "$id": "vgo.gradient", + "type": "object", + "properties": { + "colorKeys": { + "$id": "VGO_GradientColorKey[]", + "type": [ + "array", + "null" + ] + }, + "alphaKeys": { + "$id": "VGO_GradientAlphaKey[]", + "type": [ + "array", + "null" + ] + }, + "mode": { + "type": "string", + "enum": [ + "Blend", + "Fixed" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.gradientAlphakey.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.gradientAlphakey.schema.json new file mode 100644 index 0000000..1b46b83 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.gradientAlphakey.schema.json @@ -0,0 +1,12 @@ +{ + "$id": "vgo.gradient.alphaKey", + "type": "object", + "properties": { + "alpha": { + "type": "number" + }, + "time": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.gradientColorKey.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.gradientColorKey.schema.json new file mode 100644 index 0000000..1ed96f4 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.gradientColorKey.schema.json @@ -0,0 +1,15 @@ +{ + "$id": "vgo.gradient.colorKey", + "type": "object", + "properties": { + "color": { + "type": "array", + "items": { + "type": "number" + } + }, + "time": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.keyframe.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.keyframe.schema.json new file mode 100644 index 0000000..fff0fec --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.keyframe.schema.json @@ -0,0 +1,33 @@ +{ + "$id": "vgo.keyframe", + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "value": { + "type": "number" + }, + "inTangent": { + "type": "number" + }, + "outTangent": { + "type": "number" + }, + "inWeight": { + "type": "number" + }, + "outWeight": { + "type": "number" + }, + "weightedMode": { + "type": "string", + "enum": [ + "None", + "In", + "Out", + "Both" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.meta.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.meta.schema.json new file mode 100644 index 0000000..522f9f3 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.meta.schema.json @@ -0,0 +1,19 @@ +{ + "title": "vgo.meta", + "description": "VGO meta information.", + "type": "object", + "properties": { + "generatorName": { + "description": "The VGO generator name.", + "type": "string" + }, + "generatorVersion": { + "description": "The VGO generator version.", + "type": "string" + }, + "specVersion": { + "description": "The VGO specification version.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.physicMaterial.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.physicMaterial.schema.json new file mode 100644 index 0000000..8765d5f --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.physicMaterial.schema.json @@ -0,0 +1,35 @@ +{ + "title": "vgo.physicMaterial", + "description": "Physic material.", + "type": "object", + "properties": { + "dynamicFriction": { + "description": "The friction used when already moving.", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "staticFriction": { + "description": "The friction coefficient used when an object is lying on a surface.", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "bounciness": { + "description": "How bouncy is the surface?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "frictionCombine": { + "description": "Determines how the friction is combined.", + "type": "string", + "enum": ["Average","Multiply","Minimum","Maximum"] + }, + "bounceCombine": { + "description": "Determines how the bounciness is combined.", + "type": "string", + "enum": ["Average","Multiply","Minimum","Maximum"] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.burst.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.burst.schema.json new file mode 100644 index 0000000..c208f18 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.burst.schema.json @@ -0,0 +1,25 @@ +{ + "$id": "vgo.ps.burst", + "type": "object", + "properties": { + "time": { + "type": "number" + }, + "count": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ], + }, + "cycleCount": { + "type": "integer" + }, + "repeatInterval": { + "type": "number" + }, + "probability": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.collisionModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.collisionModule.schema.json new file mode 100644 index 0000000..98afc04 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.collisionModule.schema.json @@ -0,0 +1,4 @@ +{ + "$id": "vgo.ps.collisionModule", + "type": "object" +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.colorBySpeedModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.colorBySpeedModule.schema.json new file mode 100644 index 0000000..8d462b4 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.colorBySpeedModule.schema.json @@ -0,0 +1,25 @@ +{ + "$id": "vgo.ps.colorBySpeedModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "color": { + "$id": "vgo.ps.minMaxGradient", + "type": [ + "object", + "null" + ] + }, + "range": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.colorOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.colorOverLifetimeModule.schema.json new file mode 100644 index 0000000..27e8172 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.colorOverLifetimeModule.schema.json @@ -0,0 +1,16 @@ +{ + "$id": "vgo.ps.colorOverLifetimeModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "color": { + "$id": "vgo.ps.minMaxGradient", + "type": [ + "object", + "null" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.customDataModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.customDataModule.schema.json new file mode 100644 index 0000000..33d09a8 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.customDataModule.schema.json @@ -0,0 +1,4 @@ +{ + "$id": "vgo.ps.customDataModule", + "type": "object" +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.emission.module.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.emission.module.json new file mode 100644 index 0000000..f3486aa --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.emission.module.json @@ -0,0 +1,29 @@ +{ + "title": "vgo.ps.emission.module", + "description": "Particle System Emission Module.", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "rateOverTime": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "rateOverTimeMultiplier": { + "type": "number" + }, + "rateOverDistance": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "rateOverDistanceMultiplier": { + "type": "number" + }, + "bursts": { + "type": "array", + "items": { + "$ref": "vgo.ps.burst.schema.json" + } + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.emissionModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.emissionModule.schema.json new file mode 100644 index 0000000..f1e4507 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.emissionModule.schema.json @@ -0,0 +1,40 @@ +{ + "$id": "vgo.ps.emissionModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "rateOverTime": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "rateOverTimeMultiplier": { + "type": "number" + }, + "rateOverDistance": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "rateOverDistanceMultiplier": { + "type": "number" + }, + "bursts": { + "$id": "VGO_PS_Burst[]", + "type": [ + "array", + "null" + ], + "items": { + "$id": "vgo.ps.burst", + "type": "object" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.externalForcesModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.externalForcesModule.schema.json new file mode 100644 index 0000000..25b5c02 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.externalForcesModule.schema.json @@ -0,0 +1,30 @@ +{ + "$id": "vgo.ps.externalForcesModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "multiplierCurve": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "multiplier": { + "type": "number" + }, + "influenceFilter": { + "type": "string", + "enum": [ + "LayerMask", + "List", + "LayerMaskAndList" + ] + }, + "influenceMask": { + "type": "integer" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.forceOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.forceOverLifetimeModule.schema.json new file mode 100644 index 0000000..77bf6c8 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.forceOverLifetimeModule.schema.json @@ -0,0 +1,50 @@ +{ + "$id": "vgo.ps.forceOverLifetimeModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "x": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "y": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "z": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "xMultiplier": { + "type": "number" + }, + "yMultiplier": { + "type": "number" + }, + "zMultiplier": { + "type": "number" + }, + "space": { + "type": "string", + "enum": [ + "Local", + "World", + "Custom" + ] + }, + "randomized": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.inheritVelocityModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.inheritVelocityModule.schema.json new file mode 100644 index 0000000..3426596 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.inheritVelocityModule.schema.json @@ -0,0 +1,26 @@ +{ + "$id": "vgo.ps.inheritVelocityModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": [ + "Initial", + "Current" + ] + }, + "curve": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "curveMultiplier": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.lightsModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.lightsModule.schema.json new file mode 100644 index 0000000..ab60af8 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.lightsModule.schema.json @@ -0,0 +1,54 @@ +{ + "$id": "vgo.ps.lightsModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "ratio": { + "type": "number" + }, + "useRandomDistribution": { + "type": "boolean" + }, + "light": { + "$id": "node.vgo.light", + "type": [ + "object", + "null" + ] + }, + "useParticleColor": { + "type": "boolean" + }, + "sizeAffectsRange": { + "type": "boolean" + }, + "alphaAffectsIntensity": { + "type": "boolean" + }, + "range": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "rangeMultiplier": { + "type": "number" + }, + "intensity": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "intensityMultiplier": { + "type": "number" + }, + "maxLights": { + "type": "integer" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.limitVelocityOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.limitVelocityOverLifetimeModule.schema.json new file mode 100644 index 0000000..cca0984 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.limitVelocityOverLifetimeModule.schema.json @@ -0,0 +1,69 @@ +{ + "$id": "vgo.ps.limitVelocityOverLifetimeModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "separateAxes": { + "type": "boolean" + }, + "limitX": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "limitY": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "limitZ": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "limitXMultiplier": { + "type": "number" + }, + "limitYMultiplier": { + "type": "number" + }, + "limitZMultiplier": { + "type": "number" + }, + "space": { + "type": "string", + "enum": [ + "Local", + "World", + "Custom" + ] + }, + "dampen": { + "type": "number" + }, + "drag": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "dragMultiplier": { + "type": "number" + }, + "multiplyDragByParticleSize": { + "type": "boolean" + }, + "multiplyDragByParticleVelocity": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.main.module.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.main.module.json new file mode 100644 index 0000000..60d3faa --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.main.module.json @@ -0,0 +1,140 @@ +{ + "title": "vgo.ps.main.module", + "description": "Particle System Main Module.", + "type": "object", + "properties": { + "duration": { + "type": "number" + }, + "loop": { + "type": "boolean" + }, + "prewarm": { + "type": "boolean" + }, + "startDelay": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startDelayMultiplier": { + "type": "number" + }, + "startLifetime": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startLifetimeMultiplier": { + "type": "number" + }, + "startSpeed": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startSpeedMultiplier": { + "type": "number" + }, + "startSize3D": { + "type": "boolean" + }, + "startSize": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startSizeX": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startSizeY": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startSizeZ": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startSizeMultiplier": { + "type": "number" + }, + "startSizeXMultiplier": { + "type": "number" + }, + "startSizeYMultiplier": { + "type": "number" + }, + "startSizeZMultiplier": { + "type": "number" + }, + "startRotation3D": { + "type": "boolean" + }, + "startRotation": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startRotationX": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startRotationY": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startRotationZ": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "startRotationMultiplier": { + "type": "number" + }, + "startRotationXMultiplier": { + "type": "number" + }, + "startRotationYMultiplier": { + "type": "number" + }, + "startRotationZMultiplier": { + "type": "number" + }, + "flipRotation": { + "type": "number" + }, + "startColor": { + "$ref": "vgo.ps.minMaxGradient.schema.json" + }, + "gravityModifier": { + "$ref": "vgo.ps.minMaxCurve.schema.json" + }, + "gravityModifierMultiplier": { + "type": "number" + }, + "simulationSpace": { + "type": "string", + "enum": ["Local","World","Custom"] + }, + "useUnscaledTime": { + "type": "boolean" + }, + "scalingMode": { + "type": "string", + "enum": ["Hierarchy","Local","Shape"] + }, + "playOnAwake": { + "type": "boolean" + }, + "emitterVelocityMode": { + "type": "string", + "enum": ["Transform","Rigidbody"] + }, + "maxParticles": { + "type": "integer" + }, + "stopAction": { + "type": "string", + "enum": ["None","Disable","Destroy","Callback"] + }, + "cullingMode": { + "type": "string", + "enum": ["Automatic","PauseAndCatchup","Pause","AlwaysSimulate"] + }, + "ringBufferMode": { + "type": "string", + "enum": ["Disabled","PauseUntilReplaced","LoopUntilReplaced"] + }, + "ringBufferLoopRange": { + "type": "array", + "items": { + "type": "number" + } + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.mainModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.mainModule.schema.json new file mode 100644 index 0000000..c28411c --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.mainModule.schema.json @@ -0,0 +1,232 @@ +{ + "$id": "vgo.ps.mainModule", + "type": "object", + "properties": { + "duration": { + "type": "number" + }, + "loop": { + "type": "boolean" + }, + "prewarm": { + "type": "boolean" + }, + "startDelay": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startDelayMultiplier": { + "type": "number" + }, + "startLifetime": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startLifetimeMultiplier": { + "type": "number" + }, + "startSpeed": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startSpeedMultiplier": { + "type": "number" + }, + "startSize3D": { + "type": "boolean" + }, + "startSize": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startSizeX": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startSizeY": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startSizeZ": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startSizeMultiplier": { + "type": "number" + }, + "startSizeXMultiplier": { + "type": "number" + }, + "startSizeYMultiplier": { + "type": "number" + }, + "startSizeZMultiplier": { + "type": "number" + }, + "startRotation3D": { + "type": "boolean" + }, + "startRotation": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startRotationX": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startRotationY": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startRotationZ": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "startRotationMultiplier": { + "type": "number", + "default": -1.0 + }, + "startRotationXMultiplier": { + "type": "number", + "default": -1.0 + }, + "startRotationYMultiplier": { + "type": "number", + "default": -1.0 + }, + "startRotationZMultiplier": { + "type": "number", + "default": -1.0 + }, + "flipRotation": { + "type": "number" + }, + "startColor": { + "$id": "vgo.ps.minMaxGradient", + "type": [ + "object", + "null" + ] + }, + "gravityModifier": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "gravityModifierMultiplier": { + "type": "number" + }, + "simulationSpace": { + "type": "string", + "enum": [ + "Local", + "World", + "Custom" + ] + }, + "simulationSpeed": { + "type": "number" + }, + "customSimulationSpace": { + "$id": "node.vgo.transform", + "type": [ + "object", + "null" + ] + }, + "useUnscaledTime": { + "type": "boolean" + }, + "scalingMode": { + "type": "string", + "enum": [ + "Hierarchy", + "Local", + "Shape" + ] + }, + "playOnAwake": { + "type": "boolean" + }, + "emitterVelocityMode": { + "type": "string", + "enum": [ + "Transform", + "Rigidbody" + ] + }, + "maxParticles": { + "type": "integer" + }, + "stopAction": { + "type": "string", + "enum": [ + "None", + "Disable", + "Destroy", + "Callback" + ] + }, + "cullingMode": { + "type": "string", + "enum": [ + "Automatic", + "PauseAndCatchup", + "Pause", + "AlwaysSimulate" + ] + }, + "ringBufferMode": { + "type": "string", + "enum": [ + "Disabled", + "PauseUntilReplaced", + "LoopUntilReplaced" + ] + }, + "ringBufferLoopRange": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxCurve.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxCurve.schema.json new file mode 100644 index 0000000..6f46bfe --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxCurve.schema.json @@ -0,0 +1,48 @@ +{ + "$id": "vgo.ps.minMaxCurve", + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "Constant", + "Curve", + "TwoCurves", + "TwoConstants" + ] + }, + "constant": { + "type": "number" + }, + "constantMin": { + "type": "number" + }, + "constantMax": { + "type": "number" + }, + "curveMultiplier": { + "type": "number" + }, + "curve": { + "$id": "vgo.animationCurve", + "type": [ + "object", + "null" + ] + }, + "curveMin": { + "$id": "vgo.animationCurve", + "type": [ + "object", + "null" + ] + }, + "curveMax": { + "$id": "vgo.animationCurve", + "type": [ + "object", + "null" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxGradient.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxGradient.schema.json new file mode 100644 index 0000000..1af6427 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.minMaxGradient.schema.json @@ -0,0 +1,64 @@ +{ + "$id": "vgo.ps.minMaxGradient", + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "Color", + "Gradient", + "TwoColors", + "TwoGradients", + "RandomColor" + ] + }, + "color": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "colorMin": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "colorMax": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "gradient": { + "$id": "vgo.gradient", + "type": [ + "object", + "null" + ] + }, + "gradientMin": { + "$id": "vgo.gradient", + "type": [ + "object", + "null" + ] + }, + "gradientMax": { + "$id": "vgo.gradient", + "type": [ + "object", + "null" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.noiseModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.noiseModule.schema.json new file mode 100644 index 0000000..1cb0ee6 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.noiseModule.schema.json @@ -0,0 +1,129 @@ +{ + "$id": "vgo.ps.noiseModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "separateAxes": { + "type": "boolean" + }, + "strengthX": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "strengthY": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "strengthZ": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "strengthXMultiplier": { + "type": "number" + }, + "strengthYMultiplier": { + "type": "number" + }, + "strengthZMultiplier": { + "type": "number" + }, + "frequency": { + "type": "number" + }, + "scrollSpeed": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "scrollSpeedMultiplier": { + "type": "number" + }, + "damping": { + "type": "boolean" + }, + "octaveCount": { + "type": "integer" + }, + "octaveMultiplier": { + "type": "number" + }, + "octaveScale": { + "type": "number" + }, + "quality": { + "type": "string", + "enum": [ + "Low", + "Medium", + "High" + ] + }, + "remapEnabled": { + "type": "boolean" + }, + "remapX": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "remapY": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "remapZ": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "remapXMultiplier": { + "type": "number" + }, + "remapYMultiplier": { + "type": "number" + }, + "remapZMultiplier": { + "type": "number" + }, + "positionAmount": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "rotationAmount": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "sizeAmount": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.renderer.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.renderer.schema.json new file mode 100644 index 0000000..3212748 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.renderer.schema.json @@ -0,0 +1,161 @@ +{ + "$id": "vgo.ps.renderer", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "renderMode": { + "type": "string", + "enum": [ + "Billboard", + "Stretch", + "HorizontalBillboard", + "VerticalBillboard", + "Mesh", + "None" + ] + }, + "cameraVelocityScale": { + "type": "number" + }, + "velocityScale": { + "type": "number" + }, + "lengthScale": { + "type": "number" + }, + "normalDirection": { + "type": "number" + }, + "sharedMaterialIndex": { + "type": "integer" + }, + "trailMaterialIndex": { + "type": "integer" + }, + "sortMode": { + "type": "string", + "enum": [ + "None", + "Distance", + "OldestInFront", + "YoungestInFront" + ] + }, + "sortingFudge": { + "type": "number" + }, + "minParticleSize": { + "type": "number" + }, + "maxParticleSize": { + "type": "number" + }, + "alignment": { + "type": "string", + "enum": [ + "View", + "World", + "Local", + "Facing", + "Velocity" + ] + }, + "flip": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "allowRoll": { + "type": "boolean" + }, + "pivot": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "maskInteraction": { + "type": "string", + "enum": [ + "None", + "VisibleInsideMask", + "VisibleOutsideMask" + ] + }, + "enableGPUInstancing": { + "type": "boolean" + }, + "shadowCastingMode": { + "type": "string", + "enum": [ + "Off", + "On", + "TwoSided", + "ShadowsOnly" + ] + }, + "receiveShadows": { + "type": "boolean" + }, + "shadowBias": { + "type": "number" + }, + "motionVectorGenerationMode": { + "type": "string", + "enum": [ + "Camera", + "Object", + "ForceNoMotion" + ] + }, + "forceRenderingOff": { + "type": "boolean" + }, + "rendererPriority": { + "type": "integer" + }, + "renderingLayerMask": { + "type": "integer" + }, + "sortingLayerID": { + "type": "integer" + }, + "sortingOrder": { + "type": "integer" + }, + "lightProbeUsage": { + "type": "string", + "enum": [ + "Off", + "BlendProbes", + "UseProxyVolume", + "CustomProvided" + ] + }, + "reflectionProbeUsage": { + "type": "string", + "enum": [ + "Off", + "BlendProbes", + "BlendProbesAndSkybox", + "Simple" + ] + }, + "probeAnchor": { + "$id": "node.vgo.transform", + "type": [ + "object", + "null" + ] + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationBySpeedModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationBySpeedModule.schema.json new file mode 100644 index 0000000..35f66dc --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationBySpeedModule.schema.json @@ -0,0 +1,51 @@ +{ + "$id": "vgo.ps.rotationBySpeedModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "separateAxes": { + "type": "boolean" + }, + "x": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "y": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "z": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "xMultiplier": { + "type": "number" + }, + "yMultiplier": { + "type": "number" + }, + "zMultiplier": { + "type": "number" + }, + "range": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationOverLifetimeModule.schema.json new file mode 100644 index 0000000..53b4ca2 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.rotationOverLifetimeModule.schema.json @@ -0,0 +1,42 @@ +{ + "$id": "vgo.ps.rotationOverLifetimeModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "separateAxes": { + "type": "boolean" + }, + "x": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "y": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "z": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "xMultiplier": { + "type": "number" + }, + "yMultiplier": { + "type": "number" + }, + "zMultiplier": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.shapeModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.shapeModule.schema.json new file mode 100644 index 0000000..972b5af --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.shapeModule.schema.json @@ -0,0 +1,215 @@ +{ + "$id": "vgo.ps.shapeModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "shapeType": { + "type": "string", + "enum": [ + "Sphere", + "SphereShell", + "Hemisphere", + "HemisphereShell", + "Cone", + "Box", + "Mesh", + "ConeShell", + "ConeVolume", + "ConeVolumeShell", + "Circle", + "CircleEdge", + "SingleSidedEdge", + "MeshRenderer", + "SkinnedMeshRenderer", + "BoxShell", + "BoxEdge", + "Donut", + "Rectangle", + "Sprite", + "SpriteRenderer" + ] + }, + "angle": { + "type": "number" + }, + "radius": { + "type": "number" + }, + "donutRadius": { + "type": "number" + }, + "radiusMode": { + "type": "string", + "enum": [ + "Random", + "Loop", + "PingPong", + "BurstSpread" + ] + }, + "radiusSpread": { + "type": "number" + }, + "radiusSpeed": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "radiusSpeedMultiplier": { + "type": "number" + }, + "radiusThickness": { + "type": "number" + }, + "boxThickness": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "arc": { + "type": "number" + }, + "arcMode": { + "type": "string", + "enum": [ + "Random", + "Loop", + "PingPong", + "BurstSpread" + ] + }, + "arcSpread": { + "type": "number" + }, + "arcSpeed": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "arcSpeedMultiplier": { + "type": "number" + }, + "length": { + "type": "number" + }, + "meshShapeType": { + "type": "string", + "enum": [ + "Vertex", + "Edge", + "Triangle" + ] + }, + "meshSpawnMode": { + "type": "string", + "enum": [ + "Random", + "Loop", + "PingPong", + "BurstSpread" + ] + }, + "meshSpawnSpread": { + "type": "number" + }, + "meshSpawnSpeed": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "meshSpawnSpeedMultiplier": { + "type": "number" + }, + "useMeshMaterialIndex": { + "type": "boolean" + }, + "meshMaterialIndex": { + "type": "integer" + }, + "useMeshColors": { + "type": "boolean" + }, + "normalOffset": { + "type": "number" + }, + "textureIndex": { + "type": "integer", + "default": -1 + }, + "textureClipChannel": { + "type": "string", + "enum": [ + "Red", + "Green", + "Blue", + "Alpha" + ] + }, + "textureClipThreshold": { + "type": "number" + }, + "textureColorAffectsParticles": { + "type": "boolean" + }, + "textureAlphaAffectsParticles": { + "type": "boolean" + }, + "textureBilinearFiltering": { + "type": "boolean" + }, + "textureUVChannel": { + "type": "integer" + }, + "position": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "rotation": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "scale": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + }, + "alignToDirection": { + "type": "boolean" + }, + "randomDirectionAmount": { + "type": "number" + }, + "sphericalDirectionAmount": { + "type": "number" + }, + "randomPositionAmount": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeBySpeedModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeBySpeedModule.schema.json new file mode 100644 index 0000000..ccb29e1 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeBySpeedModule.schema.json @@ -0,0 +1,51 @@ +{ + "$id": "vgo.ps.sizeBySpeedModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "separateAxes": { + "type": "boolean" + }, + "x": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "y": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "z": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "xMultiplier": { + "type": "number" + }, + "yMultiplier": { + "type": "number" + }, + "zMultiplier": { + "type": "number" + }, + "range": { + "type": [ + "array", + "null" + ], + "items": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeOverLifetimeModule.schema.json new file mode 100644 index 0000000..5f9c2dd --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.sizeOverLifetimeModule.schema.json @@ -0,0 +1,42 @@ +{ + "$id": "vgo.ps.sizeOverLifetimeModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "separateAxes": { + "type": "boolean" + }, + "x": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "y": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "z": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "xMultiplier": { + "type": "number" + }, + "yMultiplier": { + "type": "number" + }, + "zMultiplier": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.subEmittersModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.subEmittersModule.schema.json new file mode 100644 index 0000000..e68b5f6 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.subEmittersModule.schema.json @@ -0,0 +1,4 @@ +{ + "$id": "vgo.ps.subEmittersModule", + "type": "object" +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.textureSheetAnimationModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.textureSheetAnimationModule.schema.json new file mode 100644 index 0000000..e94c1ab --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.textureSheetAnimationModule.schema.json @@ -0,0 +1,4 @@ +{ + "$id": "vgo.ps.textureSheetAnimationModule", + "type": "object" +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.trailModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.trailModule.schema.json new file mode 100644 index 0000000..c1dda3f --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.trailModule.schema.json @@ -0,0 +1,95 @@ +{ + "$id": "vgo.ps.trailModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": [ + "PerParticle", + "Ribbon" + ] + }, + "ratio": { + "type": "number" + }, + "lifetime": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "lifetimeMultiplier": { + "type": "number" + }, + "minVertexDistance": { + "type": "number" + }, + "worldSpace": { + "type": "boolean" + }, + "dieWithParticles": { + "type": "boolean" + }, + "ribbonCount": { + "type": "integer" + }, + "splitSubEmitterRibbons": { + "type": "boolean" + }, + "attachRibbonsToTransform": { + "type": "boolean" + }, + "textureMode": { + "type": "string", + "enum": [ + "Stretch", + "Tile", + "DistributePerSegment", + "RepeatPerSegment" + ] + }, + "sizeAffectsWidth": { + "type": "boolean" + }, + "sizeAffectsLifetime": { + "type": "boolean" + }, + "useMeinheritParticleColorshColors": { + "type": "boolean" + }, + "colorOverLifetime": { + "$id": "vgo.ps.minMaxGradient", + "type": [ + "object", + "null" + ] + }, + "widthOverTrail": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "widthOverTrailMultiplier": { + "type": "number" + }, + "colorOverTrail": { + "$id": "vgo.ps.minMaxGradient", + "type": [ + "object", + "null" + ] + }, + "generateLightingData": { + "type": "boolean" + }, + "shadowBias": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.triggerModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.triggerModule.schema.json new file mode 100644 index 0000000..4458a45 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.triggerModule.schema.json @@ -0,0 +1,4 @@ +{ + "$id": "vgo.ps.triggerModule", + "type": "object" +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.ps.velocityOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.ps.velocityOverLifetimeModule.schema.json new file mode 100644 index 0000000..183b5ee --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.ps.velocityOverLifetimeModule.schema.json @@ -0,0 +1,127 @@ +{ + "$id": "vgo.ps.velocityOverLifetimeModule", + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "x": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "y": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "z": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "xMultiplier": { + "type": "number" + }, + "yMultiplier": { + "type": "number" + }, + "zMultiplier": { + "type": "number" + }, + "space": { + "type": "string", + "enum": [ + "Local", + "World", + "Custom" + ] + }, + "orbitalX": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "orbitalY": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "orbitalZ": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "orbitalXMultiplier": { + "type": "number" + }, + "orbitalYMultiplier": { + "type": "number" + }, + "orbitalZMultiplier": { + "type": "number" + }, + "orbitalOffsetX": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "orbitalOffsetY": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "orbitalOffsetZ": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "orbitalOffsetXMultiplier": { + "type": "number" + }, + "orbitalOffsetYMultiplier": { + "type": "number" + }, + "orbitalOffsetZMultiplier": { + "type": "number" + }, + "radial": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "radialMultiplier": { + "type": "number" + }, + "speedModifier": { + "$id": "vgo.ps.minMaxCurve", + "type": [ + "object", + "null" + ] + }, + "speedModifierMultiplier": { + "type": "number" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.right.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.right.schema.json new file mode 100644 index 0000000..47e1c63 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.right.schema.json @@ -0,0 +1,39 @@ +{ + "title": "vgo.right", + "description": "Rights information.", + "type": "object", + "properties": { + "title": { + "description": "The name of the model.", + "type": "string" + }, + "author": { + "description": "The name of the model creator.", + "type": "string" + }, + "organization": { + "description": "Organization to which the creator belongs.", + "type": "string" + }, + "createdDate": { + "description": "The date this model was created.", + "type": "string" + }, + "updatedDate": { + "description": "The date this model was updated.", + "type": "string" + }, + "version": { + "description": "The version of this model.", + "type": "string" + }, + "distributionUrl": { + "description": "Distribution URL for this model.", + "type": "string" + }, + "licenseUrl": { + "description": "URL that describes the license for this model.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.6/schema/vgo.schema.json b/Documentation~/VGO/specification/0.6/schema/vgo.schema.json new file mode 100644 index 0000000..b395fc8 --- /dev/null +++ b/Documentation~/VGO/specification/0.6/schema/vgo.schema.json @@ -0,0 +1,13 @@ +{ + "title": "vgo", + "description": "glTF extension for VGO.", + "type": "object", + "properties": { + "meta": { + "$ref": "vgo.meta.schema.json" + }, + "right": { + "$ref": "vgo.right.schema.json" + } + } +} \ No newline at end of file diff --git a/README.ja.md b/README.ja.md index b87ee1a..af276bf 100644 --- a/README.ja.md +++ b/README.ja.md @@ -6,8 +6,8 @@ ___ ## 特徴 - glTF (GLB) 2.0 の拡張フォーマットになります。 -- Unity の `GameObject`, `Transform`, `Rigidbody`, `Collider`, `Mesh`, `Material`, `Texture`, `Light`, `ParticleSystem` を保存することができます。 -- シェーダー設定は `Standard`, `Particle`, `Unlit`, `MToon` を保存することができます。 +- Unity の `GameObject`, `Transform`, `Rigidbody`, `Collider`, `Mesh`, `Material`, `Texture`, `Light`, `ParticleSystem`, `Skybox` を保存することができます。 +- シェーダー設定は `Standard`, `Particle`, `Skybox`, `Unlit`, `MToon` を保存することができます。 ___ ## 翻訳 @@ -29,6 +29,7 @@ ___ - extensions - VGO_materials - VGO_materials_particle + - VGO_materials_skybox - KHR_materials_unlit - VRMC_materials_mtoon - meshes @@ -42,6 +43,7 @@ ___ - light - particleSystem - right + - skybox - samplers - scene - scenes @@ -57,7 +59,7 @@ ___ ## 仕様 - glTF JSON Schema: [2.0](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0/schema) -- VGO JSON Schema: [0.5](https://github.com/izayoijiichan/VGO/tree/master/Documentation~/VGO/specification/0.5/schema) +- VGO JSON Schema: [0.6](https://github.com/izayoijiichan/VGO/tree/master/Documentation~/VGO/specification/0.6/schema) - KHR_materials_unlit: [2.0](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit) - VRMC_materials_mtoon: [1.0](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_materials_mtoon-1.0_draft) @@ -88,7 +90,7 @@ VGOファイルの中身を確認するためのツールです。 https://github.com/izayoijiichan/vgo.parameter.viewer ___ -最終更新日:2020年2月6日 +最終更新日:2020年3月15日 編集者:十六夜おじいちゃん *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/README.md b/README.md index 0945146..6cb1a4a 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ VGO is a 3D data format for Unity that can store Collider and Rigidbody informat ## Features - glTF (GLB) 2.0 extended format. -- Unity `GameObject`, `Transform`, `Rigidbody`, `Collider`, `Mesh`, `Material`, `Texture`, `Light` and `ParticleSystem` can be saved. -- Shader settings of `Standard`, `Particle`, `Unlit` and `MToon` can be saved. +- Unity `GameObject`, `Transform`, `Rigidbody`, `Collider`, `Mesh`, `Material`, `Texture`, `Light`, `ParticleSystem` and `Skybox` can be saved. +- Shader settings of `Standard`, `Particle`, `Skybox`, `Unlit` and `MToon` can be saved. ___ ## Translation @@ -28,6 +28,7 @@ ___ - extensions - VGO_materials - VGO_materials_particle + - VGO_materials_skybox - KHR_materials_unlit - VRMC_materials_mtoon - meshes @@ -41,6 +42,7 @@ ___ - light - particleSystem - right + - skybox - samplers - scene - scenes @@ -56,7 +58,7 @@ ___ ## Specification - glTF JSON Schema: [2.0](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0/schema) -- VGO JSON Schema: [0.5](https://github.com/izayoijiichan/VGO/tree/master/Documentation~/VGO/specification/0.5/schema) +- VGO JSON Schema: [0.6](https://github.com/izayoijiichan/VGO/tree/master/Documentation~/VGO/specification/0.6/schema) - KHR_materials_unlit: [2.0](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit) - VRMC_materials_mtoon: [1.0](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_materials_mtoon-1.0_draft) @@ -89,7 +91,7 @@ It is distributed at the following URL. https://github.com/izayoijiichan/vgo.parameter.viewer ___ -Last updated: 6 February, 2020 +Last updated: 15 March, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/UniGLTFforUniVgo/Runtime/Format/glTF.partial.cs b/UniGLTFforUniVgo/Runtime/Format/glTF.partial.cs index 74df56b..a5500e3 100644 --- a/UniGLTFforUniVgo/Runtime/Format/glTF.partial.cs +++ b/UniGLTFforUniVgo/Runtime/Format/glTF.partial.cs @@ -232,6 +232,11 @@ public bool MaterialHasVertexColor(int materialIndex) return false; } + if (meshes == null) + { + return false; + } + var hasVertexColor = meshes.SelectMany(x => x.primitives).Any(x => x.material == materialIndex && x.HasVertexColor); return hasVertexColor; } diff --git a/UniGLTFforUniVgo/Runtime/IO/gltfExporter.cs b/UniGLTFforUniVgo/Runtime/IO/gltfExporter.cs index c9b95fe..53da481 100644 --- a/UniGLTFforUniVgo/Runtime/IO/gltfExporter.cs +++ b/UniGLTFforUniVgo/Runtime/IO/gltfExporter.cs @@ -87,7 +87,7 @@ public List Nodes public List Materials { get; - private set; + protected set; } public TextureExportManager TextureManager; @@ -223,19 +223,20 @@ void FromGameObject(glTF gltf, GameObject go, bool useSparseAccessorForMorphTarg .ToList(); #region Materials and Textures - Materials = Nodes.SelectMany(x => x.GetSharedMaterials()).Where(x => x != null).Distinct().ToList(); - var unityTextures = Materials.SelectMany(x => TextureIO.GetTextures(x)).Where(x => x.Texture != null).Distinct().ToList(); + //Materials = Nodes.SelectMany(x => x.GetSharedMaterials()).Where(x => x != null).Distinct().ToList(); + //var unityTextures = Materials.SelectMany(x => TextureIO.GetTextures(x)).Where(x => x.Texture != null).Distinct().ToList(); - TextureManager = new TextureExportManager(unityTextures.Select(x => x.Texture)); + //TextureManager = new TextureExportManager(unityTextures.Select(x => x.Texture)); - var materialExporter = CreateMaterialExporter(); - gltf.materials = Materials.Select(x => materialExporter.ExportMaterial(x, TextureManager)).ToList(); + //var materialExporter = CreateMaterialExporter(); + //gltf.materials = Materials.Select(x => materialExporter.ExportMaterial(x, TextureManager)).ToList(); - for (int i = 0; i < unityTextures.Count; ++i) - { - var unityTexture = unityTextures[i]; - TextureIO.ExportTexture(gltf, bufferIndex, TextureManager.GetExportTexture(i), unityTexture.TextureType); - } + //for (int i = 0; i < unityTextures.Count; ++i) + //{ + // var unityTexture = unityTextures[i]; + // TextureIO.ExportTexture(gltf, bufferIndex, TextureManager.GetExportTexture(i), unityTexture.TextureType); + //} + FromGameObjectMaterialsAndTextures(gltf, go, bufferIndex); #endregion @@ -381,6 +382,23 @@ void FromGameObject(glTF gltf, GameObject go, bool useSparseAccessorForMorphTarg } } } + + protected virtual void FromGameObjectMaterialsAndTextures(glTF gltf, GameObject go, int bufferIndex) + { + Materials = Nodes.SelectMany(x => x.GetSharedMaterials()).Where(x => x != null).Distinct().ToList(); + var unityTextures = Materials.SelectMany(x => TextureIO.GetTextures(x)).Where(x => x.Texture != null).Distinct().ToList(); + + TextureManager = new TextureExportManager(unityTextures.Select(x => x.Texture)); + + var materialExporter = CreateMaterialExporter(); + gltf.materials = Materials.Select(x => materialExporter.ExportMaterial(x, TextureManager)).ToList(); + + for (int i = 0; i < unityTextures.Count; ++i) + { + var unityTexture = unityTextures[i]; + TextureIO.ExportTexture(gltf, bufferIndex, TextureManager.GetExportTexture(i), unityTexture.TextureType); + } + } #endregion } } diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs new file mode 100644 index 0000000..bd8e694 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs @@ -0,0 +1,172 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_materials_particle +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + + #region Enums + + /// Image Type + public enum SkyboxImageType + { + /// 360 Degrees + Degrees360 = 0, + /// 180 Degrees + Degrees180 = 1, + } + + /// 3D Layout + public enum SkyboxLayout + { + /// None + None = 0, + /// Side by Side + SideBySide = 1, + /// Over Under + OverUnder = 2, + } + + /// Mapping + public enum SkyboxMapping + { + /// 6 Frames Layout + SixFramesLayout = 0, + /// Latitude Longitude Layout + LatitudeLongitudeLayout = 1, + } + + /// Sun + public enum SkyboxSunDisk + { + /// None + None = 0, + /// Simple + Simple = 1, + /// High Quality + HighQuality = 2, + } + + #endregion + + /// + /// Skybox shader properties + /// + [Serializable] + [JsonObject("material.extensions.VGO_materials_skybox")] + public class VGO_materials_skybox + { + /// + [JsonProperty("sunDisk", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(SkyboxSunDisk.None)] + public SkyboxSunDisk sunDisk = SkyboxSunDisk.None; + + /// + [JsonProperty("sunSize", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + //[Range(0.0f, 1.0f)] + public float sunSize = -1.0f; + + /// + [JsonProperty("sunSizeConvergence", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + //[Range(1f, 10f)] + public int sunSizeConvergence = -1; + + /// + [JsonProperty("atmosphereThickness", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + //[Range(0.0f, 5.0f)] + public float atmosphereThickness = -1.0f; + + /// + [JsonProperty("tint")] + public float[] tint; + + /// + [JsonProperty("skyTint")] + public float[] skyTint; + + /// + [JsonProperty("groundColor")] + public float[] groundColor; + + /// + [JsonProperty("exposure", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + //[Range(0.0f, 8.0f)] + public float exposure = -1.0f; + + /// + [JsonProperty("rotation", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + //[Range(0f, 360f)] + public int rotation = -1; + + /// + [JsonProperty("frontTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int frontTexIndex = -1; + + /// + [JsonProperty("backTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int backTexIndex = -1; + + /// + [JsonProperty("leftTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int leftTexIndex = -1; + + /// + [JsonProperty("rightTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int rightTexIndex = -1; + + /// + [JsonProperty("upTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int upTexIndex = -1; + + /// + [JsonProperty("downTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int downTexIndex = -1; + + /// + [JsonProperty("texIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int texIndex = -1; + + /// + [JsonProperty("mainTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int mainTexIndex = -1; + + /// + [JsonProperty("mapping", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(SkyboxMapping.SixFramesLayout)] + public SkyboxMapping mapping = SkyboxMapping.SixFramesLayout; + + /// + [JsonProperty("imageType", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(SkyboxImageType.Degrees360)] + public SkyboxImageType imageType = SkyboxImageType.Degrees360; + + /// + [JsonProperty("mirrorOnBack", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(false)] + public bool mirrorOnBack; + + /// + [JsonProperty("layout", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(SkyboxLayout.None)] + public SkyboxLayout layout = SkyboxLayout.None; + + [JsonIgnore] + public static string ExtensionName => "VGO_materials_skybox"; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs.meta new file mode 100644 index 0000000..3bb8af0 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_skybox.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3c9a9db073954b419f58606da46a25b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/glTFMaterial_extensions.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/glTFMaterial_extensions.cs index b72326b..0dcbce1 100644 --- a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/glTFMaterial_extensions.cs +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/glTFMaterial_extensions.cs @@ -22,6 +22,10 @@ public class glTFMaterial_extensions [JsonProperty("VGO_materials_particle")] public VGO_materials_particle VGO_materials_particle = null; + /// + [JsonProperty("VGO_materials_skybox")] + public VGO_materials_skybox VGO_materials_skybox = null; + /// [JsonProperty("KHR_materials_unlit")] public KHR_materials_unlit KHR_materials_unlit = null; diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs new file mode 100644 index 0000000..256003b --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs @@ -0,0 +1,78 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_Skybox +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + using UnityEngine; + + /// + /// glTF Node VGO Skybox + /// + [Serializable] + [JsonObject("node.vgo.skybox")] + public class VGO_Skybox + { + #region Fields + + /// Material Index + [JsonProperty("materialIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int materialIndex = -1; + + #endregion + + #region Constructors + + /// + /// Create a new instance of VGO_Skybox. + /// + public VGO_Skybox() { } + + /// + /// Create a new instance of VGO_Skybox by specifying Skybox and glTF. + /// + /// + /// + public VGO_Skybox(Skybox skybox, glTF gltf) + { + if (skybox == null) + { + return; + } + + if (gltf == null) + { + return; + } + + if (skybox.material == null) + { + return; + } + + if (gltf.materials == null) + { + return; + } + + string skyboxMaterialName = skybox.material.name; + + for (int index = 0; index < gltf.materials.Count; index++) + { + if (gltf.materials[index].name == skyboxMaterialName) + { + materialIndex = index; + + break; + } + } + } + + #endregion + + } +} \ No newline at end of file diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs.meta new file mode 100644 index 0000000..8804f82 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Skybox.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90ba55a92da9bb14bbd930e0308adaa1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_nodes.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_nodes.cs index 86e0623..b493a6c 100644 --- a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_nodes.cs +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_nodes.cs @@ -39,6 +39,10 @@ public class VGO_nodes [JsonProperty("right")] public glTF_VGO_Right right = null; + /// Skybox + [JsonProperty("skybox")] + public VGO_Skybox skybox = null; + /// [JsonIgnore] public static string ExtensionName => "VGO_nodes"; diff --git a/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs b/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs index 7337a7d..2f4d2c6 100644 --- a/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs +++ b/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs @@ -98,6 +98,16 @@ protected override JsonContract CreateContract(Type objectType) contract.Converter = new StringEnumConverter(new DefaultNamingStrategy(), allowIntegerValues: false); } + // Shader Properties (Skybox) + if ((objectType == typeof(SkyboxImageType)) || + (objectType == typeof(SkyboxLayout)) || + (objectType == typeof(SkyboxMapping)) || + (objectType == typeof(SkyboxSunDisk)) + ) + { + contract.Converter = new StringEnumConverter(new DefaultNamingStrategy(), allowIntegerValues: false); + } + // Shader Properties (MToon) if ((objectType == typeof(MToonCullMode)) || (objectType == typeof(MToonOutlineColorMode)) || diff --git a/UniSkybox.meta b/UniSkybox.meta new file mode 100644 index 0000000..87717b5 --- /dev/null +++ b/UniSkybox.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1575b534c12265049b3a5c5dac2ed851 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/LICENSE.md b/UniSkybox/LICENSE.md new file mode 100644 index 0000000..8da95f2 --- /dev/null +++ b/UniSkybox/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Izayoi Jiichan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/UniSkybox/LICENSE.md.meta b/UniSkybox/LICENSE.md.meta new file mode 100644 index 0000000..fdcd6d4 --- /dev/null +++ b/UniSkybox/LICENSE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2f7b1139f0173c4439dfeabd9fb69e96 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime.meta b/UniSkybox/Runtime.meta new file mode 100644 index 0000000..6d2db0b --- /dev/null +++ b/UniSkybox/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c69c8c3fd9a0f8469b98cc40afcd8cb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/Enums.cs b/UniSkybox/Runtime/Enums.cs new file mode 100644 index 0000000..96181c8 --- /dev/null +++ b/UniSkybox/Runtime/Enums.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : +// ---------------------------------------------------------------------- +namespace UniSkybox +{ + /// Image Type + public enum ImageType + { + /// 360 Degrees + Degrees360 = 0, + /// 180 Degrees + Degrees180 = 1, + } + + /// 3D Layout + public enum Layout + { + /// None + None = 0, + /// Side by Side + SideBySide = 1, + /// Over Under + OverUnder = 2, + } + + /// Mapping + public enum Mapping + { + /// 6 Frames Layout + SixFramesLayout = 0, + /// Latitude Longitude Layout + LatitudeLongitudeLayout = 1, + } + + /// Sun + public enum SunDisk + { + /// None + None = 0, + /// Simple + Simple = 1, + /// High Quality + HighQuality = 2, + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/Enums.cs.meta b/UniSkybox/Runtime/Enums.cs.meta new file mode 100644 index 0000000..8af3c65 --- /dev/null +++ b/UniSkybox/Runtime/Enums.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d765b0925a7358e499aa0685dad83b7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/Skybox6SidedDefinition.cs b/UniSkybox/Runtime/Skybox6SidedDefinition.cs new file mode 100644 index 0000000..1997bf3 --- /dev/null +++ b/UniSkybox/Runtime/Skybox6SidedDefinition.cs @@ -0,0 +1,43 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : Skybox6SidedDefinition +// ---------------------------------------------------------------------- +namespace UniSkybox +{ + using UnityEngine; + + /// + /// Skybox 6 Sided Definition + /// + public class Skybox6SidedDefinition + { + /// Tint Color + public Color Tint { get; set; } + + /// Exposure + //[Range(0.0f, 8.0f)] + public float Exposure { get; set; } + + /// Rotation + //[Range(0f, 360f)] + public int Rotation { get; set; } + + /// Front [+Z] (HDR) + public Texture2D FrontTex { get; set; } + + /// Back [-Z] (HDR) + public Texture2D BackTex { get; set; } + + /// Left [+X] (HDR) + public Texture2D LeftTex { get; set; } + + /// Right [-X] (HDR) + public Texture2D RightTex { get; set; } + + /// Up [+Y] (HDR) + public Texture2D UpTex { get; set; } + + /// Down [-Y] (HDR) + public Texture2D DownTex { get; set; } + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/Skybox6SidedDefinition.cs.meta b/UniSkybox/Runtime/Skybox6SidedDefinition.cs.meta new file mode 100644 index 0000000..ab53847 --- /dev/null +++ b/UniSkybox/Runtime/Skybox6SidedDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04fb74680a1c0ca4f96dd4c239ff3ea6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/SkyboxCubemapDefinition.cs b/UniSkybox/Runtime/SkyboxCubemapDefinition.cs new file mode 100644 index 0000000..d5552a7 --- /dev/null +++ b/UniSkybox/Runtime/SkyboxCubemapDefinition.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : SkyboxCubemapDefinition +// ---------------------------------------------------------------------- +namespace UniSkybox +{ + using UnityEngine; + + /// + /// Skybox Cubemap Definition + /// + public class SkyboxCubemapDefinition + { + /// Tint Color + public Color Tint { get; set; } + + /// Exposure + //[Range(0.0f, 8.0f)] + public float Exposure { get; set; } + + /// Rotation + //[Range(0f, 360f)] + public int Rotation { get; set; } + + /// Cubemap (HDR) + public Cubemap Tex { get; set; } + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/SkyboxCubemapDefinition.cs.meta b/UniSkybox/Runtime/SkyboxCubemapDefinition.cs.meta new file mode 100644 index 0000000..d163627 --- /dev/null +++ b/UniSkybox/Runtime/SkyboxCubemapDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef29b8ad52fc43e49a3e3454a710a915 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/SkyboxPanoramicDefinition.cs b/UniSkybox/Runtime/SkyboxPanoramicDefinition.cs new file mode 100644 index 0000000..c021c21 --- /dev/null +++ b/UniSkybox/Runtime/SkyboxPanoramicDefinition.cs @@ -0,0 +1,40 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : SkyboxPanoramicDefinition +// ---------------------------------------------------------------------- +namespace UniSkybox +{ + using UnityEngine; + + /// + /// Skybox Panoramic Definition + /// + public class SkyboxPanoramicDefinition + { + /// Tint Color + public Color Tint { get; set; } + + /// Exposure + //[Range(0.0f, 8.0f)] + public float Exposure { get; set; } + + /// Rotation + //[Range(0f, 360f)] + public int Rotation { get; set; } + + /// Spherical (HDR) + public Texture2D MainTex { get; set; } + + /// Mapping + public Mapping Mapping { get; set; } + + /// Image Type + public ImageType ImageType { get; set; } + + /// Mirror on Back + public bool MirrorOnBack { get; set; } + + /// 3D Layout + public Layout Layout { get; set; } + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/SkyboxPanoramicDefinition.cs.meta b/UniSkybox/Runtime/SkyboxPanoramicDefinition.cs.meta new file mode 100644 index 0000000..0d69988 --- /dev/null +++ b/UniSkybox/Runtime/SkyboxPanoramicDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8992f93ce611a94aabe0d55d8386837 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/SkyboxProceduralDefinition.cs b/UniSkybox/Runtime/SkyboxProceduralDefinition.cs new file mode 100644 index 0000000..958cfb2 --- /dev/null +++ b/UniSkybox/Runtime/SkyboxProceduralDefinition.cs @@ -0,0 +1,39 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : SkyboxProceduralDefinition +// ---------------------------------------------------------------------- +namespace UniSkybox +{ + using UnityEngine; + + /// + /// Skybox Procedural Definition + /// + public class SkyboxProceduralDefinition + { + /// Sun + public SunDisk SunDisk { get; set; } + + /// Sun Size + //[Range(0.0f, 1.0f)] + public float SunSize { get; set; } + + /// Sun Size Convergence + //[Range(1f, 10f)] + public int SunSizeConvergence { get; set; } + + /// Atmosphere Thickness + //[Range(0.0f, 5.0f)] + public float AtmosphereThickness { get; set; } + + /// Sky Tint + public Color SkyTint { get; set; } + + /// Ground + public Color GroundColor { get; set; } + + /// Exposure + //[Range(0.0f, 8.0f)] + public float Exposure { get; set; } + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/SkyboxProceduralDefinition.cs.meta b/UniSkybox/Runtime/SkyboxProceduralDefinition.cs.meta new file mode 100644 index 0000000..038c12e --- /dev/null +++ b/UniSkybox/Runtime/SkyboxProceduralDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6675c17baee2674997819b4a24c7a0d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/UniSkybox.asmdef b/UniSkybox/Runtime/UniSkybox.asmdef new file mode 100644 index 0000000..7592369 --- /dev/null +++ b/UniSkybox/Runtime/UniSkybox.asmdef @@ -0,0 +1,3 @@ +{ + "name": "UniSkybox" +} diff --git a/UniSkybox/Runtime/UniSkybox.asmdef.meta b/UniSkybox/Runtime/UniSkybox.asmdef.meta new file mode 100644 index 0000000..7b370c5 --- /dev/null +++ b/UniSkybox/Runtime/UniSkybox.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ad1ca99d2017b2b478b3554ba07a7b2f +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/Utils.cs b/UniSkybox/Runtime/Utils.cs new file mode 100644 index 0000000..da77388 --- /dev/null +++ b/UniSkybox/Runtime/Utils.cs @@ -0,0 +1,145 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : Utils +// ---------------------------------------------------------------------- +using System; + +namespace UniSkybox +{ + /// + /// + /// + public static partial class Utils + { + #region ShaderNames + + /// Skybox/6 Sided + public const string ShaderNameSkybox6Sided = "Skybox/6 Sided"; + + /// Skybox/Cubemap + public const string ShaderNameSkyboxCubemap = "Skybox/Cubemap"; + + /// Skybox/Panoramic + public const string ShaderNameSkyboxPanoramic = "Skybox/Panoramic"; + + /// Skybox/Procedural + public const string ShaderNameSkyboxProcedural = "Skybox/Procedural"; + + #endregion + + #region Types + + /// Skybox/6 Sided + public static Type Skybox6SidedDefinitionType = typeof(Skybox6SidedDefinition); + + /// Skybox/Cubemap + public static Type SkyboxCubemapDefinitionType = typeof(SkyboxCubemapDefinition); + + /// Skybox/Panoramic + public static Type SkyboxPanoramicDefinitionType = typeof(SkyboxPanoramicDefinition); + + /// Skybox/Procedural + public static Type SkyboxProceduralDefinitionType = typeof(SkyboxProceduralDefinition); + + #endregion + + #region Properties + + /// Tint + public const string PropTint= "_Tint"; + + /// Exposure + public const string PropExposure = "_Exposure"; + + /// Rotation + public const string PropRotation = "_Rotation"; + + #endregion + + #region Properties (6 Sided) + + /// FrontTex + public const string PropFrontTex = "_FrontTex"; + + /// BackTex + public const string PropBackTex = "_BackTex"; + + /// LeftTex + public const string PropLeftTex = "_LeftTex"; + + /// RightTex + public const string PropRightTex = "_RightTex"; + + /// UpTex + public const string PropUpTex = "_UpTex"; + + /// DownTex + public const string PropDownTex = "_DownTex"; + + #endregion + + #region Properties (Cubemap) + + /// Tex + public const string PropTex = "_Tex"; + + #endregion + + #region Properties (Panoramic) + + /// MainTex + public const string PropMainTex = "_MainTex"; + + /// Mapping + public const string PropMapping = "_Mapping"; + + /// ImageType + public const string PropImageType = "_ImageType"; + + /// MirrorOnBack + public const string PropMirrorOnBack = "_MirrorOnBack"; + + /// Layout + public const string PropLayout = "_Layout"; + + #endregion + + #region Properties (Procedural) + + /// + public const string PropSunDisk = "_SunDisk"; + + /// + public const string PropSunSize = "_SunSize"; + + /// + public const string PropSunSizeConvergence = "_SunSizeConvergence"; + + /// + public const string PropAtmosphereThickness = "_AtmosphereThickness"; + + /// + public const string PropSkyTint = "_SkyTint"; + + /// + public const string PropGroundColor = "_GroundColor"; + + #endregion + + #region Keywords + + /// Layout + public const string KeyMapping6FramesLayout = "_MAPPING_6_FRAMES_LAYOUT"; + + /// SunDisk None + public const string KeySundiskNone = "_SUNDISK_NONE"; + + /// SunDisk Simple + public const string KeySundiskSimple = "_SUNDISK_SIMPLE"; + + /// SunDisk High Quality + public const string KeySundiskHighQuality = "_SUNDISK_HIGH_QUALITY"; + + #endregion + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/Utils.cs.meta b/UniSkybox/Runtime/Utils.cs.meta new file mode 100644 index 0000000..75a657c --- /dev/null +++ b/UniSkybox/Runtime/Utils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9ac09e2c03de39c49b4dc478595fa92f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/UtilsGetter.cs b/UniSkybox/Runtime/UtilsGetter.cs new file mode 100644 index 0000000..29d4ce7 --- /dev/null +++ b/UniSkybox/Runtime/UtilsGetter.cs @@ -0,0 +1,317 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : Utils +// ---------------------------------------------------------------------- +namespace UniSkybox +{ + using System; + using UnityEngine; + + public static partial class Utils + { + /// + /// + /// + /// + /// + /// + public static T GetParametersFromMaterial(Material material) where T : class + { + Type type = typeof(T); + + if (type == Skybox6SidedDefinitionType) + { + return GetSkybox6SidedParametersFromMaterial(material) as T; + } + else if (type == SkyboxCubemapDefinitionType) + { + return GetSkyboxCubemapParametersFromMaterial(material) as T; + } + else if (type == SkyboxPanoramicDefinitionType) + { + return GetSkyboxPanoramicParametersFromMaterial(material) as T; + } + else if (type == SkyboxProceduralDefinitionType) + { + return GetSkyboxProceduralParametersFromMaterial(material) as T; + } + else + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + /// + /// + private static Skybox6SidedDefinition GetSkybox6SidedParametersFromMaterial(Material material) + { + return new Skybox6SidedDefinition + { + Tint = GetColor(material, PropTint), + Exposure = GetFloat(material, PropExposure), + Rotation = GetInt(material, PropRotation), + FrontTex = GetTexture(material, PropFrontTex), + BackTex = GetTexture(material, PropBackTex), + LeftTex = GetTexture(material, PropLeftTex), + RightTex = GetTexture(material, PropRightTex), + UpTex = GetTexture(material, PropUpTex), + DownTex = GetTexture(material, PropDownTex), + }; + } + + /// + /// + /// + /// + /// + private static SkyboxCubemapDefinition GetSkyboxCubemapParametersFromMaterial(Material material) + { + return new SkyboxCubemapDefinition + { + Tint = GetColor(material, PropTint), + Exposure = GetFloat(material, PropExposure), + Rotation = GetInt(material, PropRotation), + Tex = GetCubemap(material, PropTex), + }; + } + + /// + /// + /// + /// + /// + private static SkyboxPanoramicDefinition GetSkyboxPanoramicParametersFromMaterial(Material material) + { + return new SkyboxPanoramicDefinition + { + Tint = GetColor(material, PropTint), + Exposure = GetFloat(material, PropExposure), + Rotation = GetInt(material, PropRotation), + MainTex = GetTexture(material, PropMainTex), + Mapping = GetMapping(material), + ImageType = GetImageType(material), + MirrorOnBack = GetBool(material, PropMirrorOnBack), + Layout = GetLayout(material), + }; + } + + /// + /// + /// + /// + /// + private static SkyboxProceduralDefinition GetSkyboxProceduralParametersFromMaterial(Material material) + { + return new SkyboxProceduralDefinition + { + SunDisk = GetSunDisk(material), + SunSize = GetFloat(material, PropSunSize), + SunSizeConvergence = GetInt(material, PropSunSizeConvergence), + AtmosphereThickness = GetFloat(material, PropAtmosphereThickness), + SkyTint = GetColor(material, PropSkyTint), + GroundColor = GetColor(material, PropGroundColor), + Exposure = GetFloat(material, PropExposure), + }; + } + + /// + /// + /// + /// + /// + /// + private static bool GetBool(Material material, string propertyName) + { + if (material.HasProperty(propertyName)) + { + return material.GetInt(propertyName) == 1; + } + else + { + return false; + } + } + + /// + /// + /// + /// + /// + /// + private static Color GetColor(Material material, string propertyName) + { + if (material.HasProperty(propertyName)) + { + return material.GetColor(propertyName); + } + else + { + return default; + } + } + + /// + /// + /// + /// + /// + /// + private static float GetFloat(Material material, string propertyName) + { + if (material.HasProperty(propertyName)) + { + return material.GetFloat(propertyName); + } + else + { + return 0.0f; + } + } + + /// + /// + /// + /// + /// + /// + private static int GetInt(Material material, string propertyName) + { + if (material.HasProperty(propertyName)) + { + return material.GetInt(propertyName); + } + else + { + return 0; + } + } + + /// + /// + /// + /// + /// + /// + private static Texture2D GetTexture(Material material, string propertyName) + { + if (material.HasProperty(propertyName)) + { + return (Texture2D)material.GetTexture(propertyName); + } + else + { + return null; + } + } + + /// + /// + /// + /// + /// + /// + private static Cubemap GetCubemap(Material material, string propertyName) + { + if (material.HasProperty(propertyName)) + { + return (Cubemap)material.GetTexture(propertyName); + } + else + { + return null; + } + } + + /// + /// + /// + /// + /// + private static Mapping GetMapping(Material material) + { + if (GetInt(material, PropMapping) == 1) + { + return Mapping.LatitudeLongitudeLayout; + } + else + { + return Mapping.SixFramesLayout; + } + + //if (material.IsKeywordEnabled(KeyMapping6FramesLayout)) + //{ + // return Mapping.SixFramesLayout; + //} + //else + //{ + // return Mapping.LatitudeLongitudeLayout; + //} + } + + /// + /// + /// + /// + /// + private static ImageType GetImageType(Material material) + { + if (GetInt(material, PropImageType) == 1) + { + return ImageType.Degrees180; + } + else + { + return ImageType.Degrees360; + } + } + + /// + /// + /// + /// + /// + private static Layout GetLayout(Material material) + { + int iLayout = GetInt(material, PropLayout); + + if (iLayout == 1) + { + return Layout.SideBySide; + } + if (iLayout == 2) + { + return Layout.OverUnder; + } + else + { + return Layout.None; + } + } + + /// + /// + /// + /// + /// + private static SunDisk GetSunDisk(Material material) + { + int iSunDisk = GetInt(material, PropSunDisk); + + if (iSunDisk == 1) + { + return SunDisk.Simple; + } + if (iSunDisk == 2) + { + return SunDisk.HighQuality; + } + else + { + return SunDisk.None; + } + } + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/UtilsGetter.cs.meta b/UniSkybox/Runtime/UtilsGetter.cs.meta new file mode 100644 index 0000000..be8d702 --- /dev/null +++ b/UniSkybox/Runtime/UtilsGetter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c839e511d7839454f8ee8961e7b39168 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniSkybox/Runtime/UtilsSetter.cs b/UniSkybox/Runtime/UtilsSetter.cs new file mode 100644 index 0000000..1845d11 --- /dev/null +++ b/UniSkybox/Runtime/UtilsSetter.cs @@ -0,0 +1,245 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniSkybox +// @Class : Utils +// ---------------------------------------------------------------------- +namespace UniSkybox +{ + using System; + using UnityEngine; + + public static partial class Utils + { + /// + /// + /// + /// + /// + /// + public static void SetParametersToMaterial(Material material, T parameters) + { + Type type = typeof(T); + + if (type == Skybox6SidedDefinitionType) + { + SetSkybox6SidedParametersToMaterial(material, parameters as Skybox6SidedDefinition); + } + else if (type == SkyboxCubemapDefinitionType) + { + SetSkyboxCubemapParametersToMaterial(material, parameters as SkyboxCubemapDefinition); + } + else if (type == SkyboxPanoramicDefinitionType) + { + SetSkyboxPanoramicParametersToMaterial(material, parameters as SkyboxPanoramicDefinition); + } + else if (type == SkyboxProceduralDefinitionType) + { + SetSkyboxProceduralParametersToMaterial(material, parameters as SkyboxProceduralDefinition); + } + else + { + throw new NotSupportedException(); + } + } + + /// + /// + /// + /// + /// + private static void SetSkybox6SidedParametersToMaterial(Material material, Skybox6SidedDefinition parameters) + { + SetColor(material, PropTint, parameters.Tint); + SetFloat(material, PropExposure, parameters.Exposure); + SetInt(material, PropRotation, parameters.Rotation); + SetTexture(material, PropFrontTex, parameters.FrontTex); + SetTexture(material, PropBackTex, parameters.BackTex); + SetTexture(material, PropLeftTex, parameters.LeftTex); + SetTexture(material, PropRightTex, parameters.RightTex); + SetTexture(material, PropUpTex, parameters.UpTex); + SetTexture(material, PropDownTex, parameters.DownTex); + } + + /// + /// + /// + /// + /// + private static void SetSkyboxCubemapParametersToMaterial(Material material, SkyboxCubemapDefinition parameters) + { + SetColor(material, PropTint, parameters.Tint); + SetFloat(material, PropExposure, parameters.Exposure); + SetInt(material, PropRotation, parameters.Rotation); + SetCubemap(material, PropTex, parameters.Tex); + } + + /// + /// + /// + /// + /// + private static void SetSkyboxPanoramicParametersToMaterial(Material material, SkyboxPanoramicDefinition parameters) + { + SetColor(material, PropTint, parameters.Tint); + SetFloat(material, PropExposure, parameters.Exposure); + SetInt(material, PropRotation, parameters.Rotation); + SetTexture(material, PropMainTex, parameters.MainTex); + SetInt(material, PropMapping, (int)parameters.Mapping); + SetKeyword(material, KeyMapping6FramesLayout, parameters.Mapping == Mapping.SixFramesLayout); + SetInt(material, PropImageType, (int)parameters.ImageType); + SetBool(material, PropMirrorOnBack, parameters.MirrorOnBack); + SetInt(material, PropLayout, (int)parameters.Layout); + } + + /// + /// + /// + /// + /// + private static void SetSkyboxProceduralParametersToMaterial(Material material, SkyboxProceduralDefinition parameters) + { + SetSunDisk(material, parameters.SunDisk); + SetFloat(material, PropSunSize, parameters.SunSize); + SetInt(material, PropSunSizeConvergence, parameters.SunSizeConvergence); + SetFloat(material, PropAtmosphereThickness, parameters.AtmosphereThickness); + SetColor(material, PropSkyTint, parameters.SkyTint); + SetColor(material, PropGroundColor, parameters.GroundColor); + SetFloat(material, PropExposure, parameters.Exposure); + } + + /// + /// + /// + /// + /// + /// + private static void SetBool(Material material, string propertyName, bool val) + { + if (material.HasProperty(propertyName)) + { + material.SetInt(propertyName, (val == true) ? 1 : 0); + } + } + + /// + /// + /// + /// + /// + /// + private static void SetInt(Material material, string propertyName, int val) + { + if (material.HasProperty(propertyName)) + { + material.SetInt(propertyName, val); + } + } + + /// + /// + /// + /// + /// + /// + private static void SetFloat(Material material, string propertyName, float val) + { + if (material.HasProperty(propertyName)) + { + material.SetFloat(propertyName, val); + } + } + + /// + /// + /// + /// + /// + /// + private static void SetColor(Material material, string propertyName, Color color) + { + if (material.HasProperty(propertyName)) + { + material.SetColor(propertyName, color); + } + } + + /// + /// + /// + /// + /// + /// + private static void SetTexture(Material material, string propertyName, Texture2D texture) + { + if (material.HasProperty(propertyName)) + { + material.SetTexture(propertyName, texture); + } + } + + /// + /// + /// + /// + /// + /// + private static void SetCubemap(Material material, string propertyName, Cubemap cubemap) + { + if (material.HasProperty(propertyName)) + { + material.SetTexture(propertyName, cubemap); + } + } + + /// + /// + /// + /// + /// + /// + private static void SetKeyword(Material material, string keyword, bool required) + { + if (required) + { + material.EnableKeyword(keyword); + } + else + { + material.DisableKeyword(keyword); + } + } + + /// + /// + /// + /// + /// + public static void SetSunDisk(Material material, SunDisk sunDisk) + { + SetInt(material, PropSunDisk, (int)sunDisk); + + switch (sunDisk) + { + case SunDisk.None: + SetKeyword(material, KeySundiskNone, true); + SetKeyword(material, KeySundiskSimple, false); + SetKeyword(material, KeySundiskHighQuality, false); + break; + case SunDisk.Simple: + SetKeyword(material, KeySundiskNone, false); + SetKeyword(material, KeySundiskSimple, true); + SetKeyword(material, KeySundiskHighQuality, false); + break; + case SunDisk.HighQuality: + SetKeyword(material, KeySundiskNone, false); + SetKeyword(material, KeySundiskSimple, false); + SetKeyword(material, KeySundiskHighQuality, true); + break; + default: + SetKeyword(material, KeySundiskNone, true); + SetKeyword(material, KeySundiskSimple, false); + SetKeyword(material, KeySundiskHighQuality, false); + break; + } + } + } +} \ No newline at end of file diff --git a/UniSkybox/Runtime/UtilsSetter.cs.meta b/UniSkybox/Runtime/UtilsSetter.cs.meta new file mode 100644 index 0000000..f4fb685 --- /dev/null +++ b/UniSkybox/Runtime/UtilsSetter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6bd6580bf91ee7347a53a4099af6b172 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/IO/VgoExporter.cs b/UniVgo/Runtime/IO/VgoExporter.cs index 97227ab..63c436a 100644 --- a/UniVgo/Runtime/IO/VgoExporter.cs +++ b/UniVgo/Runtime/IO/VgoExporter.cs @@ -25,6 +25,7 @@ protected override IEnumerable ExtensionUsed VGO_nodes.ExtensionName, VGO_materials.ExtensionName, VGO_materials_particle.ExtensionName, + VGO_materials_skybox.ExtensionName, KHR_materials_unlit.ExtensionName, VRMC_materials_mtoon.ExtensionName, }; @@ -39,6 +40,7 @@ protected override IEnumerable ExtensionsRequired VGO_nodes.ExtensionName, VGO_materials.ExtensionName, VGO_materials_particle.ExtensionName, + VGO_materials_skybox.ExtensionName, KHR_materials_unlit.ExtensionName, VRMC_materials_mtoon.ExtensionName, }; @@ -87,6 +89,37 @@ public override void Export() SetExtensions(); } + /// + /// + /// + /// + /// + /// + protected override void FromGameObjectMaterialsAndTextures(glTF gltf, GameObject go, int bufferIndex) + { + Materials = Nodes.SelectMany(x => x.GetSharedMaterials()).Where(x => x != null).Distinct().ToList(); + + var skybox = go.GetComponentInChildren(); + + if (skybox != null) + { + Materials.Add(skybox.material); + } + + var unityTextures = Materials.SelectMany(x => TextureIO.GetTextures(x)).Where(x => x.Texture != null).Distinct().ToList(); + + TextureManager = new TextureExportManager(unityTextures.Select(x => x.Texture)); + + var materialExporter = CreateMaterialExporter(); + gltf.materials = Materials.Select(x => materialExporter.ExportMaterial(x, TextureManager)).ToList(); + + for (int i = 0; i < unityTextures.Count; ++i) + { + var unityTexture = unityTextures[i]; + TextureIO.ExportTexture(gltf, bufferIndex, TextureManager.GetExportTexture(i), unityTexture.TextureType); + } + } + /// /// Set the extensions. /// @@ -200,6 +233,14 @@ protected virtual void SetGltfNodeExtensions(glTFNode gltfNode, GameObject srcNo existsData = true; } + // vgo.skybox + if (srcNode.TryGetComponentEx(out Skybox skybox)) + { + nodeVgo.skybox = new VGO_Skybox(skybox, glTF); + + existsData = true; + } + if (existsData) { if (gltfNode.extensions == null) diff --git a/UniVgo/Runtime/IO/VgoImporter.cs b/UniVgo/Runtime/IO/VgoImporter.cs index a1c0185..4788dfd 100644 --- a/UniVgo/Runtime/IO/VgoImporter.cs +++ b/UniVgo/Runtime/IO/VgoImporter.cs @@ -4,6 +4,7 @@ // ---------------------------------------------------------------------- namespace UniVgo { + using System.Collections.Generic; using UniGLTFforUniVgo; using UnityEngine; @@ -124,10 +125,57 @@ protected virtual void SetupChildComponent(GameObject go, glTFNode gltfNode) { go.AddComponent(nodeVGO.right); } + + // VgoSkybox + if (nodeVGO.skybox != null) + { + var skybox = go.AddComponent(); + + List materials = GetMaterials() as List; + + if (materials != null) + { + int vgoMaterialIndex = nodeVGO.skybox.materialIndex; + + if ((0 <= vgoMaterialIndex) && (vgoMaterialIndex < materials.Count)) + { + skybox.material = materials[vgoMaterialIndex]; + } + } + } } } } + /// + /// + /// + /// + /// + public override void OnLoadModelAfter(bool showMeshes = false, bool enableUpdateWhenOffscreen = false) + { + base.OnLoadModelAfter(showMeshes, enableUpdateWhenOffscreen); + + ReflectSkybox(); + } + + /// + /// Reflect VGO skybox to Camaera skybox. + /// + protected virtual void ReflectSkybox() + { + var vgoSkybox = Root.GetComponentInChildren(includeInactive: false); + + if (vgoSkybox != null) + { + GameObject mainCameraGameObject = Camera.main.gameObject; + + var cameraSkybox = mainCameraGameObject.GetOrAddComponent(); + + cameraSkybox.material = vgoSkybox.material; + } + } + #endregion } } \ No newline at end of file diff --git a/UniVgo/Runtime/IO/VgoMaterialExporter.cs b/UniVgo/Runtime/IO/VgoMaterialExporter.cs index cc8756f..424d569 100644 --- a/UniVgo/Runtime/IO/VgoMaterialExporter.cs +++ b/UniVgo/Runtime/IO/VgoMaterialExporter.cs @@ -6,8 +6,9 @@ namespace UniVgo { using MToon; using UniGLTFforUniVgo; - using UnityEngine; + using UniSkybox; using UniStandardParticle; + using UnityEngine; /// /// VGO Material Exporter @@ -30,6 +31,12 @@ public override glTFMaterial ExportMaterial(Material m, TextureExportManager tex case ShaderName.Particles_Standard_Unlit: return CreateParticleMaterial(m, textureManager); + case ShaderName.Skybox_6_Sided: + case ShaderName.Skybox_Cubemap: + case ShaderName.Skybox_Panoramic: + case ShaderName.Skybox_Procedural: + return CreateSkyboxMaterial(m, textureManager); + case ShaderName.VRM_MToon: return CreateVrmMtoonMaterial(m, textureManager); @@ -231,6 +238,110 @@ protected virtual glTFMaterial CreateParticleMaterial(Material m, TextureExportM return material; } + /// + /// Create a Skybox material. + /// + /// + /// + /// + protected virtual glTFMaterial CreateSkyboxMaterial(Material m, TextureExportManager textureManager) + { + VGO_materials_skybox vgoSkybox; + + switch (m.shader.name) + { + case ShaderName.Skybox_6_Sided: + { + Skybox6SidedDefinition skyboxDefinition = UniSkybox.Utils.GetParametersFromMaterial(m); + + vgoSkybox = new VGO_materials_skybox() + { + tint = skyboxDefinition.Tint.linear.ToArray(), + exposure = skyboxDefinition.Exposure, + rotation = skyboxDefinition.Rotation, + frontTexIndex = textureManager.CopyAndGetIndex(skyboxDefinition.FrontTex, RenderTextureReadWrite.sRGB), + backTexIndex = textureManager.CopyAndGetIndex(skyboxDefinition.BackTex, RenderTextureReadWrite.sRGB), + leftTexIndex = textureManager.CopyAndGetIndex(skyboxDefinition.LeftTex, RenderTextureReadWrite.sRGB), + rightTexIndex = textureManager.CopyAndGetIndex(skyboxDefinition.RightTex, RenderTextureReadWrite.sRGB), + upTexIndex = textureManager.CopyAndGetIndex(skyboxDefinition.UpTex, RenderTextureReadWrite.sRGB), + downTexIndex = textureManager.CopyAndGetIndex(skyboxDefinition.DownTex, RenderTextureReadWrite.sRGB), + }; + } + break; + + case ShaderName.Skybox_Cubemap: // @todo Tex (Cubemap) + { + SkyboxCubemapDefinition skyboxDefinition = UniSkybox.Utils.GetParametersFromMaterial(m); + + vgoSkybox = new VGO_materials_skybox() + { + tint = skyboxDefinition.Tint.linear.ToArray(), + exposure = skyboxDefinition.Exposure, + rotation = skyboxDefinition.Rotation, + texIndex = textureManager.CopyAndGetIndex(skyboxDefinition.Tex, RenderTextureReadWrite.sRGB), + }; + } + break; + + case ShaderName.Skybox_Panoramic: + { + SkyboxPanoramicDefinition skyboxDefinition = UniSkybox.Utils.GetParametersFromMaterial(m); + + vgoSkybox = new VGO_materials_skybox() + { + tint = skyboxDefinition.Tint.linear.ToArray(), + exposure = skyboxDefinition.Exposure, + rotation = skyboxDefinition.Rotation, + mainTexIndex = textureManager.CopyAndGetIndex(skyboxDefinition.MainTex, RenderTextureReadWrite.sRGB), + mapping = (SkyboxMapping)skyboxDefinition.Mapping, + imageType = (SkyboxImageType)skyboxDefinition.ImageType, + mirrorOnBack = skyboxDefinition.MirrorOnBack, + layout = (SkyboxLayout)skyboxDefinition.Layout, + }; + } + break; + + case ShaderName.Skybox_Procedural: + { + SkyboxProceduralDefinition skyboxDefinition = UniSkybox.Utils.GetParametersFromMaterial(m); + + vgoSkybox = new VGO_materials_skybox() + { + sunDisk = (SkyboxSunDisk)skyboxDefinition.SunDisk, + sunSize = skyboxDefinition.SunSize, + sunSizeConvergence = skyboxDefinition.SunSizeConvergence, + atmosphereThickness = skyboxDefinition.AtmosphereThickness, + skyTint = skyboxDefinition.SkyTint.linear.ToArray(), + groundColor = skyboxDefinition.GroundColor.linear.ToArray(), + exposure = skyboxDefinition.Exposure, + }; + } + break; + + default: + throw new UniGLTFNotSupportedException(m.shader.name); + } + + var material = new glTFMaterial(); + + material.name = m.name; + + // PBR Metallic Roughness + if (material.pbrMetallicRoughness == null) + { + material.pbrMetallicRoughness = new glTFPbrMetallicRoughness(); + } + + // extensions + material.extensions = new glTFMaterial_extensions() + { + VGO_materials = new VGO_materials(m.shader.name), + VGO_materials_skybox = vgoSkybox, + }; + + return material; + } + /// /// Create a VRM default material. /// diff --git a/UniVgo/Runtime/IO/VgoMaterialImporter.cs b/UniVgo/Runtime/IO/VgoMaterialImporter.cs index 09950b4..f216ed0 100644 --- a/UniVgo/Runtime/IO/VgoMaterialImporter.cs +++ b/UniVgo/Runtime/IO/VgoMaterialImporter.cs @@ -5,11 +5,11 @@ namespace UniVgo { using MToon; - using System.Collections.Generic; using UniGLTFforUniVgo; + using UniSkybox; + using UniStandardParticle; using UnityEngine; using UnityEngine.Rendering; - using UniStandardParticle; /// /// VGO Material Importer @@ -45,6 +45,10 @@ public override Material CreateMaterial(int i, glTFMaterial src, bool hasVertexC { return CreateParticleMaterial(i, src); } + if (src.extensions.VGO_materials_skybox != null) + { + return CreateSkyboxMaterial(i, src); + } if (src.extensions.KHR_materials_unlit != null) { return CreateUnlitMaterial(i, src, hasVertexColor); @@ -127,6 +131,87 @@ protected virtual ParticleDefinition CreateParticleDefinition(VGO_materials_part return particleDefinition; } + /// + /// Create a Skybox material. + /// + /// + /// + /// + protected virtual Material CreateSkyboxMaterial(int i, glTFMaterial src) + { + var shader = m_shaderStore.GetShader(src); + + Material material = new Material(shader); + + material.name = CreateMaterialName(i, src); + +#if UNITY_EDITOR + material.hideFlags = HideFlags.DontUnloadUnusedAsset; +#endif + + VGO_materials_skybox vgoSkybox = src.extensions.VGO_materials_skybox; + + switch (shader.name) + { + case ShaderName.Skybox_6_Sided: + UniSkybox.Utils.SetParametersToMaterial(material, new Skybox6SidedDefinition() + { + Tint = ArrayConverter.ToColor(vgoSkybox.tint, gamma: true), + Exposure = vgoSkybox.exposure, + Rotation = vgoSkybox.rotation, + FrontTex = GetTexture(UniSkybox.Utils.PropFrontTex, vgoSkybox.frontTexIndex), + BackTex = GetTexture(UniSkybox.Utils.PropBackTex, vgoSkybox.backTexIndex), + LeftTex = GetTexture(UniSkybox.Utils.PropLeftTex, vgoSkybox.leftTexIndex), + RightTex = GetTexture(UniSkybox.Utils.PropRightTex, vgoSkybox.rightTexIndex), + UpTex = GetTexture(UniSkybox.Utils.PropUpTex, vgoSkybox.upTexIndex), + DownTex = GetTexture(UniSkybox.Utils.PropDownTex, vgoSkybox.downTexIndex), + }); + break; + + case ShaderName.Skybox_Cubemap: // @todo Tex (Cubemap) + UniSkybox.Utils.SetParametersToMaterial(material, new SkyboxCubemapDefinition() + { + Tint = ArrayConverter.ToColor(vgoSkybox.tint, gamma: true), + Exposure = vgoSkybox.exposure, + Rotation = vgoSkybox.rotation, + Tex = GetCubemap(UniSkybox.Utils.PropTex, vgoSkybox.texIndex), + }); + break; + + case ShaderName.Skybox_Panoramic: + UniSkybox.Utils.SetParametersToMaterial(material, new SkyboxPanoramicDefinition() + { + Tint = ArrayConverter.ToColor(vgoSkybox.tint, gamma: true), + Exposure = vgoSkybox.exposure, + Rotation = vgoSkybox.rotation, + MainTex = GetTexture(UniSkybox.Utils.PropMainTex, vgoSkybox.mainTexIndex), + Mapping = (Mapping)vgoSkybox.mapping, + ImageType = (ImageType)vgoSkybox.imageType, + MirrorOnBack = vgoSkybox.mirrorOnBack, + Layout = (Layout)vgoSkybox.layout, + }); + break; + + case ShaderName.Skybox_Procedural: + UniSkybox.Utils.SetParametersToMaterial(material, new SkyboxProceduralDefinition() + { + SunDisk = (SunDisk)vgoSkybox.sunDisk, + SunSize = vgoSkybox.sunSize, + SunSizeConvergence = vgoSkybox.sunSizeConvergence, + AtmosphereThickness = vgoSkybox.atmosphereThickness, + SkyTint = ArrayConverter.ToColor(vgoSkybox.skyTint, gamma: true), + GroundColor = ArrayConverter.ToColor(vgoSkybox.groundColor, gamma: true), + Exposure = vgoSkybox.exposure, + }); + break; + + default: + break; + } + + return material; + } + /// /// Create a Unlit material. /// @@ -421,5 +506,24 @@ protected virtual Texture2D GetTexture(string shaderPropertyName, int textureInd return texture2D; } + + /// + /// Get the cubemap. + /// + /// + /// + /// + protected virtual Cubemap GetCubemap(string shaderPropertyName, int textureIndex) + { + Texture2D texture2D = GetTexture(shaderPropertyName, textureIndex); + + if (texture2D == null) + { + return null; + } + + // @todo + return null; + } } } diff --git a/UniVgo/Runtime/IO/VgoShaderStore.cs b/UniVgo/Runtime/IO/VgoShaderStore.cs index fcc5c2e..93abcff 100644 --- a/UniVgo/Runtime/IO/VgoShaderStore.cs +++ b/UniVgo/Runtime/IO/VgoShaderStore.cs @@ -20,6 +20,18 @@ public class VgoShaderStore : ShaderStore /// Particles/Standard Unlit Shader _ParticlesStandardUnlit; + /// Skybox/6 Sided + Shader _Skybox6Sided; + + /// Skybox/Cubemap + Shader _SkyboxCubemap; + + /// Skybox/Panoramic + Shader _SkyboxPanoramic; + + /// Skybox/Procedural + Shader _SkyboxProcedural; + /// VRM/UnlitTexture Shader _VrmUnlitTexture; @@ -65,6 +77,58 @@ protected Shader ParticlesStandardUnlit } } + /// Skybox/6 Sided + protected Shader Skybox6Sided + { + get + { + if (_Skybox6Sided == null) + { + _Skybox6Sided = Shader.Find(ShaderName.Skybox_6_Sided); + } + return _Skybox6Sided; + } + } + + /// Skybox/Cubemap + protected Shader SkyboxCubemap + { + get + { + if (_SkyboxCubemap == null) + { + _SkyboxCubemap = Shader.Find(ShaderName.Skybox_Cubemap); + } + return _SkyboxCubemap; + } + } + + /// Skybox/Panoramic + protected Shader SkyboxPanoramic + { + get + { + if (_SkyboxPanoramic == null) + { + _SkyboxPanoramic = Shader.Find(ShaderName.Skybox_Panoramic); + } + return _SkyboxPanoramic; + } + } + + /// Skybox/Procedural + protected Shader SkyboxProcedural + { + get + { + if (_SkyboxProcedural == null) + { + _SkyboxProcedural = Shader.Find(ShaderName.Skybox_Procedural); + } + return _SkyboxProcedural; + } + } + /// VRM/UnlitTexture protected Shader VrmUnlitTexture { @@ -174,6 +238,18 @@ public override Shader GetShader(glTFMaterial material) case ShaderName.Particles_Standard_Unlit: return ParticlesStandardUnlit; + case ShaderName.Skybox_6_Sided: + return Skybox6Sided; + + case ShaderName.Skybox_Cubemap: + return SkyboxCubemap; + + case ShaderName.Skybox_Panoramic: + return SkyboxPanoramic; + + case ShaderName.Skybox_Procedural: + return SkyboxProcedural; + case ShaderName.UniGLTF_StandardVColor: return VColor; @@ -224,6 +300,11 @@ public override Shader GetShader(glTFMaterial material) } } + if (material.extensions.VGO_materials_skybox != null) + { + return SkyboxProcedural; + } + if (material.extensions.KHR_materials_unlit != null) { return UniUnlit; diff --git a/UniVgo/Runtime/UniVgo.asmdef b/UniVgo/Runtime/UniVgo.asmdef index 3629317..521921d 100644 --- a/UniVgo/Runtime/UniVgo.asmdef +++ b/UniVgo/Runtime/UniVgo.asmdef @@ -3,6 +3,7 @@ "references": [ "ShaderProperty.Runtime", "MToon", + "UniSkybox", "UniStandardParticle", "UniUnlit", "UniGLTFforUniVgo" diff --git a/UniVgo/Runtime/Utils/ShaderName.cs b/UniVgo/Runtime/Utils/ShaderName.cs index fe30294..46d5acb 100644 --- a/UniVgo/Runtime/Utils/ShaderName.cs +++ b/UniVgo/Runtime/Utils/ShaderName.cs @@ -5,7 +5,7 @@ namespace UniVgo { /// - /// + /// Shader Name /// public class ShaderName { @@ -15,6 +15,18 @@ public class ShaderName /// public const string Particles_Standard_Unlit = "Particles/Standard Unlit"; + /// + public const string Skybox_6_Sided = "Skybox/6 Sided"; + + /// + public const string Skybox_Cubemap = "Skybox/Cubemap"; + + /// + public const string Skybox_Panoramic = "Skybox/Panoramic"; + + /// + public const string Skybox_Procedural = "Skybox/Procedural"; + /// public const string UniGLTF_StandardVColor = "UniGLTF/StandardVColor"; diff --git a/UniVgo/Runtime/Vgo.cs b/UniVgo/Runtime/Vgo.cs index cf0e57c..2491ca8 100644 --- a/UniVgo/Runtime/Vgo.cs +++ b/UniVgo/Runtime/Vgo.cs @@ -13,6 +13,6 @@ public class Vgo public const string Generator = "UniVGO"; /// Specification Version - public const string SpecVersion = "0.5"; + public const string SpecVersion = "0.6"; } } \ No newline at end of file diff --git a/UniVgo/Runtime/VgoVersion.cs b/UniVgo/Runtime/VgoVersion.cs index 7e45d6f..111a107 100644 --- a/UniVgo/Runtime/VgoVersion.cs +++ b/UniVgo/Runtime/VgoVersion.cs @@ -13,12 +13,12 @@ public class VgoVersion public const int MAJOR = 0; /// Minor - public const int MINOR = 7; + public const int MINOR = 8; /// Patch public const int PATCH = 0; /// Version - public const string VERSION = "0.7.0"; + public const string VERSION = "0.8.0"; } } diff --git a/package.json b/package.json index 6d7da43..2b77776 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "izayoi.univgo", "displayName": "UniVGO", "description": "UniVGO is a package that can handle VGO files in Unity.", - "version": "0.7.0-preview", + "version": "0.8.0-preview", "type": "tool", "category": "", "keywords": [ @@ -11,6 +11,7 @@ "unity", "collier", "rigidbody", + "skybox", "light", "ParticleSystem", "shader",