diff --git a/CHANGELOG.md b/CHANGELOG.md index d4fd892..e43bf78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.7.0] - 2020-01-23 +- Added `VGO_materials_particle` property to materials extension. +- Added `particleSystem` property to VGO_nodes extension. + ## [0.6.1] - 2020-01-20 - Refactored source code diff --git a/Documentation~/VGO/instructions/schema.json.materials.md b/Documentation~/VGO/instructions/schema.json.materials.md new file mode 100644 index 0000000..00853a3 --- /dev/null +++ b/Documentation~/VGO/instructions/schema.json.materials.md @@ -0,0 +1,254 @@ +# VGO materials + +## JSON schema of glTF + +### glTF.materials.[*].extensions + +|definition name|description|type| +|:---|:---|:---| +|VGO_materials|VGO material information|VGO_materials| +|VGO_materials_particle|Particle material information|VGO_materials_particle| +|KHR_materials_unlit|Unlit material information|KHR_materials_unlit| +|VRMC_materials_mtoon|MToon material information|VRMC_materials_mtoon| + +### VGO_materials + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|shaderName|The name of shader.|string||| + +### VGO_materials_particle + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|renderMode||string|Opaque / Cutout / Fade / Transparent / Additive / Subtractive / Modulate|Opaque| +|colorMode||string|Multiply / Additive / Subtractive / Overlay / Color/ Difference|Multiply| +|flipBookMode||string|Simple / Blended|Simple| +|cullMode||string|Off / (Front) / Back|Off| +|softParticlesEnabled||bool|true / false|false| +|softParticleFadeParams||float[4]||| +|cameraFadingEnabled||bool|true / false|false| +|cameraFadeParams||float[4]||| +|distortionEnabled||bool|true / false|false| +|grabTextureIndex||int||| +|distortionStrengthScaled||float|[0.0, 1.0]|| +|distortionBlend||float|[0.0, 1.0]|| +|colorAddSubDiff||float[4]|r, g, b, a|| +|mainTexIndex||int||| +|mainTexSt||float[4]||| +|color||float[4]|r, g, b, a|| +|cutoff||float|[0.0, 1.0]|| +|metallicGlossMapIndex||int||| +|metallic||float|[0.0, 1.0]|| +|glossiness||float|[0.0, 1.0]|| +|bumpMapIndex||int||| +|bumpScale||float|[0.0, 1.0]|| +|lightingEnabled||bool|true / false|| +|emissionEnabled||bool|true / false|| +|emissionColor||float[3]|r, g, b|| +|emissionMapIndex||int||| + +### KHR_materials_unlit + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| + +https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit + +### VRMC_materials_mtoon + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|version||string||32| +|renderMode||string|opaque / cutout / transparent / transparentWithZWrite|opaque| +|cullMode||string|off / flont / back|off| +|renderQueueOffsetNumber||int||| +|litFactor||float[4]|r, g, b, a|| +|litMultiplyTexture||int||| +|shadeFactor||float[4]|r, g, b, a|| +|shadeMultiplyTexture||int||| +|cutoutThresholdFactor||float|[0.0, 1.0]|| +|shadingShiftFactor||float|[-1.0, 1.0]|| +|shadingToonyFactor||float|[0.0, 1.0]|| +|shadowReceiveMultiplierFactor||float|[0.0, 1.0]|| +|shadowReceiveMultiplierMultiplyTexture||int||| +|litAndShadeMixingMultiplierFactor||float|[0.0, 1.0]|| +|litAndShadeMixingMultiplierMultiplyTexture||int||| +|lightColorAttenuationFactor||float|[0.0, 1.0]|| +|giIntensityFactor||float|[0.0, 1.0]|| +|normalTexture||int||| +|normalScaleFactor||float||| +|emissionFactor||float[3]|r, g, b|| +|emissionMultiplyTexture||int||| +|additiveTexture||int||| +|rimFactor||float[4]|r, g, b, a|| +|rimMultiplyTexture||int||| +|rimLightingMixFactor||float|[0.0, 1.0]|| +|rimFresnelPowerFactor||float|[0.0, 100.0]|| +|rimLiftFactor||float|[0.0, 1.0]|| +|outlineWidthMode||string|none / worldCoordinates / screenCoordinates|none| +|outlineWidthFactor||float|[0.01, 1.0]|| +|outlineWidthMultiplyTexture||int||| +|outlineScaledMaxDistanceFactor||float|[1.0, 10.0]|| +|outlineColorMode||string|fixedColor / mixedLighting|fixedColor| +|outlineFactor||float[4]|r, g, b, a|| +|outlineLightingMixFactor||float|[0.0, 1.0]|| +|mainTextureLeftBottomOriginScale||float[2]|x, y|| +|mainTextureLeftBottomOriginOffset||float[2]|x, y|| +|uvAnimationMaskTexture||int||| +|uvAnimationScrollXSpeedFactor||float||| +|uvAnimationScrollYSpeedFactor||float||| +|uvAnimationRotationSpeedFactor||float||| + +https://github.com/vrm-c/vrm-specification + +___ +## Example of glTF JSON structure + +### glTF.materials.[*].extensions + +```json +JSON{ + "materials": [ + { + "name": "UnlitMaterial1", + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0, + "texCoord": 0 + }, + "baseColorFactor": [ 1, 1, 1, 1 ], + "metallicFactor": 0, + "roughnessFactor": 0.9 + }, + "alphaMode": "OPAQUE", + "alphaCutoff": 0.5, + "doubleSided": false, + "extensions": { + "VGO_materials":{ + "shaderName":"Unlit/Texture" + }, + "KHR_materials_unlit": {} + }, + "extras": {} + }, + { + "name": "MtoonMaterial1", + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0, + "texCoord": 0 + }, + "baseColorFactor": [ 1, 1, 1, 1 ], + "metallicFactor": 0, + "roughnessFactor": 0.9 + }, + "alphaMode": "OPAQUE", + "alphaCutoff": 0.5, + "doubleSided": false, + "extensions": { + "VGO_materials":{ + "shaderName":"VRM/MToon" + }, + "VRMC_materials_mtoon":{ + "version":"32", + "renderMode":"opaque", + "cullMode":"back", + "renderQueueOffsetNumber":0, + "litFactor":[ 0.811,0.916,0.723,1.0 ], + "litMultiplyTexture":0, + "shadeFactor":[ 0.933,0.620,0.711,1.0 ], + "shadeMultiplyTexture":-1, + "cutoutThresholdFactor":0.5, + "shadingShiftFactor":0.0, + "shadingToonyFactor":0.9, + "shadowReceiveMultiplierFactor":1.0, + "shadowReceiveMultiplierMultiplyTexture":-1, + "litAndShadeMixingMultiplierFactor":1.0, + "litAndShadeMixingMultiplierMultiplyTexture":-1, + "lightColorAttenuationFactor":0.0, + "giIntensityFactor":0.1, + "normalTexture":-1, + "normalScaleFactor":1.0, + "emissionFactor":[ 0.0,0.0,0.0,1.0 ], + "emissionMultiplyTexture":-1, + "additiveTexture":-1, + "rimFactor":[ 0.0,0.0,0.0,1.0 ], + "rimMultiplyTexture":-1, + "rimLightingMixFactor":0.0, + "rimFresnelPowerFactor":1.0, + "rimLiftFactor":0.0, + "outlineWidthMode":"screenCoordinates", + "outlineWidthFactor":0.5, + "outlineWidthMultiplyTexture":-1, + "outlineScaledMaxDistanceFactor":1.0, + "outlineColorMode":"fixedColor", + "outlineFactor":[ 0.0,0.0,0.0,1.0 ], + "outlineLightingMixFactor":1.0, + "mainTextureLeftBottomOriginScale":[ 1.0,1.0 ], + "mainTextureLeftBottomOriginOffset":[ 0.0,0.0 ], + "uvAnimationMaskTexture":-1, + "uvAnimationScrollXSpeedFactor":0.0, + "uvAnimationScrollYSpeedFactor":0.0, + "uvAnimationRotationSpeedFactor":0.0 + } + }, + "extras": {} + }, + { + "name": "ParticleMaterial1", + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0, + "texCoord": 0 + }, + "baseColorFactor": [ 1, 1, 1, 1 ], + "metallicFactor": 0, + "roughnessFactor": 0.9 + }, + "alphaMode": "OPAQUE", + "alphaCutoff": 0.5, + "doubleSided": false, + "extensions": { + "VGO_materials":{ + "shaderName":"Particles/Standard Surface" + }, + "VGO_materials_particle":{ + "renderMode":"Fade", + "colorMode":"Multiply", + "flipBookMode":"Simple", + "cullMode":"Back", + "softParticlesEnabled":true, + "softParticleFadeParams":[ 0.0,1.0,0.0,0.0 ], + "cameraFadingEnabled":true, + "cameraFadeParams":[ 1.0,1.0,0.0,0.0 ], + "grabTextureIndex":-1, + "distortionEnabled":true, + "distortionStrengthScaled":0.1, + "distortionBlend":0.5, + "colorAddSubDiff":[ 0.0,0.0,0.0,0.0 ], + "mainTexIndex":4, + "mainTexSt":[ 1.0,1.0,0.0,0.0 ], + "color":[ 0.0,0.0,0.0,1.0 ], + "cutoff":1.0, + "metallicGlossMapIndex":-1, + "metallic":0.0, + "glossiness":0.5, + "bumpMapIndex":-1, + "bumpScale":1.0, + "lightingEnabled":true, + "emissionEnabled":true, + "emissionColor":[ 1.0,0.0,1.0,1.0 ], + "emissionMapIndex":-1, + } + }, + "extras": {} + } + ] +} +``` +___ +Last updated: 23 January, 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 new file mode 100644 index 0000000..87c4a30 --- /dev/null +++ b/Documentation~/VGO/instructions/schema.json.md @@ -0,0 +1,114 @@ +# VGO + +## JSON schema of glTF + +### glTF.extensionsUsed + +|Definition name|Description| +|:---|:---| +|VGO|Declaration to use VGO.| +|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.| +|KHR_materials_unlit|Declares that Unlit shaders can be used for materials.| +|VRMC_materials_mtoon|Declares that MToon shaders can be used for materials.| + +### glTF.extensionsRequired + +|Definition name|Description| +|:---|:---| +|VGO|Requires support for VGO extensions.| +|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.| +|KHR_materials_unlit|Requires support for the KHR_materials_unlit extension.| +|VRMC_materials_mtoon|Requires support for the VRMC_materials_mtoon extension.| + +### glTF.extensions + +|definition name|description|type| +|:---|:---|:---| +|VGO|VGO information|glTF.extensions.VGO| + +### glTF.extensions.VGO + +|definition name|description|type| +|:---|:---|:---| +|meta|VGO meta information|vgo.meta| +|right|VGO rights information|vgo.right| + +### vgo.meta + +|definition name|description|type|fixed value| +|:---|:---|:---:|:---:| +|generatorName|The name of the generation tool.|string|UniVGO| +|generatorVersion|The generation tool version.|string|0.7.0| +|specVersion|VGO specification version.|string|0.5| + +### vgo.right + +|definition name|description|type|remarks| +|:---|:---|:---:|:---| +|title|The name of the work.|string|Required| +|author|The name of the creator.|string|Required| +|organization|The organization to which the creator belongs.|string|| +|createdDate|The creation date of the work.|string|There is no format specification.| +|updatedDate|The update date of the work.|string|There is no format specification.| +|version|The version of the work.|string|There is no format specification.| +|distributionUrl|Distribution URL.|string|URL format| +|licenseUrl|The URL where the license is written.|string|URL format| + +___ +## Example of glTF JSON structure + + +### glTF.extensions +```json +JSON{ + "asset": { + }, + "buffers": [ + ], + "extensionsUsed": [ + "VGO", + "VGO_nodes", + "VGO_materials", + "VGO_materials_particle", + "KHR_materials_unlit", + "VRMC_materials_mtoon" + ], + "extensionsRequired": [ + "VGO", + "VGO_nodes", + "VGO_materials", + "VGO_materials_particle", + "KHR_materials_unlit", + "VRMC_materials_mtoon" + ], + "extensions": { + "VGO": { + "meta": { + "generatorName": "UniVGO", + "generatorVersion": "0.7.0", + "specVersion": "0.5" + }, + "right": { + "title": "Test Stage", + "author": "Izayoi Jiichan", + "organization": "Izayoi", + "createdDate": "2020-01-01", + "updatedDate": "2020-01-23", + "version": "1.4", + "distributionUrl": "https://github.com/izayoijiichan/VGO", + "licenseUrl": "https://github.com/izayoijiichan/VGO/blob/master/UniVgo/LICENSE.md" + } + } + }, + "extras": {} +} +``` +___ +Last updated: 23 January, 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 new file mode 100644 index 0000000..b14bf73 --- /dev/null +++ b/Documentation~/VGO/instructions/schema.json.nodes.md @@ -0,0 +1,1301 @@ +# VGO nodes + +## JSON schema of glTF + +### glTF.nodes.[*].extensions + +|definition name|description|type| +|:---|:---|:---| +|VGO_nodes|Node VGO information|VGO_nodes| + +### VGO_nodes + +|definition name|description|type| +|:---|:---|:---| +|gameObject|GameObject information|VGO_GameObject| +|colliders|Collider information|VGO_Collider[]| +|rigidbody|Rigid body information|VGO_Rigidbody| +|light|Light information|VGO_Light| +|particleSystem|Particle System information|VGO_ParticleSystem| +|right|VGO rights information|VGO_Right| + +### VGO_GameObject + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|isActive|Whether the GameObject is active.|bool|true / false|true| +|isStatic|Whether the GameObject is static.|bool|true / false|false| +|tag|Tag attached to GameGbject.|string||Untagged| +|layer|The layer on which the GameObject is located.|int|[0, 31]|0| + +### VGO_Collider + +|definition name|description|type|setting value|default value|Box|Capsule|Sphere| +|:---|:---|:---:|:---:|:---:|:---:|:---:|:---:| +|enabled|Whether the collider is enable.|bool|true / false|true|*|*|*| +|type|The type of collider.|string|Box / Capsule / Sphere||*|*|*| +|isTrigger|Whether the collider is a trigger.|bool|true / false||*|*|*| +|center|The center of the collider.(Unit is m)|float[3]|x, y, z||*|*|*| +|size|The total size of the collider.(Unit is m)|float[3]|x, y, z||*|-|-| +|radius|The radius of the collider.|float|[0, infinity]||-|*|*| +|height|The height of the collider.|float|[0, infinity]||-|*|-| +|direction|The direction of the collider.|int|0:X / 1:Y / 2:Z||-|*|-| +|physicMaterial|The physic material of this collider.|VGO_PhysicMaterial|||*|*|*| + +### VGO_PhysicMaterial + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|dynamicFriction|Friction against a moving object.|float|[0.0, 1.0]|| +|staticFriction|Friction used for objects that are stationary on a surface.|float|[0.0, 1.0]|| +|bounciness|How elastic is the surface.|float|[0.0, 1.0]|| +|frictionCombine|The type of friction handling between colliding objects.|string|Average / Minimum / Maximum / Multiply|Average| +|bounceCombine|Processing type for bounce between colliding objects.|string|Average / Minimum / Maximum / Multiply|Average| + +### VGO_Rigidbody + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|mass|The mass of the object. (Unit is kg)|float|[0.0000001, 1000000000]|| +|drag|The amount of air resistance that affects an object when it is moved by force.|float|[0.0, infinity]|| +|angularDrag|The amount of air resistance that affects the object when rotating by torque.|float|[0.0, infinity]|| +|useGravity|Whether the object is affected by gravity.|bool|true / false|| +|isKinematic|Whether physics affects the rigid body.|bool|true / false|| +|interpolation|The type of completion.|string|None / Interpolate / Extrapolate|None| +|collisionDetectionMode|Collision detection mode.|string|Discrete / Continuous / ContinuousDynamic / ContinuousSpeculative|Discrete| +|constraints|The flags that restricts the movement of the rigid body.|int|FreesePositionX(2) \| FreesePositionY(4) \| FreesePositionZ(8) \| FreeseRotationX(16) \| FreeseRotationY(32) \| FreeseRotationZ(64)|0| + +### VGO_Light + +|definition name|description|type|setting value|default value|Spot|Directional|Point|Rectangle|Disc| +|:---|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +|enabled|Whether the light is enable.|bool|true / false|true|*|*|*|*|*| +|type|The type of the light.|string|Spot / Directional / Point / Rectangle / Disc|Spot|*|*|*|*|*| +|shape|This property describes the shape of the spot light.|string|Cone / Pyramid / Box|Cone|*|-|-|-|-| +|range|The range of the light.|float|[0, infinity]||*|-|*|*|*| +|spotAngle|The angle of the light's spotlight cone in degrees.|float|[0, infinity]||*|-|-|-|-| +|areaSize|The size of the area light.|float[2]|x, y||-|-|-|*|-| +|areaRadius|The radius of the area light|float|[0, infinity]||-|-|-|-|*| +|color|The color of the light.|float[4]|r, g, b, a||*|*|*|*|*| +|lightmapBakeType|This property describes what part of a light's contribution can be baked.|string|Baked / Realtime / Mixed||*|*|*|*|*| +|intensity|The Intensity of a light is multiplied with the Light color.|float|[0, infinity]||*|*|*|*|*| +|bounceIntensity|The multiplier that defines the strength of the bounce lighting.|float|[0, infinity]||*|*|*|*|*| +|shadows|How this light casts shadows.|string|None / Hard / Soft|None|*|*|*|*|*| +|shadowRadius|Controls the amount of artificial softening applied to the edges of shadows cast by the Point or Spot light.|float|[0, infinity]||*|-|*|-|-| +|shadowAngle|Controls the amount of artificial softening applied to the edges of shadows cast by directional lights.|float|[0, infinity]||-|*|-|-|-| +|shadowStrength|Strength of light's shadows.|float|[0, infinity]||-|*|*|-|-| +|shadowResolution|The resolution of the shadow map.|string|FromQualitySettings / Low / Medium / High / VeryHigh|FromQualitySettings|-|*|*|-|-| +|shadowBias|Shadow mapping constant bias.|float|[0, infinity]||-|*|*|-|-| +|shadowNormalBias|Shadow mapping normal-based bias.|float|[0, infinity]||-|*|*|-|-| +|shadowNearPlane|Near plane value to use for shadow frustums.|float|[0, infinity]||-|*|*|-|-| +|renderMode|How to render the light.|string|Auto / ForcePixel / ForceVertex|Auto|*|*|*|*|*| +|cullingMask|This is used to light certain objects in the Scene selectively.|int|[-1, infinity]|-1 (Everything)|*|*|*|*|*| + +Cookie, Flare, Halo are not supported. + +### VGO_ParticleSystem + +|definition name|description|type|remarks| +|:---|:---|:---|:---:| +|main||VGO_PS_MainModule|| +|emission||VGO_PS_EmissionModule|| +|shape||VGO_PS_ShapeModule|| +|velocityOverLifetime||VGO_PS_VelocityOverLifetimeModule|| +|limitVelocityOverLifetime||VGO_PS_LimitVelocityOverLifetimeModule|| +|inheritVelocity||VGO_PS_InheritVelocityModule|| +|forceOverLifetime||VGO_PS_ForceOverLifetimeModule|| +|colorOverLifetime||VGO_PS_ColorOverLifetimeModule|| +|colorBySpeed||VGO_PS_ColorBySpeedModule|| +|sizeOverLifetime||VGO_PS_SizeOverLifetimeModule|| +|sizeBySpeed||VGO_PS_SizeBySpeedModule|| +|rotationOverLifetime||VGO_PS_RotationOverLifetimeModule|| +|rotationBySpeed||VGO_PS_RotationBySpeedModule|| +|externalForces||VGO_PS_ExternalForcesModule|| +|noise||VGO_PS_NoiseModule|| +|collision||VGO_PS_CollisionModule|unimplemented| +|trigger||VGO_PS_TriggerModule|unimplemented| +|subEmitters||VGO_PS_SubEmittersModule|unimplemented| +|textureSheetAnimation||VGO_PS_TextureSheetAnimationModule|unimplemented| +|lights||VGO_PS_LightsModule|| +|trails||VGO_PS_TrailModule|| +|customData||VGO_PS_CustomDataModule|unimplemented| +|renderer||VGO_PS_Renderer|| + +### VGO_PS_MainModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|duration||float|[0.05, infinity]|| +|loop||float|[0, 1]|| +|prewarm||bool|true / false|| +|startDelay||VGO_PS_MinMaxCurve||| +|startDelayMultiplier||float|[0, infinity]|| +|startLifetime||VGO_PS_MinMaxCurve||| +|startLifetimeMultiplier||float|[0, infinity]|| +|startSpeed||VGO_PS_MinMaxCurve||| +|startSpeedMultiplier||float|[0, infinity]|| +|startSize3D||bool|true / false|| +|startSize||VGO_PS_MinMaxCurve||| +|startSizeX||VGO_PS_MinMaxCurve||| +|startSizeY||VGO_PS_MinMaxCurve||| +|startSizeZ||VGO_PS_MinMaxCurve||| +|startSizeMultiplier||float|[0, infinity]|| +|startSizeXMultiplier||float|[0, infinity]|| +|startSizeYMultiplier||float|[0, infinity]|| +|startSizeZMultiplier||float|[0, infinity]|| +|startRotation3D||bool|true / false|| +|startRotation||VGO_PS_MinMaxCurve||| +|startRotationX||VGO_PS_MinMaxCurve||| +|startRotationY||VGO_PS_MinMaxCurve||| +|startRotationZ||VGO_PS_MinMaxCurve||| +|startRotationMultiplier||float|[0, infinity]|| +|startRotationXMultiplier||float|[0, infinity]|| +|startRotationYMultiplier||float|[0, infinity]|| +|startRotationZMultiplier||float|[0, infinity]|| +|flipRotation||float|[0, 1]|| +|startColor||VGO_PS_MinMaxGradient||| +|gravityModifier||VGO_PS_MinMaxCurve||| +|gravityModifierMultiplier||float|[0, infinity]|| +|simulationSpace||string|Local / World / Custom|Local| +|simulationSpeed||float|[0, infinity]|| +|customSimulationSpace||VGO_Transform||| +|useUnscaledTime||bool|true / false|| +|scalingMode||string|Hierarchy / Local / Shape|Hierarchy| +|playOnAwake||bool|true / false|| +|emitterVelocityMode||string|Transform / Rigidbody|Transform| +|maxParticles||int|[0, infinity]|| +|stopAction||string|None / Disable / Destroy / Callback|None| +|cullingMode||string|Automatic / PauseAndCatchup / Pause / AlwaysSimulate|Automatic| +|ringBufferMode||string|Disabled / PauseUntilReplaced / LoopUntilReplaced|Disabled| +|ringBufferLoopRange||float[2]|x, y|| + +### VGO_PS_EmissionModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|rateOverTime||VGO_PS_MinMaxCurve||| +|rateOverTimeMultiplier||float|[0, infinity]|| +|rateOverDistance||VGO_PS_MinMaxCurve||| +|rateOverDistanceMultiplier||float|[0, infinity]|| +|bursts||VGO_PS_Burst[]||| + +### VGO_PS_Burst + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|time||float|[0, infinity]|| +|count||VGO_PS_MinMaxCurve||| +|cycleCount||int|[0, infinity]|| +|repeatInterval||float|[0.01, infinity]|| +|probability||float|[0, 1]|| + +### VGO_PS_ShapeModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|shapeType||string|Sphere / SphereShell / Hemisphere / HemisphereShell / Cone / Box / Mesh / ConeVolume / ConeVolumeShell / Circle / CircleEdge / SingleSidedEdge / MeshRenderer / SkinnedMeshRenderer / BoxShell / BoxEdge / Donut / Rectangle / Sprite / SpriteRenderer|Sphere| +|angle||float|[0, 90]|| +|radius||float|[0.0001, infinity]|| +|donutRadius||float|[0.0001, infinity]|| +|radiusMode||string|Random / Loop / PingPong / BurstSpread|Random| +|radiusSpread||float|[0, 1]|| +|radiusSpeed||VGO_PS_MinMaxCurve||| +|radiusSpeedMultiplier||float|[0, infinity]|| +|radiusThickness||float|[0, 1]|| +|boxThickness||float[3]|x, y, z|| +|arc||float|[0, 360]|| +|arcMode||string|Random / Loop / PingPong / BurstSpread|Random| +|arcSpread||float||| +|arcSpeed||VGO_PS_MinMaxCurve||| +|arcSpeedMultiplier||float|[0, infinity]|| +|length||float||| +|meshShapeType||string|Vertex / Edge / Triangle|Vertex| +|meshSpawnMode||string|Random / Loop / PingPong / BurstSpread|Random| +|meshSpawnSpread||float||| +|meshSpawnSpeed||VGO_PS_MinMaxCurve||| +|meshSpawnSpeedMultiplier||float|[0, infinity]|| +|useMeshMaterialIndex||bool|true / false|| +|meshMaterialIndex||int||| +|useMeshColors||bool|true / false|| +|normalOffset||float||| +|textureIndex||int||| +|textureClipChannel||string|Red / Green / Blue / Alpha|Red| +|textureClipThreshold||float||| +|textureColorAffectsParticles||bool|true / false|| +|textureAlphaAffectsParticles||bool|true / false|| +|textureBilinearFiltering||bool|true / false|| +|textureUVChannel||int||| +|position||float[3]|x, y, z|| +|rotation||float[4]|x, y, z, w|| +|scale||float[3]|x, y, z|| +|alignToDirection||bool|true / false|| +|randomDirectionAmount||float|[0, 1]|| +|sphericalDirectionAmount||float|[0, 1]|| +|randomPositionAmount||float|[0, 1]|| + +### VGO_PS_VelocityOverLifetimeModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|x||VGO_PS_MinMaxCurve||| +|y||VGO_PS_MinMaxCurve||| +|z||VGO_PS_MinMaxCurve||| +|xMultiplier||float|[0, infinity]|| +|yMultiplier||float|[0, infinity]|| +|zMultiplier||float|[0, infinity]|| +|space||string|Local / World / Custom|Local| +|orbitalX||VGO_PS_MinMaxCurve||| +|orbitalY||VGO_PS_MinMaxCurve||| +|orbitalZ||VGO_PS_MinMaxCurve||| +|orbitalXMultiplier||float|[0, infinity]|| +|orbitalYMultiplier||float|[0, infinity]|| +|orbitalZMultiplier||float|[0, infinity]|| +|orbitalOffsetX||VGO_PS_MinMaxCurve||| +|orbitalOffsetY||VGO_PS_MinMaxCurve||| +|orbitalOffsetZ||VGO_PS_MinMaxCurve||| +|orbitalOffsetXMultiplier||float|[0, infinity]|| +|orbitalOffsetYMultiplier||float|[0, infinity]|| +|orbitalOffsetZMultiplier||float|[0, infinity]|| +|radial||VGO_PS_MinMaxCurve||| +|radialMultiplier||float|[0, infinity]|| +|speedModifier||VGO_PS_MinMaxCurve||| +|speedModifierMultiplier||float|[0, infinity]|| + +### VGO_PS_LimitVelocityOverLifetimeModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|separateAxes||bool|true / false|| +|limitX||VGO_PS_MinMaxCurve||| +|limitY||VGO_PS_MinMaxCurve||| +|limitZ||VGO_PS_MinMaxCurve||| +|limitXMultiplier||float|[0, infinity]|| +|limitYMultiplier||float|[0, infinity]|| +|limitZMultiplier||float|[0, infinity]|| +|space||string|Local / World / Custom|Local| +|dampen||float|[0, 1]|| +|drag||VGO_PS_MinMaxCurve||| +|dragMultiplier||float|[0, infinity]|| +|multiplyDragByParticleSize||bool|true / false|| +|multiplyDragByParticleVelocity||bool|true / false|| + +### VGO_PS_InheritVelocityModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|mode||string|Initial / Current|Initial| +|curve||VGO_PS_MinMaxCurve||| +|curveMultiplier||float|[0, infinity]|| + +### VGO_PS_ForceOverLifetimeModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|x||VGO_PS_MinMaxCurve||| +|y||VGO_PS_MinMaxCurve||| +|z||VGO_PS_MinMaxCurve||| +|xMultiplier||float|[0, infinity]|| +|yMultiplier||float|[0, infinity]|| +|zMultiplier||float|[0, infinity]|| +|space||string|Local / World / Custom|Local| +|randomized||bool|true / false|| + +### VGO_PS_ColorOverLifetimeModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|color||VGO_PS_MinMaxGradient||| + +### VGO_PS_ColorBySpeedModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|color||VGO_PS_MinMaxGradient||| +|range||float[]|x, y|| + +### VGO_PS_SizeOverLifetimeModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|separateAxes||bool|true / false|| +|x||VGO_PS_MinMaxCurve||| +|y||VGO_PS_MinMaxCurve||| +|z||VGO_PS_MinMaxCurve||| +|xMultiplier||float|[0, infinity]|| +|yMultiplier||float|[0, infinity]|| +|zMultiplier||float|[0, infinity]|| + +### VGO_PS_SizeBySpeedModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|separateAxes||bool|true / false|| +|x||VGO_PS_MinMaxCurve||| +|y||VGO_PS_MinMaxCurve||| +|z||VGO_PS_MinMaxCurve||| +|xMultiplier||float|[0, infinity]|| +|yMultiplier||float|[0, infinity]|| +|zMultiplier||float|[0, infinity]|| +|range||float[]|x, y|| + +### VGO_PS_RotationOverLifetimeModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|separateAxes||bool|true / false|| +|x||VGO_PS_MinMaxCurve||| +|y||VGO_PS_MinMaxCurve||| +|z||VGO_PS_MinMaxCurve||| +|xMultiplier||float|[0, infinity]|| +|yMultiplier||float|[0, infinity]|| +|zMultiplier||float|[0, infinity]|| + +### VGO_PS_RotationBySpeedModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|separateAxes||bool|true / false|| +|x||VGO_PS_MinMaxCurve||| +|y||VGO_PS_MinMaxCurve||| +|z||VGO_PS_MinMaxCurve||| +|xMultiplier||float|[0, infinity]|| +|yMultiplier||float|[0, infinity]|| +|zMultiplier||float|[0, infinity]|| +|range||float[]|x, y|| + +### VGO_PS_ExternalForcesModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|multiplierCurve||VGO_PS_MinMaxCurve||| +|Multiplier||float|[0, infinity]|| +|influenceFilter||string|LayerMask / List / LayerMaskAndList|LayerMask| +|influenceMask||int||| + +### VGO_PS_NoiseModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|separateAxes||bool|true / false|| +|strengthX||VGO_PS_MinMaxCurve||| +|strengthY||VGO_PS_MinMaxCurve||| +|strengthZ||VGO_PS_MinMaxCurve||| +|strengthXMultiplier||float|[0, infinity]|| +|strengthYMultiplier||float|[0, infinity]|| +|strengthZMultiplier||float|[0, infinity]|| +|frequency||float|[0.0001, infinity]|| +|scrollSpeed||VGO_PS_MinMaxCurve||| +|scrollSpeedMultiplier||float|[0, infinity]|| +|damping||bool|true / false|| +|octaveCount||int|[1, 4]|| +|octaveMultiplier||float|[0, infinity]|| +|octaveScale||float||| +|quality||string|Low / Medium / High|Low| +|remapEnabled||bool|true / false|| +|remapX||VGO_PS_MinMaxCurve||| +|remapY||VGO_PS_MinMaxCurve||| +|remapZ||VGO_PS_MinMaxCurve||| +|remapXMultiplier||float|[0, infinity]|| +|remapYMultiplier||float|[0, infinity]|| +|remapZMultiplier||float|[0, infinity]|| +|positionAmount||VGO_PS_MinMaxCurve||| +|rotationAmount||VGO_PS_MinMaxCurve||| +|sizeAmount||VGO_PS_MinMaxCurve||| + +### VGO_PS_CollisionModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| + +unimplemented + +### VGO_PS_TriggerModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| + +unimplemented + +### VGO_PS_SubEmittersModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| + +unimplemented + +### VGO_PS_TextureSheetAnimationModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| + +unimplemented + +### VGO_PS_LightsModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|ratio||float|[0, 1]|| +|useRandomDistribution||bool|true / false|| +|light||VGO_Light||| +|useParticleColor||bool|true / false|| +|sizeAffectsRange||bool|true / false|| +|alphaAffectsIntensity||bool|true / false|| +|range||VGO_PS_MinMaxCurve||| +|rangeMultiplier||float|[0, infinity]|| +|intensity||VGO_PS_MinMaxCurve||| +|intensityMultiplier||float|[0, infinity]|| +|maxLights||int|[0, infinity]|| + +### VGO_PS_TrailModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|mode||string|PerParticle / Ribbon|PerParticle| +|ratio||float|[0, 1]|| +|lifetime||VGO_PS_MinMaxCurve||| +|lifetimeMultiplier||float|[0, infinity]|| +|minVertexDistance||float|[0, infinity]|| +|worldSpace||bool|true / false|| +|dieWithParticles||bool|true / false|| +|ribbonCount||int|[1, infinity]|| +|splitSubEmitterRibbons||bool|true / false|| +|attachRibbonsToTransform||bool|true / false|| +|textureMode||string|Stretch / Tile / DistributePerSegment / RepeatPerSegment|Stretch| +|sizeAffectsWidth||bool|true / false|| +|sizeAffectsLifetime||bool|true / false|| +|useMeinheritParticleColorshColors||bool|true / false|| +|colorOverLifetime||VGO_PS_MinMaxCurve||| +|widthOverTrail||VGO_PS_MinMaxCurve||| +|widthOverTrailMultiplier||float|[0, infinity]|| +|colorOverTrail||VGO_PS_MinMaxGradient||| +|generateLightingData||bool|true / false|| +|shadowBias||float|[0, infinity]|| + +### VGO_PS_CustomDataModule + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| + +unimplemented + +### VGO_PS_Renderer + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|enabled||bool|true / false|| +|renderMode||string|Billboard / Stretch / HorizontalBillboard / VerticalBillboard / Mesh / None|Billboard| +|cameraVelocityScale||float||| +|velocityScale||float||| +|lengthScale||float||| +|normalDirection||float|[0, 1]|| +|sharedMaterialIndex||int||| +|trailMaterialIndex||int||| +|sortMode||string|None / Distance / OldestInFront / YoungestInFront|None| +|sortingFudge||float||| +|minParticleSize||float|[0, infinity]|| +|maxParticleSize||float|[0, infinity]|| +|alignment||string|View / World / Local / Facing / Velocity|View| +|flip||float[]|x, y, z|| +|allowRoll||bool|true / false|| +|pivot||float[]|x, y, z|| +|maskInteraction||string|None / VisibleInsideMask/ VisibleOutsideMask|None| +|enableGPUInstancing||bool|true / false|| +|shadowCastingMode||string|Off / On / TwoSided / ShadowsOnly|Off| +|receiveShadows||bool|true / false|| +|shadowBias||float||| +|motionVectorGenerationMode||string|Camera / Object / ForceNoMotion|Camera| +|forceRenderingOff||bool|true / false|| +|rendererPriority||int||| +|renderingLayerMask||int||| +|sortingLayerID||int||| +|sortingOrder||int||| +|lightProbeUsage||string|Off / BlendProbes / UseProxyVolume / CustomProvided|Off| +|reflectionProbeUsage||string|Off / BlendProbes / BlendProbesAndSkybox / Simple|Off| +|probeAnchor||VGO_Transform||| + +### VGO_PS_MinMaxCurve + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|mode||string|Constant / Curve / TwoCurves / TwoConstants|Constant| +|constant||float||| +|constantMin||float||| +|constantMax||float||| +|curveMultiplier||float|[0, infinity]|| +|curve||VGO_AnimationCurve||| +|curveMin||VGO_AnimationCurve||| +|curveMax||VGO_AnimationCurve||| + +### VGO_AnimationCurve + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|keys||VGO_Keyframe[]||| +|preWrapMode||string|Once / Loop / PingPong / Default / ClampForever|Once| +|postWrapMode||string|Once / Loop / PingPong / Default / ClampForever|Once| + +### VGO_Keyframe + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|time||float||| +|value||float||| +|inTangent||float||| +|outTangent||float||| +|inWeight||float||| +|outWeight||float||| +|weightedMode||string|None / In / Out / Both|None| + +### VGO_PS_MinMaxGradient + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|mode||string|Color / Gradient / TwoColors / TwoGradients / RandomColor|Color| +|color||float[]|r, g, b, a|| +|colorMin||float[]|r, g, b, a|| +|colorMax||float[]|r, g, b, a|| +|gradient||VGO_Gradient||| +|gradientMin||VGO_Gradient||| +|gradientMax||VGO_Gradient||| + +### VGO_Gradient + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|colorKeys||VGO_GradientColorKey[]||| +|alphaKeys||VGO_GradientAlphaKey[]||| +|mode||string|Blend / Fixed|Blend| + +### VGO_GradientColorKey + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|color||float[]|r, g, b, a|| +|time||float|[0,1]|| + +### VGO_GradientAlphaKey + +|definition name|description|type|setting value|default value| +|:---|:---|:---:|:---:|:---:| +|alpha||float||| +|time||float|[0,1]|| + +___ +## Example of glTF JSON structure + +### glTF.nodes.[*].extensions +```json +JSON{ + "nodes": [ + { + "name": "Capsule1", + "translation": [ 1, 1, 1 ], + "rotation": [ 0, 0, 0, 1 ], + "scale": [ 0.5, 0.5, 0.5 ], + "mesh": 0, + "extensions": { + "VGO_nodes": { + "gameObject": { + "isActive": false, + "isStatic": true, + "tag": "Player", + "layer": 2 + }, + "colliders": [ + { + "enabled": false, + "type": "Capsule", + "isTrigger": false, + "center": [ 0, 0, 0 ], + "radius": 0.5, + "height": 2, + "direction": 1, + "physicMaterial":{ + "dynamicFriction":0.6, + "staticFriction":0.6, + "bounciness":0.0, + "frictionCombine":"Average", + "bounceCombine":"Multiply" + } + } + ], + "rigidbody": { + "mass": 10, + "drag": 0, + "angularDrag": 0.05, + "useGravity": true, + "isKinematic": false, + "interpolation": "None", + "collisionDetectionMode": "Discrete", + "constraints": 36 + }, + "light":{ + "enabled":true, + "type":"Point", + "shape":"", + "range":1.0, + "spotAngle":0.0, + "areaSize":[ 0.0, 0.0 ], + "areaRadius":0.0, + "color":[ 0.122,0.404,0.637,1.0 ], + "lightmapBakeType":"Realtime", + "intensity":1.0, + "bounceIntensity":1.0, + "shadows":"Soft", + "shadowRadius":1.0, + "shadowAngle":0.0, + "shadowStrength":1.0, + "shadowResolution":"Low", + "shadowBias":0.004, + "shadowNormalBias":0.26, + "shadowNearPlane":0.1, + "renderMode":"Auto", + "cullingMask":-1 + }, + "particleSystem":{ + "main":{ + "duration":5.0, + "loop":true, + "prewarm":false, + "startDelay":{ + "mode":"Constant", + "constant":0.0 + }, + "startDelayMultiplier":0.0, + "startLifetime":{ + "mode":"Curve", + "curveMultiplier":5.0, + "curve":{ + "keys":[ + { + "time":0.0, + "value":0.510416031, + "inTangent":0.0, + "outTangent":0.0, + "inWeight":0.333333343, + "outWeight":0.333333343, + "weightedMode":"None" + }, + { + "time":1.0, + "value":1.0, + "inTangent":0.0, + "outTangent":0.0, + "inWeight":0.333333343, + "outWeight":0.333333343, + "weightedMode":"None" + } + ], + "preWrapMode":"ClampForever", + "postWrapMode":"ClampForever" + } + }, + "startLifetimeMultiplier":5.0, + "startSpeed":{ + "mode":"Constant", + "constant":1.0 + }, + "startSpeedMultiplier":1.0, + "startSize3D":false, + "startSize":{ + "mode":"Constant", + "constant":0.08 + }, + "startSizeMultiplier":0.08, + "startRotation3D":true, + "startRotationX":{ + "mode":"Constant", + "constant":0.0174532924 + }, + "startRotationY":{ + "mode":"Constant", + "constant":0.0349065848 + }, + "startRotationZ":{ + "mode":"Constant", + "constant":0.0523598753 + }, + "startRotationXMultiplier":0.0174532924, + "startRotationYMultiplier":0.0349065848, + "startRotationZMultiplier":0.0523598753, + "flipRotation":0.0, + "startColor":{ + "mode":"Color", + "color":[ + 0.743349731,0.534801245,0.0394535959,1.0 + ] + }, + "gravityModifier":{ + "mode":"Constant", + "constant":0.0 + }, + "gravityModifierMultiplier":0.0, + "simulationSpace":"Local", + "simulationSpeed":1.0, + "useUnscaledTime":false, + "scalingMode":"Local", + "playOnAwake":true, + "emitterVelocityMode":"Rigidbody", + "maxParticles":1000, + "stopAction":"None", + "cullingMode":"Automatic", + "ringBufferMode":"Disabled" + }, + "emission":{ + "enabled":true, + "rateOverTime":{ + "mode":"Constant", + "constant":10.0 + }, + "rateOverTimeMultiplier":10.0, + "rateOverDistance":{ + "mode":"Constant", + "constant":0.0 + }, + "rateOverDistanceMultiplier":0.0, + "bursts":[ + { + "time":0.0, + "count":{ + "mode":"Constant", + "constant":3.0 + }, + "cycleCount":2, + "repeatInterval":0.01, + "probability":1.0 + }, + { + "time":1.0, + "count":{ + "mode":"TwoConstants", + "constantMin":1.0, + "constantMax":2.0 + }, + "cycleCount":10, + "repeatInterval":1.0, + "probability":0.5 + }, + { + "time":2.0, + "count":{ + "mode":"Curve", + "curveMultiplier":30.0, + "curve":{ + "keys":[ + { + "time":0.0, + "value":0.364583969, + "inTangent":0.0, + "outTangent":0.0, + "inWeight":0.0, + "outWeight":0.0, + "weightedMode":"None" + }, + { + "time":0.9888916, + "value":0.552083969, + "inTangent":0.0, + "outTangent":0.0, + "inWeight":0.0, + "outWeight":0.0, + "weightedMode":"None" + } + ], + "preWrapMode":"ClampForever", + "postWrapMode":"ClampForever" + } + }, + "cycleCount":5, + "repeatInterval":5.0, + "probability":1.0 + } + ] + }, + "shape":{ + "enabled":true, + "shapeType":"Cone", + "angle":25.0, + "radius":1.0, + "donutRadius":0.2, + "radiusMode":"Random", + "radiusSpread":0.0, + "radiusSpeed":{ + "mode":"Constant", + "constant":1.0 + }, + "radiusSpeedMultiplier":1.0, + "radiusThickness":1.0, + "boxThickness":[ 0.0,0.0,0.0 ], + "arc":360.0, + "arcMode":"Random", + "arcSpread":0.0, + "arcSpeed":{ + "mode":"Constant", + "constant":1.0 + }, + "arcSpeedMultiplier":1.0, + "length":5.0, + "meshShapeType":"Edge", + "meshSpawnMode":"Random", + "meshSpawnSpread":0.0, + "meshSpawnSpeed":{ + "mode":"Constant", + "constant":0.0 + }, + "meshSpawnSpeedMultiplier":1.0, + "useMeshMaterialIndex":false, + "meshMaterialIndex":0, + "useMeshColors":true, + "normalOffset":0.0, + "textureClipChannel":"Alpha", + "textureClipThreshold":0.0, + "textureColorAffectsParticles":true, + "textureAlphaAffectsParticles":true, + "textureBilinearFiltering":false, + "textureUVChannel":0, + "position":[ 0.0,0.0,0.0 ], + "rotation":[ 0.0,0.0,0.0 ], + "scale":[ 1.0,1.0,1.0 ], + "alignToDirection":false, + "randomDirectionAmount":0.0, + "sphericalDirectionAmount":0.0, + "randomPositionAmount":0.0 + }, + "velocityOverLifetime":{ + "enabled":true, + "x":{ + "mode":"Constant", + "constant":0.0 + }, + "y":{ + "mode":"Constant", + "constant":0.0 + }, + "z":{ + "mode":"Constant", + "constant":0.0 + }, + "xMultiplier":0.0, + "yMultiplier":0.0, + "zMultiplier":0.0, + "space":"Local", + "orbitalX":{ + "mode":"Constant", + "constant":0.0 + }, + "orbitalY":{ + "mode":"Constant", + "constant":0.0 + }, + "orbitalZ":{ + "mode":"Constant", + "constant":0.0 + }, + "orbitalXMultiplier":0.0, + "orbitalYMultiplier":0.0, + "orbitalZMultiplier":0.0, + "orbitalOffsetX":{ + "mode":"Constant", + "constant":0.0 + }, + "orbitalOffsetY":{ + "mode":"Constant", + "constant":0.0 + }, + "orbitalOffsetZ":{ + "mode":"Constant", + "constant":0.0 + }, + "orbitalOffsetXMultiplier":0.0, + "orbitalOffsetYMultiplier":0.0, + "orbitalOffsetZMultiplier":0.0, + "radial":{ + "mode":"Constant", + "constant":0.0 + }, + "radialMultiplier":0.0, + "speedModifier":{ + "mode":"Constant", + "constant":1.2 + }, + "speedModifierMultiplier":1.2 + }, + "limitVelocityOverLifetime":{ + "enabled":true, + "separateAxes":false, + "limitX":{ + "mode":"Constant", + "constant":1.0 + }, + "limitXMultiplier":1.0, + "space":"Local", + "dampen":0.0, + "drag":{ + "mode":"Constant", + "constant":0.0 + }, + "dragMultiplier":0.0, + "multiplyDragByParticleSize":true, + "multiplyDragByParticleVelocity":true + }, + "inheritVelocity":{ + "enabled":true, + "mode":"Initial", + "curve":{ + "mode":"Constant", + "constant":0.0 + }, + "curveMultiplier":0.0 + }, + "forceOverLifetime":{ + "enabled":true, + "x":{ + "mode":"Constant", + "constant":0.0 + }, + "y":{ + "mode":"Constant", + "constant":0.0 + }, + "z":{ + "mode":"Constant", + "constant":0.0 + }, + "xMultiplier":0.0, + "yMultiplier":0.0, + "zMultiplier":0.0, + "space":"Local", + "randomized":false + }, + "colorOverLifetime":{ + "enabled":true, + "color":{ + "mode":"Gradient", + "gradient":{ + "colorKeys":[ + { + "color":[ 1.0,1.0,1.0,1.0 ], + "time":0.0 + }, + { + "color":[ 0.107,0.836,0.207,1.0 ], + "time":0.144121468 + }, + { + "color":[ 0.7433,0.0423,0.525,1.0 ], + "time":0.8529488 + } + ], + "alphaKeys":[ + { + "alpha":1.0, + "time":0.0 + }, + { + "alpha":1.0, + "time":1.0 + } + ], + "mode":"Blend" + } + } + }, + "colorBySpeed":{ + "enabled":true, + "color":{ + "mode":"Gradient", + "gradient":{ + "colorKeys":[ + { + "color":[ 1.0,1.0,1.0,1.0 ], + "time":0.0 + }, + { + "color":[ 1.0,1.0,1.0,1.0 ], + "time":1.0 + } + ], + "alphaKeys":[ + { + "alpha":1.0, + "time":0.0 + }, + { + "alpha":1.0, + "time":1.0 + } + ], + "mode":"Blend" + } + }, + "range":[ 0.0,1.0 ] + }, + "sizeOverLifetime":{ + "enabled":true, + "separateAxes":false, + "x":{ + "mode":"Curve", + "curveMultiplier":1.0, + "curve":{ + "keys":[ + { + "time":0.0, + "value":1.0, + "inTangent":0.0, + "outTangent":0.0, + "inWeight":0.333333343, + "outWeight":0.333333343, + "weightedMode":"None" + }, + { + "time":1.0, + "value":0.354166657, + "inTangent":-0.9374998, + "outTangent":-0.9374998, + "inWeight":0.144444466, + "outWeight":0.333333343, + "weightedMode":"None" + } + ], + "preWrapMode":"ClampForever", + "postWrapMode":"ClampForever" + } + }, + "xMultiplier":1.0 + }, + "sizeBySpeed":{ + "enabled":true, + "separateAxes":false, + "x":{ + "mode":"Curve", + "curveMultiplier":1.0, + "curve":{ + "keys":[ + { + "time":0.0, + "value":0.0, + "inTangent":0.0, + "outTangent":1.0, + "inWeight":0.333333343, + "outWeight":0.333333343, + "weightedMode":"None" + }, + { + "time":1.0, + "value":1.0, + "inTangent":1.0, + "outTangent":0.0, + "inWeight":0.333333343, + "outWeight":0.333333343, + "weightedMode":"None" + } + ], + "preWrapMode":"ClampForever", + "postWrapMode":"ClampForever" + } + }, + "xMultiplier":1.0, + "range":[ 0.0,1.0 ] + }, + "rotationOverLifetime":{ + "enabled":true, + "x":{ + "mode":"Constant", + "constant":0.0 + }, + "xMultiplier":0.0, + "yMultiplier":0.0, + "zMultiplier":0.0, + "separateAxes":false + }, + "rotationBySpeed":{ + "enabled":true, + "x":{ + "mode":"Constant", + "constant":0.0 + }, + "xMultiplier":0.0, + "yMultiplier":0.0, + "zMultiplier":0.0, + "separateAxes":false, + "range":[ 0.0,1.0 ] + }, + "externalForces":{ + "enabled":true, + "multiplierCurve":{ + "mode":"Constant", + "constant":1.0 + }, + "multiplier":1.0, + "influenceFilter":"LayerMask", + "influenceMask":-1 + }, + "noise":{ + "enabled":true, + "separateAxes":false, + "strengthX":{ + "mode":"Constant", + "constant":0.2 + }, + "strengthXMultiplier":0.2, + "frequency":0.5, + "scrollSpeed":{ + "mode":"Constant", + "constant":0.0 + }, + "scrollSpeedMultiplier":0.0, + "damping":true, + "octaveCount":1, + "octaveMultiplier":0.5, + "octaveScale":2.0, + "quality":"High", + "remapEnabled":false, + "positionAmount":{ + "mode":"Constant", + "constant":1.0 + }, + "rotationAmount":{ + "mode":"Constant", + "constant":0.0 + }, + "sizeAmount":{ + "mode":"Constant", + "constant":0.0 + } + }, + "lights":{ + "enabled":true, + "ratio":0.5, + "useRandomDistribution":true, + "light":{ + "type":"Point", + "range":0.1, + "color":[ 0.876,0.192,0.73,1.0 ], + "lightmapBakeType":"Realtime", + "intensity":3.0, + "bounceIntensity":0.0, + "shadowStrength":1.0, + "shadowBias":0.05, + "shadowNormalBias":0.4, + "shadowNearPlane":0.2 + }, + "useParticleColor":true, + "sizeAffectsRange":true, + "alphaAffectsIntensity":false, + "range":{ + "mode":"Constant", + "constant":1.0 + }, + "rangeMultiplier":1.0, + "intensity":{ + "mode":"Constant", + "constant":1.0 + }, + "intensityMultiplier":1.0, + "maxLights":20 + }, + "trails":{ + "enabled":true, + "mode":"PerParticle", + "ratio":1.0, + "lifetime":{ + "mode":"Constant", + "constant":0.3 + }, + "lifetimeMultiplier":0.3, + "minVertexDistance":0.2, + "worldSpace":false, + "dieWithParticles":true, + "ribbonCount":1, + "splitSubEmitterRibbons":false, + "attachRibbonsToTransform":false, + "textureMode":"Stretch", + "sizeAffectsWidth":true, + "sizeAffectsLifetime":false, + "useMeinheritParticleColorshColors":true, + "colorOverLifetime":{ + "mode":"Color", + "color":[ 1.0,1.0,1.0,1.0 ] + }, + "widthOverTrail":{ + "mode":"Constant", + "constant":0.4 + }, + "widthOverTrailMultiplier":0.4, + "colorOverTrail":{ + "mode":"Color", + "color":[ 1.0,1.0,1.0,1.0 ] + }, + "generateLightingData":false, + "shadowBias":0.5 + }, + "renderer":{ + "enabled":true, + "renderMode":"Billboard", + "cameraVelocityScale":0.0, + "velocityScale":0.0, + "lengthScale":2.0, + "normalDirection":1.0, + "sharedMaterialIndex":3, + "trailMaterialIndex":4, + "sortMode":"None", + "sortingFudge":0.0, + "minParticleSize":0.0, + "maxParticleSize":0.5, + "alignment":"View", + "flip":[ 0.0,0.0,0.0 ], + "allowRoll":true, + "pivot":[ 0.0,0.0,0.0 ], + "maskInteraction":"None", + "enableGPUInstancing":true, + "shadowCastingMode":"Off", + "receiveShadows":false, + "shadowBias":0.0, + "motionVectorGenerationMode":"Object", + "forceRenderingOff":false, + "rendererPriority":0, + "renderingLayerMask":1, + "sortingLayerID":0, + "sortingOrder":0, + "lightProbeUsage":"Off", + "reflectionProbeUsage":"Off" + } + }, + "right": { + "title": "Capsule1", + "author": "Izayoi Jiichan", + "organization": "", + "createdDate": "2020-01-01", + "updatedDate": "2020-01-01", + "version": "0.1", + "distributionUrl": "", + "licenseUrl": "" + } + } + }, + "extras": {} + } + ] +} +``` +___ +Last updated: 23 January, 2020 +Editor: Izayoi Jiichan + +*Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/VGO/specification/0.5/schema/VGO_materials.schema.json b/Documentation~/VGO/specification/0.5/schema/VGO_materials.schema.json new file mode 100644 index 0000000..e544d7c --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/VGO_materials_particle.schema.json b/Documentation~/VGO/specification/0.5/schema/VGO_materials_particle.schema.json new file mode 100644 index 0000000..5521169 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/VGO_nodes.schema.json b/Documentation~/VGO/specification/0.5/schema/VGO_nodes.schema.json new file mode 100644 index 0000000..dcfdb41 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/schema/VGO_nodes.schema.json @@ -0,0 +1,25 @@ +{ + "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" + } + } +} \ No newline at end of file diff --git a/Documentation~/VGO/specification/0.5/schema/VRMC_materials_mtoon.schema.json b/Documentation~/VGO/specification/0.5/schema/VRMC_materials_mtoon.schema.json new file mode 100644 index 0000000..4041d9b --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/materials.extensions.schema.json b/Documentation~/VGO/specification/0.5/schema/materials.extensions.schema.json new file mode 100644 index 0000000..e80781f --- /dev/null +++ b/Documentation~/VGO/specification/0.5/schema/materials.extensions.schema.json @@ -0,0 +1,19 @@ +{ + "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" + }, + "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.5/schema/node.vgo.collider.schema.json b/Documentation~/VGO/specification/0.5/schema/node.vgo.collider.schema.json new file mode 100644 index 0000000..71bd716 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/node.vgo.colliders.schema.json b/Documentation~/VGO/specification/0.5/schema/node.vgo.colliders.schema.json new file mode 100644 index 0000000..8e92d7c --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/node.vgo.gameobject.schema.json b/Documentation~/VGO/specification/0.5/schema/node.vgo.gameobject.schema.json new file mode 100644 index 0000000..3547a3e --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/node.vgo.light.schema.json b/Documentation~/VGO/specification/0.5/schema/node.vgo.light.schema.json new file mode 100644 index 0000000..04b4a0c --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/node.vgo.particleSystem.schema.json b/Documentation~/VGO/specification/0.5/schema/node.vgo.particleSystem.schema.json new file mode 100644 index 0000000..f39193e --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/node.vgo.rigidbody.schema.json b/Documentation~/VGO/specification/0.5/schema/node.vgo.rigidbody.schema.json new file mode 100644 index 0000000..972f501 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/node.vgo.transform.schema.json b/Documentation~/VGO/specification/0.5/schema/node.vgo.transform.schema.json new file mode 100644 index 0000000..e9cea09 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/nodes.extensions.schema.json b/Documentation~/VGO/specification/0.5/schema/nodes.extensions.schema.json new file mode 100644 index 0000000..b99de87 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.animationCurve.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.animationCurve.schema.json new file mode 100644 index 0000000..c22b008 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.gradient.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.gradient.schema.json new file mode 100644 index 0000000..a3d0d4e --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.gradientAlphakey.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.gradientAlphakey.schema.json new file mode 100644 index 0000000..1b46b83 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.gradientColorKey.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.gradientColorKey.schema.json new file mode 100644 index 0000000..1ed96f4 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.keyframe.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.keyframe.schema.json new file mode 100644 index 0000000..fff0fec --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.meta.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.meta.schema.json new file mode 100644 index 0000000..522f9f3 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.physicMaterial.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.physicMaterial.schema.json new file mode 100644 index 0000000..8765d5f --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.burst.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.burst.schema.json new file mode 100644 index 0000000..c208f18 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.collisionModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.collisionModule.schema.json new file mode 100644 index 0000000..98afc04 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.colorBySpeedModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.colorBySpeedModule.schema.json new file mode 100644 index 0000000..8d462b4 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.colorOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.colorOverLifetimeModule.schema.json new file mode 100644 index 0000000..27e8172 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.customDataModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.customDataModule.schema.json new file mode 100644 index 0000000..33d09a8 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.emission.module.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.emission.module.json new file mode 100644 index 0000000..f3486aa --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.emissionModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.emissionModule.schema.json new file mode 100644 index 0000000..f1e4507 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.externalForcesModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.externalForcesModule.schema.json new file mode 100644 index 0000000..25b5c02 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.forceOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.forceOverLifetimeModule.schema.json new file mode 100644 index 0000000..77bf6c8 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.inheritVelocityModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.inheritVelocityModule.schema.json new file mode 100644 index 0000000..3426596 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.lightsModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.lightsModule.schema.json new file mode 100644 index 0000000..ab60af8 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.limitVelocityOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.limitVelocityOverLifetimeModule.schema.json new file mode 100644 index 0000000..cca0984 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.main.module.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.main.module.json new file mode 100644 index 0000000..60d3faa --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.mainModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.mainModule.schema.json new file mode 100644 index 0000000..c28411c --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.minMaxCurve.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.minMaxCurve.schema.json new file mode 100644 index 0000000..6f46bfe --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.minMaxGradient.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.minMaxGradient.schema.json new file mode 100644 index 0000000..1af6427 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.noiseModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.noiseModule.schema.json new file mode 100644 index 0000000..1cb0ee6 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.renderer.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.renderer.schema.json new file mode 100644 index 0000000..3212748 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.rotationBySpeedModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.rotationBySpeedModule.schema.json new file mode 100644 index 0000000..35f66dc --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.rotationOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.rotationOverLifetimeModule.schema.json new file mode 100644 index 0000000..53b4ca2 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.shapeModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.shapeModule.schema.json new file mode 100644 index 0000000..972b5af --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.sizeBySpeedModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.sizeBySpeedModule.schema.json new file mode 100644 index 0000000..ccb29e1 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.sizeOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.sizeOverLifetimeModule.schema.json new file mode 100644 index 0000000..5f9c2dd --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.subEmittersModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.subEmittersModule.schema.json new file mode 100644 index 0000000..e68b5f6 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.textureSheetAnimationModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.textureSheetAnimationModule.schema.json new file mode 100644 index 0000000..e94c1ab --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.trailModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.trailModule.schema.json new file mode 100644 index 0000000..c1dda3f --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.triggerModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.triggerModule.schema.json new file mode 100644 index 0000000..4458a45 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.ps.velocityOverLifetimeModule.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.ps.velocityOverLifetimeModule.schema.json new file mode 100644 index 0000000..183b5ee --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.right.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.right.schema.json new file mode 100644 index 0000000..47e1c63 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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.5/schema/vgo.schema.json b/Documentation~/VGO/specification/0.5/schema/vgo.schema.json new file mode 100644 index 0000000..b395fc8 --- /dev/null +++ b/Documentation~/VGO/specification/0.5/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 396ed62..ca2059f 100644 --- a/README.ja.md +++ b/README.ja.md @@ -2,430 +2,66 @@ VGO とは、Collider と Rigidbody の情報を格納可能な Unity 向け3Dデータフォーマットです。 +___ ## 特徴 + - glTF (GLB) 2.0 の拡張フォーマットになります。 -- ノードに Collider, Rigidbody, Light, 権利情報に関する拡張定義を追加しています。 -- Unity の GameObject の Transform, Rigidbody, Collider, PhysicMaterial, Mesh, Material, Texture, Light を保存することができます。 -- Standard, Unlit, MToon のシェーダー設定を保存することができます。 +- Unity の `GameObject`, `Transform`, `Rigidbody`, `Collider`, `Mesh`, `Material`, `Texture`, `Light`, `ParticleSystem` を保存することができます。 +- シェーダー設定は `Standard`, `Particle`, `Unlit`, `MToon` を保存することができます。 ___ -## glTFのJSONスキーマ - -以下の拡張定義が追加されます。 - -### glTF.extensionsUsed - -|定義名|説明| -|:---|:---| -|VGO|VGO を使用するという宣言です。| -|VGO_nodes|VGO_nodes を使用するという宣言です。| -|VGO_materials|VGO_materials を使用するという宣言です。| -|KHR_materials_unlit|マテリアルに Unlit シェーダーを使用可能であるという宣言です。| -|VRMC_materials_mtoon|マテリアルに MToon シェーダーを使用可能であるという宣言です。| - -### glTF.extensionsRequired - -|定義名|説明| -|:---|:---| -|VGO|VGO 拡張へのサポートを必要とします。| -|VGO_nodes|VGO_nodes 拡張へのサポートを必要とします。| -|VGO_materials|VGO_materials 拡張へのサポートを必要とします。| -|KHR_materials_unlit|KHR_materials_unlit 拡張へのサポートを必要とします。| -|VRMC_materials_mtoon|VRMC_materials_mtoon 拡張へのサポートを必要とします。| - -### glTF.extensions - -|定義名|説明| -|:---|:---| -|VGO|VGO情報| - -### glTF.extensions.VGO - -|定義名|説明| -|:---|:---| -|meta|VGOメタ情報| -|right|VGO権利情報| - -### glTF.nodes.[*].extensions - -|定義名|説明| -|:---|:---| -|VGO_nodes|ノードVGO情報| - -### glTF.nodes.[*].extensions.VGO_nodes - -|定義名|説明| -|:---|:---| -|gameObject|ゲームオブジェクト情報| -|colliders|コライダー情報| -|rigidbody|剛体情報| -|light|ライト情報| -|right|VGO権利情報| - -### glTF.materials.[*].extensions - -|定義名|説明| -|:---|:---| -|KHR_materials_unlit|Unlit マテリアル情報| -|VGO_materials|VGO マテリアル情報| -|VRMC_materials_mtoon|MToon マテリアル情報| +## 実装 + +- glTF + - accessors + - animations (unimplemented) + - asset + - buffers + - bufferViews + - cameras (unimplemented) + - images + - materials + - extensions + - VGO_materials + - VGO_materials_particle + - KHR_materials_unlit + - VRMC_materials_mtoon + - meshes + - nodes + - extensions + - VGO_nodes + - gameObject + - colliders + - collider + - rigidbody + - light + - particleSystem + - right + - samplers + - scene + - scenes + - skins + - textures + - extensions + - VGO + - meta + - right + - extras ___ -## 拡張定義の詳細 - -### vgo.meta(VGOメタ情報) - -|定義名|説明|型|固定値| -|:---|:---|:---:|:---:| -|generatorName|生成ツールの名前です。|string|UniVGO| -|generatorVersion|生成ツールのバージョンです。|string|0.6.0| -|specVersion|VGOの仕様バージョンです。|string|0.4| - -### vgo.right(権利情報) +## 仕様 -|定義名|説明|型|備考| -|:---|:---|:---:|:---| -|title|作品の名前です。|string|必須| -|author|クリエイターの名前です。|string|必須| -|organization|クリエイターの所属する組織です。|string|| -|createdDate|作品の作成日です。|string|形式の規定はありません。| -|updatedDate|作品の更新日です。|string|形式の規定はありません。| -|version|作品のバージョンです。|string|形式の規定はありません。| -|distributionUrl|配布URLです。|string|URL形式| -|licenseUrl|ライセンスの記載されたURLです。|string|URL形式| - -### node.vgo.gameobject(ゲームオブジェクト) - -|定義名|説明|型|設定値|既定値| -|:---|:---|:---:|:---:|:---:| -|isActive|ゲームオブジェクトが活性かどうか。|bool|true / false|true| -|isStatic|ゲームオブジェクトが静的かどうか。|bool|true / false|false| -|tag|ゲームオブジェクトに付けられたタグ。|string||Untagged| -|layer|ゲームオブジェクトの位置するレイヤー。|int|[0, 31]|0| - -### node.vgo.collider(コライダー) - -|定義名|説明|型|設定値|Box|Capsule|Sphere| -|:---|:---|:---:|:---:|:---:|:---:|:---:| -|enabled|コライダーが有効かどうか。|bool|true / false|*|*|*| -|type|コライダーの種類です。|string|Box / Capsule / Sphere|*|*|*| -|isTrigger|コライダーがトリガーかどうか。|bool|true / false|*|*|*| -|center|コライダーの中心座標です。(単位はm)|float[3]|[x, y, z]|*|*|*| -|size|コライダーのサイズです。(単位はm)|float[3]|[x, y, z]|*|-|-| -|radius|コライダーの半径です。|float|[0, infinity]|-|*|*| -|height|コライダーの高さです。|float|[0, infinity]|-|*|-| -|direction|コライダーの向きです。|int|0:X / 1:Y / 2:Z|-|*|-| -|physicMaterial|共有物理特性マテリアル情報です。|node.vgo.physicMaterial||*|*|*| - -### node.vgo.physicMaterial(物理特性マテリアル) - -|定義名|説明|型|設定値| -|:---|:---|:---:|:---:| -|dynamicFriction|移動している物体に対する摩擦です。|float|[0.0, 1.0]| -|staticFriction|面上で静止しているオブジェクトに使用される摩擦です。|float|[0.0, 1.0]| -|bounciness|表面にどれだけ弾性があるか。|float|[0.0, 1.0]| -|frictionCombine|衝突するオブジェクト間の摩擦の処理タイプです。|string|Average / Minimum / Maximum / Multiply| -|bounceCombine|衝突するオブジェクト間の跳ね返しの処理タイプです。|string|Average / Minimum / Maximum / Multiply| - -### node.vgo.rigidbody(剛体) - -|定義名|説明|型|設定値| -|:---|:---|:---:|:---:| -|mass|物体の質量です。(単位はkg)|float|[0.0000001, 1000000000]| -|drag|力によって動く際にオブジェクトに影響する空気抵抗の大きさです。|float|[0.0, infinity]| -|angularDrag|トルクによって回転する際にオブジェクトに影響する空気抵抗の大きさです。|float|[0.0, infinity]| -|useGravity|オブジェクトが重力の影響を受けるかどうか。|bool|true / false| -|isKinematic|物理が剛体に影響を与えるかどうかどうか。|bool|true / false| -|interpolation|補完のタイプです。|string|None / Interpolate / Extrapolate| -|collisionDetectionMode|衝突の検知のモードです。|string|Discrete / Continuous / ContinuousDynamic / ContinuousSpeculative| -|constraints|剛体の動きを制限するフラグです。|int|FreesePositionX(2) \| FreesePositionY(4) \| FreesePositionZ(8) \| FreeseRotationX(16) \| FreeseRotationY(32) \| FreeseRotationZ(64)| - -### node.vgo.light(ライト) - -|定義名|説明|型|設定値|既定値|Spot|Directional|Point|Rectangle|Disc| -|:---|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -|enabled|ライトが有効かどうか。|bool|true / false|true|*|*|*|*|*| -|type|ライトのタイプ。|string|Spot / Directional / Point / Rectangle / Disc|Spot|*|*|*|*|*| -|shape|スポットライトの形状。|string|Cone / Pyramid / Box|Cone|*|-|-|-|-| -|range|光の範囲。|float|[0, infinity]||*|-|*|*|*| -|spotAngle|ライトのスポットライトコーンの角度(度単位)。|float|[0, infinity]||*|-|-|-|-| -|areaSize|エリアライトのサイズ。|float[2]|x, y||-|-|-|*|-| -|areaRadius|エリアライトの半径。|float|[0, infinity]||-|-|-|-|*| -|color|ライトの色。|float[4]|r, g, b, a||*|*|*|*|*| -|lightmapBakeType|ライトマップのベイクタイプ。|string|Baked / Realtime / Mixed||*|*|*|*|*| -|intensity|ライトの輝度。|float|[0, infinity]||*|*|*|*|*| -|bounceIntensity|バウンス照明の輝度を定義する乗数。|float|[0, infinity]||*|*|*|*|*| -|shadows|この光が影を落とす方法。|string|None / Hard / Soft|None|*|*|*|*|*| -|shadowRadius|影の半径。|float|[0, infinity]||*|-|*|-|-| -|shadowAngle|影の角度。|float|[0, infinity]||-|*|-|-|-| -|shadowStrength|ライトの影の強さ。|float|[0, infinity]||-|*|*|-|-| -|shadowResolution|シャドウマップの解像度。|string|FromQualitySettings / Low / Medium / High / VeryHigh|FromQualitySettings|-|*|*|-|-| -|shadowBias|シャドウマッピング定数バイアス。|float|[0, infinity]||-|*|*|-|-| -|shadowNormalBias|シャドウマッピング法線ベースのバイアス。|float|[0, infinity]||-|*|*|-|-| -|shadowNearPlane|シャドウ ニア プレーン。|float|[0, infinity]||-|*|*|-|-| -|renderMode|レンダー モード。|string|Auto / ForcePixel / ForceVertex|Auto|*|*|*|*|*| -|cullingMask|カリング マスク。|int|[-1, infinity]|-1 (Everything)|*|*|*|*|*| - -Cookie, Flare, Halo は対象外です。 - -### VGO_materials - -|定義名|説明|型|備考| -|:---|:---|:---:|:---:| -|shaderName|シェーダー名。|string|| - -### VRMC_materials_mtoon - -|定義名|説明|型|設定値|既定値| -|:---|:---|:---:|:---:|:---:| -|version||string||32| -|renderMode||string|opaque / cutout / transparent / transparentWithZWrite|opaque| -|cullMode||string|off / flont / back|off| -|renderQueueOffsetNumber||int||| -|litFactor||float[4]|[r, g, b, a]|| -|litMultiplyTexture||int||| -|shadeFactor||float[4]|[r, g, b, a]|| -|shadeMultiplyTexture||int||| -|cutoutThresholdFactor||float|[0.0, 1.0]|| -|shadingShiftFactor||float|[-1.0, 1.0]|| -|shadingToonyFactor||float|[0.0, 1.0]|| -|shadowReceiveMultiplierFactor||float|[0.0, 1.0]|| -|shadowReceiveMultiplierMultiplyTexture||int||| -|litAndShadeMixingMultiplierFactor||float|[0.0, 1.0]|| -|litAndShadeMixingMultiplierMultiplyTexture||int||| -|lightColorAttenuationFactor||float|[0.0, 1.0]|| -|giIntensityFactor||float|[0.0, 1.0]|| -|normalTexture||int||| -|normalScaleFactor||float||| -|emissionFactor||float[3]|[r, g, b]|| -|emissionMultiplyTexture||int||| -|additiveTexture||int||| -|rimFactor||float[4]|[r, g, b, a]|| -|rimMultiplyTexture||int||| -|rimLightingMixFactor||float|[0.0, 1.0]|| -|rimFresnelPowerFactor||float|[0.0, 100.0]|| -|rimLiftFactor||float|[0.0, 1.0]|| -|outlineWidthMode||string|none / worldCoordinates / screenCoordinates|none| -|outlineWidthFactor||float|[0.01, 1.0]|| -|outlineWidthMultiplyTexture||int||| -|outlineScaledMaxDistanceFactor||float|[1.0, 10.0]|| -|outlineColorMode||string|fixedColor / mixedLighting|fixedColor| -|outlineFactor||float[4]|[r, g, b, a]|| -|outlineLightingMixFactor||float|[0.0, 1.0]|| -|mainTextureLeftBottomOriginScale||float[2]|[x, y]|| -|mainTextureLeftBottomOriginOffset||float[2]|[x, y]|| -|uvAnimationMaskTexture||int||| -|uvAnimationScrollXSpeedFactor||float||| -|uvAnimationScrollYSpeedFactor||float||| -|uvAnimationRotationSpeedFactor||float||| - -https://github.com/vrm-c/vrm-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) +- 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) ___ -## glTFのJSONの構造例 - - -### glTF.extensions -```json -JSON{ - "asset": { - }, - "buffers": [ - ], - "extensionsUsed": [ - "VGO", - "VGO_nodes", - "VGO_materials", - "KHR_materials_unlit", - "VRMC_materials_mtoon" - ], - "extensionsRequired": [ - "VGO", - "VGO_nodes", - "VGO_materials", - "KHR_materials_unlit", - "VRMC_materials_mtoon" - ], - "extensions": { - "VGO": { - "meta": { - "generatorName": "UniVGO", - "generatorVersion": "0.6.0", - "specVersion": "0.4" - }, - "right": { - "title": "Test Stage", - "author": "Izayoi Jiichan", - "organization": "Izayoi", - "createdDate": "2020-01-01", - "updatedDate": "2020-01-17", - "version": "1.3", - "distributionUrl": "https://github.com/izayoijiichan/VGO", - "licenseUrl": "https://github.com/izayoijiichan/VGO/blob/master/UniVgo/LICENSE.md" - } - } - }, - "extras": {} -} -``` - -### glTF.nodes.[*].extensions -```json -JSON{ - "nodes": [ - { - "name": "Capsule1", - "translation": [ 1, 1, 1 ], - "rotation": [ 0, 0, 0, 1 ], - "scale": [ 0.5, 0.5, 0.5 ], - "mesh": 0, - "extensions": { - "VGO_nodes": { - "gameObject": { - "isActive": false, - "isStatic": true, - "tag": "Player", - "layer": 2 - }, - "colliders": [ - { - "enabled": false, - "type": "Capsule", - "isTrigger": false, - "center": [ 0, 0, 0 ], - "radius": 0.5, - "height": 2, - "direction": 1, - "physicMaterial":{ - "dynamicFriction":0.6, - "staticFriction":0.6, - "bounciness":0.0, - "frictionCombine":"Average", - "bounceCombine":"Multiply" - } - } - ], - "rigidbody": { - "mass": 10, - "drag": 0, - "angularDrag": 0.05, - "useGravity": true, - "isKinematic": false, - "interpolation": "None", - "collisionDetectionMode": "Discrete", - "constraints": 36 - }, - "light":{ - "enabled":true, - "type":"Point", - "shape":"", - "range":1.0, - "spotAngle":0.0, - "areaSize":[ 0.0, 0.0 ], - "areaRadius":0.0, - "color":[ 0.122,0.404,0.637,1.0 ], - "lightmapBakeType":"Realtime", - "intensity":1.0, - "bounceIntensity":1.0, - "shadows":"Soft", - "shadowRadius":1.0, - "shadowAngle":0.0, - "shadowStrength":1.0, - "shadowResolution":"Low", - "shadowBias":0.004, - "shadowNormalBias":0.26, - "shadowNearPlane":0.1, - "renderMode":"Auto", - "cullingMask":-1 - }, - "right": { - "title": "Capsule1", - "author": "Izayoi Jiichan", - "organization": "", - "createdDate": "2020-01-01", - "updatedDate": "2020-01-17", - "version": "0.4", - "distributionUrl": "", - "licenseUrl": "" - } - } - }, - "extras": {} - } - ] -} -``` +## 説明書 -### glTF.materials.[*].extensions -```json -JSON{ - "materials": [ - { - "name": "MtoonMaterial1", - "pbrMetallicRoughness": { - "baseColorTexture": { - "index": 0, - "texCoord": 0 - }, - "baseColorFactor": [ 1, 1, 1, 1 ], - "metallicFactor": 0, - "roughnessFactor": 0.9 - }, - "alphaMode": "OPAQUE", - "alphaCutoff": 0.5, - "doubleSided": false, - "extensions": { - "KHR_materials_unlit": {}, - "VGO_materials":{ - "shaderName":"VRM/MToon" - }, - "VRMC_materials_mtoon":{ - "version":"32", - "renderMode":"opaque", - "cullMode":"back", - "renderQueueOffsetNumber":0, - "litFactor":[ 0.811,0.916,0.723,1.0 ], - "litMultiplyTexture":0, - "shadeFactor":[ 0.933,0.620,0.711,1.0 ], - "shadeMultiplyTexture":-1, - "cutoutThresholdFactor":0.5, - "shadingShiftFactor":0.0, - "shadingToonyFactor":0.9, - "shadowReceiveMultiplierFactor":1.0, - "shadowReceiveMultiplierMultiplyTexture":-1, - "litAndShadeMixingMultiplierFactor":1.0, - "litAndShadeMixingMultiplierMultiplyTexture":-1, - "lightColorAttenuationFactor":0.0, - "giIntensityFactor":0.1, - "normalTexture":-1, - "normalScaleFactor":1.0, - "emissionFactor":[ 0.0,0.0,0.0,1.0 ], - "emissionMultiplyTexture":-1, - "additiveTexture":-1, - "rimFactor":[ 0.0,0.0,0.0,1.0 ], - "rimMultiplyTexture":-1, - "rimLightingMixFactor":0.0, - "rimFresnelPowerFactor":1.0, - "rimLiftFactor":0.0, - "outlineWidthMode":"screenCoordinates", - "outlineWidthFactor":0.5, - "outlineWidthMultiplyTexture":-1, - "outlineScaledMaxDistanceFactor":1.0, - "outlineColorMode":"fixedColor", - "outlineFactor":[ 0.0,0.0,0.0,1.0 ], - "outlineLightingMixFactor":1.0, - "mainTextureLeftBottomOriginScale":[ 1.0,1.0 ], - "mainTextureLeftBottomOriginOffset":[ 0.0,0.0 ], - "uvAnimationMaskTexture":-1, - "uvAnimationScrollXSpeedFactor":0.0, - "uvAnimationScrollYSpeedFactor":0.0, - "uvAnimationRotationSpeedFactor":0.0 - } - } - } - ] -} -``` +- [glTF.extensions](https://github.com/izayoijiichan/VGO/blob/master/Documentation~/VGO/instructions/schema.json.md) +- [glTF.materials.extensions](https://github.com/izayoijiichan/VGO/blob/master/Documentation~/VGO/instructions/schema.json.materials.md) +- [glTF.nodes.extensions](https://github.com/izayoijiichan/VGO/blob/master/Documentation~/VGO/instructions/schema.json.nodes.md) ___ ## ツール @@ -445,7 +81,7 @@ VGOファイルの中身を確認するためのツールです。 https://github.com/izayoijiichan/vgo.parameter.viewer ___ -最終更新日:2020年1月17日 +最終更新日:2020年1月23日 編集者:十六夜おじいちゃん *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/README.md b/README.md index 18b75bb..643ecf6 100644 --- a/README.md +++ b/README.md @@ -3,428 +3,64 @@ VGO is a 3D data format for Unity that can store Collider and Rigidbody information. ## Features + - glTF (GLB) 2.0 extended format. -- Added extended definitions for Collider, Rigidbody, Light and rights information to nodes. -- Unity GameObject Transform, Rigidbody, Collider, PhysicMaterial, Mesh, Material, Texture, Light can be saved. -- Standard, Unlit and MToon shader settings can be saved. +- 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. ___ -## JSON schema of glTF - -The following extended definitions are added: - -### glTF.extensionsUsed - -|Definition name|Description| -|:---|:---| -|VGO|Declaration to use VGO.| -|VGO_nodes|Declaration to use VGO_nodes.| -|VGO_materials|Declaration to use VGO_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.| - -### glTF.extensionsRequired - -|Definition name|Description| -|:---|:---| -|VGO|Requires support for VGO extensions.| -|VGO_nodes|Requires support for VGO_nodes extension.| -|VGO_materials|Requires support for VGO_materials extension.| -|KHR_materials_unlit|Requires support for the KHR_materials_unlit extension.| -|VRMC_materials_mtoon|Requires support for the VRMC_materials_mtoon extension.| - -### glTF.extensions - -|Definition name|Description| -|:---|:---| -|VGO|VGO information| - -### glTF.extensions.VGO - -|definition name|description| -|:---|:---| -|meta|VGO meta information| -|right|VGO rights information| +## Implementation + +- glTF + - accessors + - animations (unimplemented) + - asset + - buffers + - bufferViews + - cameras (unimplemented) + - images + - materials + - extensions + - VGO_materials + - VGO_materials_particle + - KHR_materials_unlit + - VRMC_materials_mtoon + - meshes + - nodes + - extensions + - VGO_nodes + - gameObject + - colliders + - collider + - rigidbody + - light + - particleSystem + - right + - samplers + - scene + - scenes + - skins + - textures + - extensions + - VGO + - meta + - right + - extras -### glTF.nodes.[*].extensions - -|definition name|description| -|:---|:---| -|VGO_nodes|Node VGO information| - -### glTF.nodes.[*].extensions.VGO_nodes - -|definition name|description| -|:---|:---| -|gameObject|GameObject information| -|colliders|Collider information| -|rigidbody|Rigid body information| -|light|Light information| -|right|VGO rights information| - -### glTF.materials.[*].extensions - -|definition name|description| -|:---|:---| -|KHR_materials_unlit|Unlit material information| -|VGO_materials|VGO material information| -|VRMC_materials_mtoon|MToon material information| ___ -## Extended definition details - -### vgo.meta - -|definition name|description|type|fixed value| -|:---|:---|:---:|:---:| -|generatorName|The name of the generation tool.|string|UniVGO| -|generatorVersion|The generation tool version.|string|0.6.0| -|specVersion|VGO specification version.|string|0.4| - -### vgo.right - -|definition name|description|type|remarks| -|:---|:---|:---:|:---| -|title|The name of the work.|string|Required| -|author|The name of the creator.|string|Required| -|organization|The organization to which the creator belongs.|string|| -|createdDate|The creation date of the work.|string|There is no format specification.| -|updatedDate|The update date of the work.|string|There is no format specification.| -|version|The version of the work.|string|There is no format specification.| -|distributionUrl|Distribution URL.|string|URL format| -|licenseUrl|The URL where the license is written.|string|URL format| +## Specification -### node.vgo.gameobject - -|definition name|description|type|setting value|default value| -|:---|:---|:---:|:---:|:---:| -|isActive|Whether the GameObject is active.|bool|true / false|true| -|isStatic|Whether the GameObject is static.|bool|true / false|false| -|tag|Tag attached to GameGbject.|string||Untagged| -|layer|The layer on which the GameObject is located.|int|[0, 31]|0| - -### node.vgo.collider - -|definition name|description|type|setting value|Box|Capsule|Sphere| -|:---|:---|:---:|:---:|:---:|:---:|:---:| -|enabled|Whether the collider is enable.|bool|true / false|*|*|*| -|type|The type of collider.|string|Box / Capsule / Sphere|*|*|*| -|isTrigger|Whether the collider is a trigger.|bool|true / false|*|*|*| -|center|The center of the collider.(Unit is m)|float[3]|[x, y, z]|*|*|*| -|size|The total size of the collider.(Unit is m)|float[3]|[x, y, z]|*|-|-| -|radius|The radius of the collider.|float|[0, infinity]|-|*|*| -|height|The height of the collider.|float|[0, infinity]|-|*|-| -|direction|The direction of the collider.|int|0:X / 1:Y / 2:Z|-|*|-| -|physicMaterial|The physic material of this collider.|node.vgo.physicMaterial||*|*|*| - -### node.vgo.physicMaterial - -|definition name|description|type|setting value| -|:---|:---|:---:|:---:| -|dynamicFriction|Friction against a moving object.|float|[0.0, 1.0]| -|staticFriction|Friction used for objects that are stationary on a surface.|float|[0.0, 1.0]| -|bounciness|How elastic is the surface.|float|[0.0, 1.0]| -|frictionCombine|The type of friction handling between colliding objects.|string|Average / Minimum / Maximum / Multiply| -|bounceCombine|Processing type for bounce between colliding objects.|string|Average / Minimum / Maximum / Multiply| - -### node.vgo.rigidbody - -|definition name|description|type|setting value| -|:---|:---|:---:|:---:| -|mass|The mass of the object. (Unit is kg)|float|[0.0000001, 1000000000]| -|drag|The amount of air resistance that affects an object when it is moved by force.|float|[0.0, infinity]| -|angularDrag|The amount of air resistance that affects the object when rotating by torque.|float|[0.0, infinity]| -|useGravity|Whether the object is affected by gravity.|bool|true / false| -|isKinematic|Whether physics affects the rigid body.|bool|true / false| -|interpolation|The type of completion.|string|None / Interpolate / Extrapolate| -|collisionDetectionMode|Collision detection mode.|string|Discrete / Continuous / ContinuousDynamic / ContinuousSpeculative| -|constraints|The flags that restricts the movement of the rigid body.|int|FreesePositionX(2) \| FreesePositionY(4) \| FreesePositionZ(8) \| FreeseRotationX(16) \| FreeseRotationY(32) \| FreeseRotationZ(64)| - -### node.vgo.light - -|definition name|description|type|setting value|default value|Spot|Directional|Point|Rectangle|Disc| -|:---|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -|enabled|Whether the light is enable.|bool|true / false|true|*|*|*|*|*| -|type|The type of the light.|string|Spot / Directional / Point / Rectangle / Disc|Spot|*|*|*|*|*| -|shape|This property describes the shape of the spot light.|string|Cone / Pyramid / Box|Cone|*|-|-|-|-| -|range|The range of the light.|float|[0, infinity]||*|-|*|*|*| -|spotAngle|The angle of the light's spotlight cone in degrees.|float|[0, infinity]||*|-|-|-|-| -|areaSize|The size of the area light.|float[2]|x, y||-|-|-|*|-| -|areaRadius|The radius of the area light|float|[0, infinity]||-|-|-|-|*| -|color|The color of the light.|float[4]|r, g, b, a||*|*|*|*|*| -|lightmapBakeType|This property describes what part of a light's contribution can be baked.|string|Baked / Realtime / Mixed||*|*|*|*|*| -|intensity|The Intensity of a light is multiplied with the Light color.|float|[0, infinity]||*|*|*|*|*| -|bounceIntensity|The multiplier that defines the strength of the bounce lighting.|float|[0, infinity]||*|*|*|*|*| -|shadows|How this light casts shadows.|string|None / Hard / Soft|None|*|*|*|*|*| -|shadowRadius|Controls the amount of artificial softening applied to the edges of shadows cast by the Point or Spot light.|float|[0, infinity]||*|-|*|-|-| -|shadowAngle|Controls the amount of artificial softening applied to the edges of shadows cast by directional lights.|float|[0, infinity]||-|*|-|-|-| -|shadowStrength|Strength of light's shadows.|float|[0, infinity]||-|*|*|-|-| -|shadowResolution|The resolution of the shadow map.|string|FromQualitySettings / Low / Medium / High / VeryHigh|FromQualitySettings|-|*|*|-|-| -|shadowBias|Shadow mapping constant bias.|float|[0, infinity]||-|*|*|-|-| -|shadowNormalBias|Shadow mapping normal-based bias.|float|[0, infinity]||-|*|*|-|-| -|shadowNearPlane|Near plane value to use for shadow frustums.|float|[0, infinity]||-|*|*|-|-| -|renderMode|How to render the light.|string|Auto / ForcePixel / ForceVertex|Auto|*|*|*|*|*| -|cullingMask|This is used to light certain objects in the Scene selectively.|int|[-1, infinity]|-1 (Everything)|*|*|*|*|*| - -Cookie, Flare, Halo are not supported. - -### VGO_materials - -|definition name|description|type|remarks| -|:---|:---|:---:|:---:| -|shaderName|The name of shader.|string|| - -### VRMC_materials_mtoon - -|definition name|description|type|setting value|default value| -|:---|:---|:---:|:---:|:---:| -|version||string||32| -|renderMode||string|opaque / cutout / transparent / transparentWithZWrite|opaque| -|cullMode||string|off / flont / back|off| -|renderQueueOffsetNumber||int||| -|litFactor||float[4]|[r, g, b, a]|| -|litMultiplyTexture||int||| -|shadeFactor||float[4]|[r, g, b, a]|| -|shadeMultiplyTexture||int||| -|cutoutThresholdFactor||float|[0.0, 1.0]|| -|shadingShiftFactor||float|[-1.0, 1.0]|| -|shadingToonyFactor||float|[0.0, 1.0]|| -|shadowReceiveMultiplierFactor||float|[0.0, 1.0]|| -|shadowReceiveMultiplierMultiplyTexture||int||| -|litAndShadeMixingMultiplierFactor||float|[0.0, 1.0]|| -|litAndShadeMixingMultiplierMultiplyTexture||int||| -|lightColorAttenuationFactor||float|[0.0, 1.0]|| -|giIntensityFactor||float|[0.0, 1.0]|| -|normalTexture||int||| -|normalScaleFactor||float||| -|emissionFactor||float[3]|[r, g, b]|| -|emissionMultiplyTexture||int||| -|additiveTexture||int||| -|rimFactor||float[4]|[r, g, b, a]|| -|rimMultiplyTexture||int||| -|rimLightingMixFactor||float|[0.0, 1.0]|| -|rimFresnelPowerFactor||float|[0.0, 100.0]|| -|rimLiftFactor||float|[0.0, 1.0]|| -|outlineWidthMode||string|none / worldCoordinates / screenCoordinates|none| -|outlineWidthFactor||float|[0.01, 1.0]|| -|outlineWidthMultiplyTexture||int||| -|outlineScaledMaxDistanceFactor||float|[1.0, 10.0]|| -|outlineColorMode||string|fixedColor / mixedLighting|fixedColor| -|outlineFactor||float[4]|[r, g, b, a]|| -|outlineLightingMixFactor||float|[0.0, 1.0]|| -|mainTextureLeftBottomOriginScale||float[2]|[x, y]|| -|mainTextureLeftBottomOriginOffset||float[2]|[x, y]|| -|uvAnimationMaskTexture||int||| -|uvAnimationScrollXSpeedFactor||float||| -|uvAnimationScrollYSpeedFactor||float||| -|uvAnimationRotationSpeedFactor||float||| - -https://github.com/vrm-c/vrm-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) +- 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) ___ -## Example of glTF JSON structure - - -### glTF.extensions -```json -JSON{ - "asset": { - }, - "buffers": [ - ], - "extensionsUsed": [ - "VGO", - "VGO_nodes", - "VGO_materials", - "KHR_materials_unlit", - "VRMC_materials_mtoon" - ], - "extensionsRequired": [ - "VGO", - "VGO_nodes", - "VGO_materials", - "KHR_materials_unlit", - "VRMC_materials_mtoon" - ], - "extensions": { - "VGO": { - "meta": { - "generatorName": "UniVGO", - "generatorVersion": "0.6.0", - "specVersion": "0.4" - }, - "right": { - "title": "Test Stage", - "author": "Izayoi Jiichan", - "organization": "Izayoi", - "createdDate": "2020-01-01", - "updatedDate": "2020-01-17", - "version": "1.3", - "distributionUrl": "https://github.com/izayoijiichan/VGO", - "licenseUrl": "https://github.com/izayoijiichan/VGO/blob/master/UniVgo/LICENSE.md" - } - } - }, - "extras": {} -} -``` - -### glTF.nodes.[*].extensions -```json -JSON{ - "nodes": [ - { - "name": "Capsule1", - "translation": [ 1, 1, 1 ], - "rotation": [ 0, 0, 0, 1 ], - "scale": [ 0.5, 0.5, 0.5 ], - "mesh": 0, - "extensions": { - "VGO_nodes": { - "gameObject": { - "isActive": false, - "isStatic": true, - "tag": "Player", - "layer": 2 - }, - "colliders": [ - { - "enabled": false, - "type": "Capsule", - "isTrigger": false, - "center": [ 0, 0, 0 ], - "radius": 0.5, - "height": 2, - "direction": 1, - "physicMaterial":{ - "dynamicFriction":0.6, - "staticFriction":0.6, - "bounciness":0.0, - "frictionCombine":"Average", - "bounceCombine":"Multiply" - } - } - ], - "rigidbody": { - "mass": 10, - "drag": 0, - "angularDrag": 0.05, - "useGravity": true, - "isKinematic": false, - "interpolation": "None", - "collisionDetectionMode": "Discrete", - "constraints": 36 - }, - "light":{ - "enabled":true, - "type":"Point", - "shape":"", - "range":1.0, - "spotAngle":0.0, - "areaSize":[ 0.0, 0.0 ], - "areaRadius":0.0, - "color":[ 0.122,0.404,0.637,1.0 ], - "lightmapBakeType":"Realtime", - "intensity":1.0, - "bounceIntensity":1.0, - "shadows":"Soft", - "shadowRadius":1.0, - "shadowAngle":0.0, - "shadowStrength":1.0, - "shadowResolution":"Low", - "shadowBias":0.004, - "shadowNormalBias":0.26, - "shadowNearPlane":0.1, - "renderMode":"Auto", - "cullingMask":-1 - }, - "right": { - "title": "Capsule1", - "author": "Izayoi Jiichan", - "organization": "", - "createdDate": "2020-01-01", - "updatedDate": "2020-01-17", - "version": "0.4", - "distributionUrl": "", - "licenseUrl": "" - } - } - }, - "extras": {} - } - ] -} -``` +## Instructions -### glTF.materials.[*].extensions -```json -JSON{ - "materials": [ - { - "name": "MtoonMaterial1", - "pbrMetallicRoughness": { - "baseColorTexture": { - "index": 0, - "texCoord": 0 - }, - "baseColorFactor": [ 1, 1, 1, 1 ], - "metallicFactor": 0, - "roughnessFactor": 0.9 - }, - "alphaMode": "OPAQUE", - "alphaCutoff": 0.5, - "doubleSided": false, - "extensions": { - "KHR_materials_unlit": {}, - "VGO_materials":{ - "shaderName":"VRM/MToon" - }, - "VRMC_materials_mtoon":{ - "version":"32", - "renderMode":"opaque", - "cullMode":"back", - "renderQueueOffsetNumber":0, - "litFactor":[ 0.811,0.916,0.723,1.0 ], - "litMultiplyTexture":0, - "shadeFactor":[ 0.933,0.620,0.711,1.0 ], - "shadeMultiplyTexture":-1, - "cutoutThresholdFactor":0.5, - "shadingShiftFactor":0.0, - "shadingToonyFactor":0.9, - "shadowReceiveMultiplierFactor":1.0, - "shadowReceiveMultiplierMultiplyTexture":-1, - "litAndShadeMixingMultiplierFactor":1.0, - "litAndShadeMixingMultiplierMultiplyTexture":-1, - "lightColorAttenuationFactor":0.0, - "giIntensityFactor":0.1, - "normalTexture":-1, - "normalScaleFactor":1.0, - "emissionFactor":[ 0.0,0.0,0.0,1.0 ], - "emissionMultiplyTexture":-1, - "additiveTexture":-1, - "rimFactor":[ 0.0,0.0,0.0,1.0 ], - "rimMultiplyTexture":-1, - "rimLightingMixFactor":0.0, - "rimFresnelPowerFactor":1.0, - "rimLiftFactor":0.0, - "outlineWidthMode":"screenCoordinates", - "outlineWidthFactor":0.5, - "outlineWidthMultiplyTexture":-1, - "outlineScaledMaxDistanceFactor":1.0, - "outlineColorMode":"fixedColor", - "outlineFactor":[ 0.0,0.0,0.0,1.0 ], - "outlineLightingMixFactor":1.0, - "mainTextureLeftBottomOriginScale":[ 1.0,1.0 ], - "mainTextureLeftBottomOriginOffset":[ 0.0,0.0 ], - "uvAnimationMaskTexture":-1, - "uvAnimationScrollXSpeedFactor":0.0, - "uvAnimationScrollYSpeedFactor":0.0, - "uvAnimationRotationSpeedFactor":0.0 - } - } - } - ] -} -``` +- [glTF.extensions](https://github.com/izayoijiichan/VGO/blob/master/Documentation~/VGO/instructions/schema.json.md) +- [glTF.materials.extensions](https://github.com/izayoijiichan/VGO/blob/master/Documentation~/VGO/instructions/schema.json.materials.md) +- [glTF.nodes.extensions](https://github.com/izayoijiichan/VGO/blob/master/Documentation~/VGO/instructions/schema.json.nodes.md) ___ ## Tools @@ -444,7 +80,7 @@ It is distributed at the following URL. https://github.com/izayoijiichan/vgo.parameter.viewer ___ -Last updated: 17 January, 2020 +Last updated: 23 January, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_particle.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_particle.cs new file mode 100644 index 0000000..1bd76ad --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_particle.cs @@ -0,0 +1,180 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_materials_particle +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + using UnityEngine.Rendering; + + #region Enums + + /// + public enum ParticleBlendMode + { + /// + Opaque = 0, + /// + Cutout = 1, + /// + Fade = 2, + /// + Transparent = 3, + /// + Additive = 4, + /// + Subtractive = 5, + /// + Modulate = 6, + } + + /// + public enum ParticleColorMode + { + /// + Multiply = 0, + /// + Additive = 1, + /// + Subtractive = 2, + /// + Overlay = 3, + /// + Color = 4, + /// + Difference = 5, + } + + /// + public enum ParticleFlipBookMode + { + /// + Simple = 0, + /// + Blended = 1, + } + + #endregion + + /// + /// Particles/Standard shader properties + /// + [Serializable] + [JsonObject("material.extensions.VGO_materials_particle")] + public class VGO_materials_particle + { + /// + [JsonProperty("renderMode")] + public ParticleBlendMode renderMode; + + /// + [JsonProperty("colorMode")] + public ParticleColorMode colorMode; + + /// + [JsonProperty("flipBookMode")] + public ParticleFlipBookMode flipBookMode; + + /// + [JsonProperty("cullMode")] + public CullMode cullMode; + + /// + [JsonProperty("softParticlesEnabled")] + public bool softParticlesEnabled; + + /// + [JsonProperty("softParticleFadeParams")] + public float[] softParticleFadeParams; + + /// + [JsonProperty("cameraFadingEnabled")] + public bool cameraFadingEnabled; + + /// + [JsonProperty("cameraFadeParams")] + public float[] cameraFadeParams; + + /// + [JsonProperty("distortionEnabled")] + public bool distortionEnabled; + + /// + [JsonProperty("grabTextureIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int grabTextureIndex = -1; + + /// + [JsonProperty("distortionStrengthScaled")] + public float distortionStrengthScaled; + + /// + [JsonProperty("distortionBlend")] + public float distortionBlend; + + /// + [JsonProperty("colorAddSubDiff")] + public float[] colorAddSubDiff; + + /// + [JsonProperty("mainTexIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int mainTexIndex = -1; + + /// Tiling(Scale)[2], Offset[2] + [JsonProperty("mainTexSt")] + public float[] mainTexSt; + + /// + [JsonProperty("color")] + public float[] color; + + /// + [JsonProperty("cutoff")] + public float cutoff; + + /// + [JsonProperty("metallicGlossMapIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int metallicGlossMapIndex = -1; + + /// + [JsonProperty("metallic")] + public float metallic; + + /// + [JsonProperty("glossiness")] + public float glossiness; + + /// + [JsonProperty("bumpMapIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int bumpMapIndex = -1; + + /// + [JsonProperty("bumpScale")] + public float bumpScale; + + /// + [JsonProperty("lightingEnabled")] + public bool lightingEnabled; + + /// + [JsonProperty("emissionEnabled")] + public bool emissionEnabled; + + /// + [JsonProperty("emissionColor")] + public float[] emissionColor; + + /// + [JsonProperty("emissionMapIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + public int emissionMapIndex = -1; + + [JsonIgnore] + public static string ExtensionName => "VGO_materials_particle"; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_particle.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_particle.cs.meta new file mode 100644 index 0000000..94982fe --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/VGO_materials_particle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ddd4794943e82b2418ae4ab565d9d134 +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 f91534b..b72326b 100644 --- a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/glTFMaterial_extensions.cs +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials/glTFMaterial_extensions.cs @@ -18,6 +18,10 @@ public class glTFMaterial_extensions [JsonProperty("VGO_materials")] public VGO_materials VGO_materials = null; + /// + [JsonProperty("VGO_materials_particle")] + public VGO_materials_particle VGO_materials_particle = null; + /// [JsonProperty("KHR_materials_unlit")] public KHR_materials_unlit KHR_materials_unlit = null; diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_ParticleSystem.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_ParticleSystem.cs new file mode 100644 index 0000000..e942c3f --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_ParticleSystem.cs @@ -0,0 +1,121 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_ParticleSystem +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System + /// + [Serializable] + [JsonObject("node.vgo.particleSystem")] + public class VGO_ParticleSystem + { + /// Access the main Particle System settings. + [JsonProperty("main")] + public VGO_PS_MainModule main = null; + + /// Script interface for the EmissionModule of a Particle System. + [JsonProperty("emission")] + public VGO_PS_EmissionModule emission = null; + + /// Script interface for the ShapeModule of a Particle System. + [JsonProperty("shape")] + public VGO_PS_ShapeModule shape = null; + + /// Script interface for the VelocityOverLifetimeModule of a Particle System. + [JsonProperty("velocityOverLifetime")] + public VGO_PS_VelocityOverLifetimeModule velocityOverLifetime = null; + + /// Script interface for the LimitVelocityOverLifetimeModule of a Particle System. + [JsonProperty("limitVelocityOverLifetime")] + public VGO_PS_LimitVelocityOverLifetimeModule limitVelocityOverLifetime = null; + + /// Script interface for the InheritVelocityModule of a Particle System. + [JsonProperty("inheritVelocity")] + public VGO_PS_InheritVelocityModule inheritVelocity = null; + + /// Script interface for the ForceOverLifetimeModule of a Particle System. + [JsonProperty("forceOverLifetime")] + public VGO_PS_ForceOverLifetimeModule forceOverLifetime = null; + + /// Script interface for the ColorOverLifetimeModule of a Particle System. + [JsonProperty("colorOverLifetime")] + public VGO_PS_ColorOverLifetimeModule colorOverLifetime = null; + + /// Script interface for the ColorByLifetimeModule of a Particle System. + [JsonProperty("colorBySpeed")] + public VGO_PS_ColorBySpeedModule colorBySpeed = null; + + /// Script interface for the SizeOverLifetimeModule of a Particle System. + [JsonProperty("sizeOverLifetime")] + public VGO_PS_SizeOverLifetimeModule sizeOverLifetime = null; + + /// Script interface for the SizeBySpeedModule of a Particle System. + [JsonProperty("sizeBySpeed")] + public VGO_PS_SizeBySpeedModule sizeBySpeed = null; + + /// Script interface for the RotationOverLifetimeModule of a Particle System. + [JsonProperty("rotationOverLifetime")] + public VGO_PS_RotationOverLifetimeModule rotationOverLifetime = null; + + /// Script interface for the RotationBySpeedModule of a Particle System. + [JsonProperty("rotationBySpeed")] + public VGO_PS_RotationBySpeedModule rotationBySpeed = null; + + /// Script interface for the ExternalForcesModule of a Particle System. + [JsonProperty("externalForces")] + public VGO_PS_ExternalForcesModule externalForces = null; + + /// Script interface for the NoiseModule of a Particle System. + [JsonProperty("noise")] + public VGO_PS_NoiseModule noise = null; + + /// Script interface for the CollisionModule of a Particle System. + [JsonProperty("collision")] + public VGO_PS_CollisionModule collision = null; + + /// Script interface for the TriggerModule of a Particle System. + [JsonProperty("trigger")] + public VGO_PS_TriggerModule trigger = null; + + /// Script interface for the SubEmittersModule of a Particle System. + [JsonProperty("subEmitters")] + public VGO_PS_SubEmittersModule subEmitters = null; + + /// Script interface for the TextureSheetAnimationModule of a Particle System. + [JsonProperty("textureSheetAnimation")] + public VGO_PS_TextureSheetAnimationModule textureSheetAnimation = null; + + /// Script interface for the LightsModule of a Particle System. + [JsonProperty("lights")] + public VGO_PS_LightsModule lights = null; + + /// Script interface for the TrailsModule of a Particle System. + [JsonProperty("trails")] + public VGO_PS_TrailModule trails = null; + + /// Script interface for the CustomDataModule of a Particle System. + [JsonProperty("customData")] + public VGO_PS_CustomDataModule customData = null; + + ///// Does this system support Procedural Simulation? + //[JsonProperty("proceduralSimulationSupported")] + //public bool proceduralSimulationSupported { get; } + + ///// Controls whether the Particle System uses an automatically-generated random number to seed the random number generator. + //[JsonProperty("useAutoRandomSeed")] + //public bool useAutoRandomSeed = null; + + ///// Override the random seed used for the Particle System emission. + //[JsonProperty("randomSeed")] + //public uint randomSeed = null; + + /// + [JsonProperty("renderer")] + public VGO_PS_Renderer renderer = null; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_ParticleSystem.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_ParticleSystem.cs.meta new file mode 100644 index 0000000..1dd835d --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_ParticleSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e73f2f3c9b2fa774e8e105b50e46195e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Transform.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Transform.cs new file mode 100644 index 0000000..f687ea7 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Transform.cs @@ -0,0 +1,29 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_Transform +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// glTF Node Transform + /// + [Serializable] + [JsonObject("node.vgo.transform")] + public class VGO_Transform + { + /// Position of the transform relative to the parent transform. + [JsonProperty("position")] + public float[] position = null; + + /// The rotation of the transform relative to the transform rotation of the parent. + [JsonProperty("rotation")] + public float[] rotation = null; + + /// The scale of the transform relative to the GameObjects parent. + [JsonProperty("scale")] + public float[] scale = null; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Transform.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Transform.cs.meta new file mode 100644 index 0000000..53764d7 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Transform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef0ef71c634bbd74c838d6c596212bed +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 11820de..86e0623 100644 --- a/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_nodes.cs +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_nodes.cs @@ -31,6 +31,10 @@ public class VGO_nodes [JsonProperty("light")] public VGO_Light light = null; + /// ParticleSystem + [JsonProperty("particleSystem")] + public VGO_ParticleSystem particleSystem = null; + /// Right [JsonProperty("right")] public glTF_VGO_Right right = null; diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_AnimationCurve.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_AnimationCurve.cs new file mode 100644 index 0000000..5ac1b44 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_AnimationCurve.cs @@ -0,0 +1,30 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_AnimationCurve +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO AnimationCurve + /// + [Serializable] + [JsonObject("vgo.animationCurve")] + public class VGO_AnimationCurve + { + /// All keys defined in the animation curve. + [JsonProperty("keys")] + public VGO_Keyframe[] keys = null; + + /// The behaviour of the animation before the first keyframe. + [JsonProperty("preWrapMode")] + public WrapMode preWrapMode; + + /// The behaviour of the animation after the last keyframe. + [JsonProperty("postWrapMode")] + public WrapMode postWrapMode; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_AnimationCurve.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_AnimationCurve.cs.meta new file mode 100644 index 0000000..c87a48d --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_AnimationCurve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1736f0bebabc22469d6b61f607a4005 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Gradient.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Gradient.cs new file mode 100644 index 0000000..8e99e3a --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Gradient.cs @@ -0,0 +1,30 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_Gradient +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Gradient + /// + [Serializable] + [JsonObject("vgo.gradient")] + public class VGO_Gradient + { + /// All color keys defined in the gradient. + [JsonProperty("colorKeys")] + public VGO_GradientColorKey[] colorKeys = null; + + /// All alpha keys defined in the gradient. + [JsonProperty("alphaKeys")] + public VGO_GradientAlphaKey[] alphaKeys = null; + + /// Control how the gradient is evaluated. + [JsonProperty("mode")] + public GradientMode mode; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Gradient.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Gradient.cs.meta new file mode 100644 index 0000000..9a565d6 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Gradient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c51b01bc88da9542a6ec29259ce8acd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientAlphaKey.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientAlphaKey.cs new file mode 100644 index 0000000..c4c5821 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientAlphaKey.cs @@ -0,0 +1,25 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_GradientAlphaKey +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Gradient AlphaKey + /// + [Serializable] + [JsonObject("vgo.gradient.alphaKey")] + public class VGO_GradientAlphaKey + { + /// Alpha channel of key. + [JsonProperty("alpha")] + public float alpha; + + /// Time of the key (0 - 1). + [JsonProperty("time")] + public float time; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientAlphaKey.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientAlphaKey.cs.meta new file mode 100644 index 0000000..1d6bedb --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientAlphaKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0130b1fcfb3a89349b2ca5d06cbbf2bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientColorKey.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientColorKey.cs new file mode 100644 index 0000000..04ffdac --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientColorKey.cs @@ -0,0 +1,25 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_GradientColorKey +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Gradient ColorKey + /// + [Serializable] + [JsonObject("vgo.gradient.colorKey")] + public class VGO_GradientColorKey + { + /// Color of key + [JsonProperty("color")] + public float[] color; + + /// Time of the key (0 - 1). + [JsonProperty("time")] + public float time; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientColorKey.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientColorKey.cs.meta new file mode 100644 index 0000000..337dabb --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_GradientColorKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13526dddc44075f40961c2a67cd6521f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Keyframe.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Keyframe.cs new file mode 100644 index 0000000..9df09e1 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Keyframe.cs @@ -0,0 +1,46 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_Keyframe +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Keyframe + /// + [Serializable] + [JsonObject("vgo.keyframe")] + public class VGO_Keyframe + { + /// The time of the keyframe. + [JsonProperty("time")] + public float time; + + /// The value of the curve at keyframe. + [JsonProperty("value")] + public float value; + + /// Sets the incoming tangent for this key. The incoming tangent affects the slope of the curve from the previous key to this key. + [JsonProperty("inTangent")] + public float inTangent; + + /// Sets the outgoing tangent for this key. The outgoing tangent affects the slope of the curve from this key to the next key. + [JsonProperty("outTangent")] + public float outTangent; + + /// Sets the incoming weight for this key. The incoming weight affects the slope of the curve from the previous key to this key. + [JsonProperty("inWeight")] + public float inWeight; + + /// Sets the outgoing weight for this key. The outgoing weight affects the slope of the curve from this key to the next key. + [JsonProperty("outWeight")] + public float outWeight; + + /// Weighted mode for the keyframe. + [JsonProperty("weightedMode")] + public WeightedMode weightedMode; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Keyframe.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Keyframe.cs.meta new file mode 100644 index 0000000..409b0df --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_Keyframe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5174bf3fe75d9841af20a5baa68ec77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Burst.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Burst.cs new file mode 100644 index 0000000..c486df6 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Burst.cs @@ -0,0 +1,49 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_Burst +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + + /// + /// VGO Particle System Burst + /// + [Serializable] + [JsonObject("vgo.ps.burst")] + public class VGO_PS_Burst + { + /// The time that each burst occurs. + [JsonProperty("time")] + public float time; + + /// Specify the number of particles to emit. + [JsonProperty("count")] + public VGO_PS_MinMaxCurve count; + + ///// The minimum number of particles to emit. + //[JsonProperty("minCount", DefaultValueHandling = DefaultValueHandling.Ignore)] + //[DefaultValue(-1)] + //public short minCount; = -1; + + ///// The maximum number of particles to emit. + //[JsonProperty("maxCount", DefaultValueHandling = DefaultValueHandling.Ignore)] + //[DefaultValue(-1)] + //public short maxCount; = -1; + + /// Specifies how many times the system should play the burst. Set this to 0 to make it play indefinitely. + [JsonProperty("cycleCount")] + public int cycleCount; + + /// How often to repeat the burst, in seconds. + [JsonProperty("repeatInterval")] + public float repeatInterval; + + /// The probability that the system triggers a burst. + [JsonProperty("probability")] + //[Range(0.0f,1.0f)] + public float probability; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Burst.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Burst.cs.meta new file mode 100644 index 0000000..db113dc --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Burst.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91b3f9ff1a8f89c468d59deba647f7cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CollisionModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CollisionModule.cs new file mode 100644 index 0000000..915a8da --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CollisionModule.cs @@ -0,0 +1,18 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_CollisionModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System CollisionModule + /// + [Serializable] + [JsonObject("vgo.ps.collisionModule")] + public class VGO_PS_CollisionModule + { + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CollisionModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CollisionModule.cs.meta new file mode 100644 index 0000000..0332154 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CollisionModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ded1c9dda90f39241a70846f9f8dc799 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorBySpeedModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorBySpeedModule.cs new file mode 100644 index 0000000..7e39274 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorBySpeedModule.cs @@ -0,0 +1,30 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_ColorBySpeedModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System ColorBySpeedModule + /// + [Serializable] + [JsonObject("vgo.ps.colorBySpeedModule")] + public class VGO_PS_ColorBySpeedModule + { + /// Specifies whether the ColorBySpeedModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// The gradient that controls the particle colors. + [JsonProperty("color")] + public VGO_PS_MinMaxGradient color; + + /// Apply the color gradient between these minimum and maximum speeds. + [JsonProperty("range")] + //public Vector2 range; + public float[] range; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorBySpeedModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorBySpeedModule.cs.meta new file mode 100644 index 0000000..c02c5a8 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorBySpeedModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 186c12932aec945438abfaef7a6e67f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorOverLifetimeModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorOverLifetimeModule.cs new file mode 100644 index 0000000..b18a20e --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorOverLifetimeModule.cs @@ -0,0 +1,25 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_ColorOverLifetimeModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System ColorOverLifetimeModule + /// + [Serializable] + [JsonObject("vgo.ps.colorOverLifetimeModule")] + public class VGO_PS_ColorOverLifetimeModule + { + /// Specifies whether the ColorOverLifetimeModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// The gradient that controls the particle colors. + [JsonProperty("color")] + public VGO_PS_MinMaxGradient color; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorOverLifetimeModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorOverLifetimeModule.cs.meta new file mode 100644 index 0000000..b6364c0 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ColorOverLifetimeModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d88ff73113a4d9241a05c5fc8fba3141 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CustomDataModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CustomDataModule.cs new file mode 100644 index 0000000..051a94c --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CustomDataModule.cs @@ -0,0 +1,18 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_CustomDataModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System CustomDataModule + /// + [Serializable] + [JsonObject("vgo.ps.customDataModule")] + public class VGO_PS_CustomDataModule + { + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CustomDataModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CustomDataModule.cs.meta new file mode 100644 index 0000000..a2aeff3 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_CustomDataModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb01e045db5d104418dc041adf986464 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_EmissionModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_EmissionModule.cs new file mode 100644 index 0000000..391d546 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_EmissionModule.cs @@ -0,0 +1,45 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_EmissionModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System EmissionModule + /// + [Serializable] + [JsonObject("vgo.ps.emissionModule")] + public class VGO_PS_EmissionModule + { + /// Specifies whether the EmissionModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// The rate at which the emitter spawns new particles over time. + [JsonProperty("rateOverTime")] + public VGO_PS_MinMaxCurve rateOverTime; + + /// Change the rate over time multiplier. + [JsonProperty("rateOverTimeMultiplier")] + public float rateOverTimeMultiplier; + + /// The rate at which the emitter spawns new particles over distance. + [JsonProperty("rateOverDistance")] + public VGO_PS_MinMaxCurve rateOverDistance; + + /// Change the rate over distance multiplier. + [JsonProperty("rateOverDistanceMultiplier")] + public float rateOverDistanceMultiplier; + + ///// The current number of bursts. + //[JsonProperty("burstCount")] + //public int burstCount; + + /// + [JsonProperty("bursts")] + public VGO_PS_Burst[] bursts; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_EmissionModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_EmissionModule.cs.meta new file mode 100644 index 0000000..ae3b0b5 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_EmissionModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93ebb530e8c37234d944244b290e72c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ExternalForcesModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ExternalForcesModule.cs new file mode 100644 index 0000000..e19d265 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ExternalForcesModule.cs @@ -0,0 +1,43 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_ExternalForcesModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Particle System ExternalForcesModule + /// + [Serializable] + [JsonObject("vgo.ps.externalForcesModule")] + public class VGO_PS_ExternalForcesModule + { + /// Specifies whether the ExternalForcesModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Multiplies the magnitude of applied external forces. + [JsonProperty("multiplierCurve")] + public VGO_PS_MinMaxCurve multiplierCurve; + + /// Multiplies the magnitude of external forces affecting the particles. + [JsonProperty("multiplier")] + public float multiplier; + + /// Apply all Force Fields belonging to a matching Layer to this Particle System. + [JsonProperty("influenceFilter")] + public ParticleSystemGameObjectFilter influenceFilter; + + /// Particle System Force Field Components with a matching Layer affect this Particle System. + [JsonProperty("influenceMask")] + //public LayerMask influenceMask; + public int influenceMask; + + ///// The number of Force Fields explicitly provided to the influencers list. + //[JsonProperty("influenceCount")] + //public int influenceCount { get; } + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ExternalForcesModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ExternalForcesModule.cs.meta new file mode 100644 index 0000000..756fc80 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ExternalForcesModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d55d7b4a2d394644693c0e59fae91e69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ForceOverLifetimeModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ForceOverLifetimeModule.cs new file mode 100644 index 0000000..4e551bf --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ForceOverLifetimeModule.cs @@ -0,0 +1,54 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_ForceOverLifetimeModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Particle System ForceOverLifetimeModule + /// + [Serializable] + [JsonObject("vgo.ps.forceOverLifetimeModule")] + public class VGO_PS_ForceOverLifetimeModule + { + /// Specifies whether the ForceOverLifetimeModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// The curve that defines particle forces in the x-axis. + [JsonProperty("x")] + public VGO_PS_MinMaxCurve x; + + /// The curve defining particle forces in the y-axis. + [JsonProperty("y")] + public VGO_PS_MinMaxCurve y; + + /// The curve defining particle forces in the z-axis. + [JsonProperty("z")] + public VGO_PS_MinMaxCurve z; + + /// Defines the x-axis multiplier. + [JsonProperty("xMultiplier")] + public float xMultiplier; + + /// Defines the y-axis multiplier. + [JsonProperty("yMultiplier")] + public float yMultiplier; + + /// Defines the z-axis multiplier. + [JsonProperty("zMultiplier")] + public float zMultiplier; + + /// Specifies whether the modules applies the forces in local or world space. + [JsonProperty("space")] + public ParticleSystemSimulationSpace space; + + /// When randomly selecting values between two curves or constants, this flag causes the system to choose a new random force on each frame. + [JsonProperty("randomized")] + public bool randomized; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ForceOverLifetimeModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ForceOverLifetimeModule.cs.meta new file mode 100644 index 0000000..f26f1d6 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ForceOverLifetimeModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b518e34214f920418d4f8b293fee4ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_InheritVelocityModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_InheritVelocityModule.cs new file mode 100644 index 0000000..15a08de --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_InheritVelocityModule.cs @@ -0,0 +1,34 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_InheritVelocityModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Particle System InheritVelocityModule + /// + [Serializable] + [JsonObject("vgo.ps.inheritVelocityModule")] + public class VGO_PS_InheritVelocityModule + { + /// Specifies whether the InheritVelocityModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Specifies how to apply emitter velocity to particles. + [JsonProperty("mode")] + public ParticleSystemInheritVelocityMode mode; + + /// Curve to define how much of the emitter velocity the system applies during the lifetime of a particle. + [JsonProperty("curve")] + public VGO_PS_MinMaxCurve curve; + + /// Change the curve multiplier. + [JsonProperty("curveMultiplier")] + public float curveMultiplier; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_InheritVelocityModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_InheritVelocityModule.cs.meta new file mode 100644 index 0000000..9965452 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_InheritVelocityModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3b8abc3dba94b746b741a70bc57e56f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LightsModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LightsModule.cs new file mode 100644 index 0000000..f301799 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LightsModule.cs @@ -0,0 +1,65 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_LightsModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System LightsModule + /// + [Serializable] + [JsonObject("vgo.ps.lightsModule")] + public class VGO_PS_LightsModule + { + /// Specifies whether the LightsModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Choose what proportion of particles receive a dynamic light. + [JsonProperty("ratio")] + public float ratio; + + /// Randomly assign Lights to new particles based on ParticleSystem.LightsModule.ratio. + [JsonProperty("useRandomDistribution")] + public bool useRandomDistribution; + + /// Select what Light Prefab you want to base your particle lights on. + [JsonProperty("light")] + public VGO_Light light; + + /// Toggle whether the particle lights multiply their color by the particle color. + [JsonProperty("useParticleColor")] + public bool useParticleColor; + + /// Toggle whether the system multiplies the particle size by the light range to determine the final light range. + [JsonProperty("sizeAffectsRange")] + public bool sizeAffectsRange; + + /// Toggle whether the system multiplies the particle alpha by the light intensity when it computes the final light intensity. + [JsonProperty("alphaAffectsIntensity")] + public bool alphaAffectsIntensity; + + /// Define a curve to apply custom range scaling to particle Lights. + [JsonProperty("range")] + public VGO_PS_MinMaxCurve range; + + /// Range multiplier. + [JsonProperty("rangeMultiplier")] + public float rangeMultiplier; + + /// Define a curve to apply custom intensity scaling to particle Lights. + [JsonProperty("intensity")] + public VGO_PS_MinMaxCurve intensity; + + /// Intensity multiplier. + [JsonProperty("intensityMultiplier")] + public float intensityMultiplier; + + /// Set a limit on how many Lights this Module can create. + [JsonProperty("maxLights")] + public int maxLights; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LightsModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LightsModule.cs.meta new file mode 100644 index 0000000..baf78b7 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LightsModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 24805da9edc4b594ea82583615e4da8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LimitVelocityOverLifetimeModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LimitVelocityOverLifetimeModule.cs new file mode 100644 index 0000000..7869c2e --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LimitVelocityOverLifetimeModule.cs @@ -0,0 +1,88 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_LimitVelocityOverLifetimeModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + using UnityEngine; + + /// + /// VGO Particle System LimitVelocityOverLifetimeModule + /// + [Serializable] + [JsonObject("vgo.ps.limitVelocityOverLifetimeModule")] + public class VGO_PS_LimitVelocityOverLifetimeModule + { + /// Specifies whether the LimitForceOverLifetimeModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Set the velocity limit on each axis separately. + [JsonProperty("separateAxes")] + public bool separateAxes; + + ///// Maximum velocity curve, when not using one curve per axis. + //[JsonProperty("limit")] + //[NativeName("LimitX")] + //public VGO_PS_MinMaxCurve limit; + + ///// Change the limit multiplier. + //[JsonProperty("limitMultiplier")] + //[NativeName("LimitXMultiplier")] + //public float limitMultiplier; + + /// Maximum velocity curve for the x-axis. + [JsonProperty("limitX")] + public VGO_PS_MinMaxCurve limitX; + + /// Maximum velocity curve for the y-axis. + [JsonProperty("limitY")] + public VGO_PS_MinMaxCurve limitY; + + /// Maximum velocity curve for the z-axis. + [JsonProperty("limitZ")] + public VGO_PS_MinMaxCurve limitZ; + + /// Change the limit multiplier on the x-axis. + [JsonProperty("limitXMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float limitXMultiplier = -1.0f; + + /// Change the limit multiplier on the y-axis. + [JsonProperty("limitYMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float limitYMultiplier = -1.0f; + + /// Change the limit multiplier on the z-axis. + [JsonProperty("limitZMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float limitZMultiplier = -1.0f; + + /// Specifies if the velocity limits are in local space (rotated with the transform) or world space. + [JsonProperty("space")] + public ParticleSystemSimulationSpace space; + + /// Controls how much this module dampens particle velocities that exceed the velocity limit. + [JsonProperty("dampen")] + public float dampen; + + /// Controls the amount of drag that this modules applies to the particle velocities. + [JsonProperty("drag")] + public VGO_PS_MinMaxCurve drag; + + /// Specifies the drag multiplier. + [JsonProperty("dragMultiplier")] + public float dragMultiplier; + + /// Adjust the amount of drag this module applies to particles, based on their sizes. + [JsonProperty("multiplyDragByParticleSize")] + public bool multiplyDragByParticleSize; + + /// Adjust the amount of drag this module applies to particles, based on their speeds. + [JsonProperty("multiplyDragByParticleVelocity")] + public bool multiplyDragByParticleVelocity; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LimitVelocityOverLifetimeModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LimitVelocityOverLifetimeModule.cs.meta new file mode 100644 index 0000000..a2e6b03 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_LimitVelocityOverLifetimeModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6fec8988f9b996c478458f3919e78903 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MainModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MainModule.cs new file mode 100644 index 0000000..edc300e --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MainModule.cs @@ -0,0 +1,200 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_MainModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + using UnityEngine; + + /// + /// VGO Particle System MainModule + /// + [Serializable] + [JsonObject("vgo.ps.mainModule")] + public class VGO_PS_MainModule + { + /// The duration of the Particle System in seconds. + [JsonProperty("duration")] + public float duration; + + /// Specifies whether the Particle System is looping. + [JsonProperty("loop")] + public bool loop; + + /// If ParticleSystem.MainModule._loop is true, when you enable this property, the Particle System looks like it has already simulated for one loop when first becoming visible. + [JsonProperty("prewarm")] + public bool prewarm; + + /// Start delay in seconds. + [JsonProperty("startDelay")] + public VGO_PS_MinMaxCurve startDelay; + + /// A multiplier for ParticleSystem.MainModule._startDelay in seconds. + [JsonProperty("startDelayMultiplier")] + public float startDelayMultiplier; + + /// The total lifetime in seconds that each new particle has. + [JsonProperty("startLifetime")] + public VGO_PS_MinMaxCurve startLifetime; + + /// A multiplier for ParticleSystem.MainModule._startLifetime. + [JsonProperty("startLifetimeMultiplier")] + public float startLifetimeMultiplier; + + /// The initial speed of particles when the Particle System first spawns them. + [JsonProperty("startSpeed")] + public VGO_PS_MinMaxCurve startSpeed; + + /// A multiplier for ParticleSystem.MainModule._startSpeed. + [JsonProperty("startSpeedMultiplier")] + public float startSpeedMultiplier; + + /// A flag to enable specifying particle size individually for each axis. + [JsonProperty("startSize3D")] + public bool startSize3D; + + /// The initial size of particles when the Particle System first spawns them. + [JsonProperty("startSize")] + public VGO_PS_MinMaxCurve startSize; + + /// The initial size of particles along the x-axis when the Particle System first spawns them. + [JsonProperty("startSizeX")] + public VGO_PS_MinMaxCurve startSizeX; + + /// The initial size of particles along the y-axis when the Particle System first spawns them. + [JsonProperty("startSizeY")] + public VGO_PS_MinMaxCurve startSizeY; + + /// The initial size of particles along the z-axis when the Particle System first spawns them. + [JsonProperty("startSizeZ")] + public VGO_PS_MinMaxCurve startSizeZ; + + /// A multiplier for the initial size of particles when the Particle System first spawns them. + [JsonProperty("startSizeMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float startSizeMultiplier = -1.0f; + + /// A multiplier for ParticleSystem.MainModule._startSizeX. + [JsonProperty("startSizeXMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float startSizeXMultiplier = -1.0f; + + /// A multiplier for ParticleSystem.MainModule._startSizeY. + [JsonProperty("startSizeYMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float startSizeYMultiplier = -1.0f; + + /// A multiplier for ParticleSystem.MainModule._startSizeZ. + [JsonProperty("startSizeZMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float startSizeZMultiplier = -1.0f; + + /// A flag to enable 3D particle rotation. + [JsonProperty("startRotation3D")] + public bool startRotation3D; + + /// The initial rotation of particles when the Particle System first spawns them. + [JsonProperty("startRotation")] + public VGO_PS_MinMaxCurve startRotation; + + /// The initial rotation of particles around the x-axis when emitted. + [JsonProperty("startRotationX")] + public VGO_PS_MinMaxCurve startRotationX; + + /// The initial rotation of particles around the y-axis when the Particle System first spawns them. + [JsonProperty("startRotationY")] + public VGO_PS_MinMaxCurve startRotationY; + + /// The initial rotation of particles around the z-axis when the Particle System first spawns them. + [JsonProperty("startRotationZ")] + public VGO_PS_MinMaxCurve startRotationZ; + + /// A multiplier for ParticleSystem.MainModule._startRotation. + [JsonProperty("startRotationMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float StartRotationMultiplier = -1.0f; + + /// The initial rotation multiplier of particles around the x-axis when the Particle System first spawns them. + [JsonProperty("startRotationXMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float StartRotationXMultiplier = -1.0f; + + /// The initial rotation multiplier of particles around the y-axis when the Particle System first spawns them.. + [JsonProperty("startRotationYMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float StartRotationYMultiplier = -1.0f; + + /// The initial rotation multiplier of particles around the z-axis when the Particle System first spawns them. + [JsonProperty("startRotationZMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float StartRotationZMultiplier = -1.0f; + + /// Makes some particles spin in the opposite direction. + [JsonProperty("flipRotation")] + public float flipRotation; + + /// The initial color of particles when the Particle System first spawns them. + [JsonProperty("startColor")] + public VGO_PS_MinMaxGradient startColor; + + /// A scale that this Particle System applies to gravity, defined by Physics.gravity. + [JsonProperty("gravityModifier")] + public VGO_PS_MinMaxCurve gravityModifier; + + /// Change the gravity multiplier. + [JsonProperty("gravityModifierMultiplier")] + public float gravityModifierMultiplier; + + /// This selects the space in which to simulate particles. It can be either world or local space. + [JsonProperty("simulationSpace")] + public ParticleSystemSimulationSpace simulationSpace; + + /// Override the default playback speed of the Particle System. + [JsonProperty("simulationSpeed")] + public float simulationSpeed; + + /// Simulate particles relative to a custom transform component. + [JsonProperty("customSimulationSpace")] + public VGO_Transform customSimulationSpace; + + /// When true, use the unscaled delta time to simulate the Particle System. Otherwise, use the scaled delta time. + [JsonProperty("useUnscaledTime")] + public bool useUnscaledTime; + + /// Control how the Particle System applies its Transform component to the particles it emits. + [JsonProperty("scalingMode")] + public ParticleSystemScalingMode scalingMode; + + /// If set to true, the Particle System automatically begins to play on startup. + [JsonProperty("playOnAwake")] + public bool playOnAwake; + + /// Control how the Particle System calculates its velocity, when moving in the world. + [JsonProperty("emitterVelocityMode")] + public ParticleSystemEmitterVelocityMode emitterVelocityMode; + + /// The maximum number of particles to emit. + [JsonProperty("maxParticles")] + public int maxParticles; + + /// Select whether to Disable or Destroy the GameObject, or to call the OnParticleSystemStopped script Callback, when the Particle System stops and all particles have died. + [JsonProperty("stopAction")] + public ParticleSystemStopAction stopAction; + + /// Configure whether the Particle System will still be simulated each frame, when it is offscreen. + [JsonProperty("cullingMode")] + public ParticleSystemCullingMode cullingMode; + + /// Configure the Particle System to not kill its particles when their lifetimes are exceeded. + [JsonProperty("ringBufferMode")] + public ParticleSystemRingBufferMode ringBufferMode; + + /// When ParticleSystem.MainModule.ringBufferMode is set to loop, this value defines the proportion of the particle life that loops. + [JsonProperty("ringBufferLoopRange")] + //public Vector2 ringBufferLoopRange; + public float[] ringBufferLoopRange; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MainModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MainModule.cs.meta new file mode 100644 index 0000000..8e0ac53 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MainModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 83334f2f4c404374fa7151dcbc335dde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxCurve.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxCurve.cs new file mode 100644 index 0000000..70e8e51 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxCurve.cs @@ -0,0 +1,55 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_MinMaxCurve +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + using UnityEngine; + + /// + /// VGO Particle System MinMaxCurve + /// + [Serializable] + [JsonObject("vgo.ps.minMaxCurve")] + public class VGO_PS_MinMaxCurve + { + /// Set the mode that the min-max curve uses to evaluate values. + [JsonProperty("mode")] + public ParticleSystemCurveMode mode; + + /// Set the constant value. + [JsonProperty("constant", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float constant = -1.0f; + + /// Set a constant for the lower bound. + [JsonProperty("constantMin", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float constantMin = -1.0f; + + /// Set a constant for the upper bound. + [JsonProperty("constantMax", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float constantMax = -1.0f; + + /// Set a multiplier to apply to the curves. + [JsonProperty("curveMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float curveMultiplier = -1.0f; + + /// Set the curve. + [JsonProperty("curve")] + public VGO_AnimationCurve curve; + + /// Set a curve for the lower bound. + [JsonProperty("curveMin")] + public VGO_AnimationCurve curveMin; + + /// Set a curve for the upper bound. + [JsonProperty("curveMax")] + public VGO_AnimationCurve curveMax; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxCurve.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxCurve.cs.meta new file mode 100644 index 0000000..dc2bcde --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxCurve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b164d3e8290f694b98f490d9a905591 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxGradient.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxGradient.cs new file mode 100644 index 0000000..960c1f0 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxGradient.cs @@ -0,0 +1,49 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_MinMaxGradient +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Particle System MinMaxGradient + /// + [Serializable] + [JsonObject("vgo.ps.minMaxGradient")] + public class VGO_PS_MinMaxGradient + { + /// Set the mode that the Min-Max Gradient uses to evaluate colors. + [JsonProperty("mode")] + public ParticleSystemGradientMode mode; + + /// Set a constant color. + [JsonProperty("color")] + //public Color color; + public float[] color; + + /// Set a constant color for the lower bound. + [JsonProperty("colorMin")] + //public Color colorMin; + public float[] colorMin; + + /// Set a constant color for the upper bound. + [JsonProperty("colorMax")] + //public Color colorMax; + public float[] colorMax; + + /// Set the gradient. + [JsonProperty("gradient")] + public VGO_Gradient gradient; + + /// Set a gradient for the lower bound. + [JsonProperty("gradientMin")] + public VGO_Gradient gradientMin; + + /// Set a gradient for the upper bound. + [JsonProperty("gradientMax")] + public VGO_Gradient gradientMax; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxGradient.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxGradient.cs.meta new file mode 100644 index 0000000..fe5783f --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_MinMaxGradient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf35a1cc42b41bf4eb658eff1ea73087 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_NoiseModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_NoiseModule.cs new file mode 100644 index 0000000..dd2987d --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_NoiseModule.cs @@ -0,0 +1,149 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_NoiseModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + using UnityEngine; + + /// + /// VGO Particle System NoiseModule + /// + [Serializable] + [JsonObject("vgo.ps.noiseModule")] + public class VGO_PS_NoiseModule + { + /// Specifies whether the the NoiseModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Control the noise separately for each axis. + [JsonProperty("separateAxes")] + public bool separateAxes; + + ///// How strong the overall noise effect is. + //[JsonProperty("strength")] + //[NativeName("StrengthX")] + //public VGO_PS_MinMaxCurve strength; + + ///// Strength multiplier. + //[JsonProperty("strengthMultiplier")] + //[NativeName("StrengthXMultiplier")] + //public float strengthMultiplier; + + /// Define the strength of the effect on the x-axis, when using the ParticleSystem.NoiseModule.separateAxes option. + [JsonProperty("strengthX")] + public VGO_PS_MinMaxCurve strengthX; + + /// Define the strength of the effect on the y-axis, when using the ParticleSystem.NoiseModule.separateAxes option. + [JsonProperty("strengthY")] + public VGO_PS_MinMaxCurve strengthY; + + /// Define the strength of the effect on the z-axis, when using the ParticleSystem.NoiseModule.separateAxes option. + [JsonProperty("strengthZ")] + public VGO_PS_MinMaxCurve strengthZ; + + /// x-axis strength multiplier. + [JsonProperty("strengthXMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float strengthXMultiplier = -1.0f; + + /// y-axis strength multiplier. + [JsonProperty("strengthYMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float strengthYMultiplier = -1.0f; + + /// z-axis strength multiplier. + [JsonProperty("strengthZMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float strengthZMultiplier = -1.0f; + + /// Low values create soft, smooth noise, and high values create rapidly changing noise. + [JsonProperty("frequency")] + public float frequency; + + /// Scroll the noise map over the Particle System. + [JsonProperty("scrollSpeed")] + public VGO_PS_MinMaxCurve scrollSpeed; + + /// Scroll speed multiplier. + [JsonProperty("scrollSpeedMultiplier")] + public float scrollSpeedMultiplier; + + /// Higher frequency noise reduces the strength by a proportional amount, if enabled. + [JsonProperty("damping")] + public bool damping; + + /// Layers of noise that combine to produce final noise. + [JsonProperty("octaveCount")] + public int octaveCount; + + /// When combining each octave, scale the intensity by this amount. + [JsonProperty("octaveMultiplier")] + public float octaveMultiplier; + + /// When combining each octave, zoom in by this amount. + [JsonProperty("octaveScale")] + public float octaveScale; + + /// Generate 1D, 2D or 3D noise. + [JsonProperty("quality")] + public ParticleSystemNoiseQuality quality; + + /// Enable remapping of the final noise values, allowing for noise values to be translated into different values. + [JsonProperty("remapEnabled")] + public bool remapEnabled; + + ///// Define how the noise values are remapped. + //[JsonProperty("remap")] + //[NativeName("RemapX")] + //public VGO_PS_MinMaxCurve remap; + + ///// Remap multiplier. + //[JsonProperty("remapMultiplier")] + //[NativeName("RemapXMultiplier")] + //public float remapMultiplier; + + /// Define how the noise values are remapped on the x-axis, when using the ParticleSystem.NoiseModule.separateAxes option. + [JsonProperty("remapX")] + public VGO_PS_MinMaxCurve remapX; + + /// Define how the noise values are remapped on the y-axis, when using the ParticleSystem.NoiseModule.separateAxes option. + [JsonProperty("remapY")] + public VGO_PS_MinMaxCurve remapY; + + /// Define how the noise values are remapped on the z-axis, when using the ParticleSystem.NoiseModule.separateAxes option. + [JsonProperty("remapZ")] + public VGO_PS_MinMaxCurve remapZ; + + /// x-axis remap multiplier. + [JsonProperty("remapXMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float remapXMultiplier = -1.0f; + + /// y-axis remap multiplier. + [JsonProperty("remapYMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float remapYMultiplier = -1.0f; + + /// z-axis remap multiplier. + [JsonProperty("remapZMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float remapZMultiplier = -1.0f; + + /// How much the noise affects the particle positions. + [JsonProperty("positionAmount")] + public VGO_PS_MinMaxCurve positionAmount; + + /// How much the noise affects the particle rotation, in degrees per second. + [JsonProperty("rotationAmount")] + public VGO_PS_MinMaxCurve rotationAmount; + + /// How much the noise affects the particle sizes, applied as a multiplier on the size of each particle. + [JsonProperty("sizeAmount")] + public VGO_PS_MinMaxCurve sizeAmount; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_NoiseModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_NoiseModule.cs.meta new file mode 100644 index 0000000..5f6ecc9 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_NoiseModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb3e309421a02164385549940f5af602 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Renderer.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Renderer.cs new file mode 100644 index 0000000..bbb4f35 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Renderer.cs @@ -0,0 +1,159 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_Renderer +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + using UnityEngine.Rendering; + + /// + /// VGO Particle System Renderer + /// + [Serializable] + [JsonObject("vgo.ps.renderer")] + public class VGO_PS_Renderer + { + /// Makes the rendered 3D object visible if enabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Specifies how the system draws particles. + [JsonProperty("renderMode")] + public ParticleSystemRenderMode renderMode; + + /// How much do the particles stretch depending on the Camera's speed. + [JsonProperty("cameraVelocityScale")] + public float cameraVelocityScale; + + /// Specifies how much particles stretch depending on their velocity. + [JsonProperty("velocityScale")] + public float velocityScale; + + /// How much are the particles stretched in their direction of motion. + [JsonProperty("lengthScale")] + public float lengthScale; + + /// Specifies how much a billboard particle orients its normals towards the Camera. + [JsonProperty("normalDirection")] + public float normalDirection; + + ///// The Mesh that the particle uses instead of a billboarded Texture. + //[JsonProperty("mesh")] + //public Mesh mesh; + + ///// The number of Meshes the system uses for particle rendering. + //[JsonProperty("meshCount")] + //public int meshCount { get; } + + ///// Returns the first instantiated Material assigned to the renderer. + //public Material material; + + /// The shared material of this object. + [JsonProperty("sharedMaterialIndex")] + //public Material sharedMaterial; + public int sharedMaterial; + + /// Set the Material that the TrailModule uses to attach trails to particles. + [JsonProperty("trailMaterialIndex")] + //public Material trailMaterial; + public int trailMaterialIndex; + + /// Specifies how to sort particles within a system. + [JsonProperty("sortMode")] + public ParticleSystemSortMode sortMode; + + /// Biases Particle System sorting amongst other transparencies. + [JsonProperty("sortingFudge")] + public float sortingFudge; + + /// Clamp the minimum particle size. + [JsonProperty("minParticleSize")] + public float minParticleSize; + + /// Clamp the maximum particle size. + [JsonProperty("maxParticleSize")] + public float maxParticleSize; + + /// Control the direction that particles face. + [JsonProperty("alignment")] + //[NativeName("RenderAlignment")] + public ParticleSystemRenderSpace alignment; + + /// Flip a percentage of the particles, along each axis. + [JsonProperty("flip")] + //public Vector3 flip; + public float[] flip; + + /// Allow billboard particles to roll around their z-axis. + [JsonProperty("allowRoll")] + public bool allowRoll; + + /// Modify the pivot point used for rotating particles. + [JsonProperty("pivot")] + //public Vector3 pivot; + public float[] pivot; + + /// Specifies how the Particle System Renderer interacts with SpriteMask. + [JsonProperty("maskInteraction")] + public SpriteMaskInteraction maskInteraction; + + /// Enables GPU Instancing on platforms that support it. + [JsonProperty("enableGPUInstancing")] + public bool enableGPUInstancing; + + /// Does this object cast shadows? + [JsonProperty("shadowCastingMode")] + public ShadowCastingMode shadowCastingMode; + + /// Does this object receive shadows? + [JsonProperty("receiveShadows")] + public bool receiveShadows; + + /// Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the particle size. + [JsonProperty("shadowBias")] + public float shadowBias; + + /// Specifies the mode for motion vector rendering. + [JsonProperty("motionVectorGenerationMode")] + public MotionVectorGenerationMode motionVectorGenerationMode; + + /// Allows turning off rendering for a specific component. + [JsonProperty("forceRenderingOff")] + public bool forceRenderingOff; + + /// This value sorts renderers by priority. Lower values are rendered first and higher values are rendered last. + [JsonProperty("rendererPriority")] + public int rendererPriority; + + /// Determines which rendering layer this renderer lives on. + [JsonProperty("renderingLayerMask")] + public uint renderingLayerMask; + + /// Unique ID of the Renderer's sorting layer. + [JsonProperty("sortingLayerID")] + public int sortingLayerID; + + /// Renderer's order within a sorting layer. + [JsonProperty("sortingOrder")] + public int sortingOrder; + + /// The light probe interpolation type. + [JsonProperty("lightProbeUsage")] + public LightProbeUsage lightProbeUsage; + + /// Should reflection probes be used for this Renderer? + [JsonProperty("reflectionProbeUsage")] + public ReflectionProbeUsage reflectionProbeUsage; + + /// If set, Renderer will use this Transform's position to find the light or reflection probe. + [JsonProperty("probeAnchor")] + public VGO_Transform probeAnchor; + + ///// The number of currently active custom vertex streams. + //[JsonProperty("activeVertexStreamsCount")] + //public int activeVertexStreamsCount { get; } + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Renderer.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Renderer.cs.meta new file mode 100644 index 0000000..5e3dccc --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_Renderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7aacb2691d440a649a8b25f1efc9ac2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationBySpeedModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationBySpeedModule.cs new file mode 100644 index 0000000..ee5d805 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationBySpeedModule.cs @@ -0,0 +1,58 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_RotationBySpeedModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + + /// + /// VGO Particle System RotationBySpeedModule + /// + [Serializable] + [JsonObject("vgo.ps.rotationBySpeedModule")] + public class VGO_PS_RotationBySpeedModule + { + /// Specifies whether the RotationBySpeedModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Set the rotation by speed on each axis separately. + [JsonProperty("separateAxes")] + public bool separateAxes; + + /// Rotation by speed curve for the x-axis. + [JsonProperty("x")] + public VGO_PS_MinMaxCurve x; + + /// Rotation by speed curve for the y-axis. + [JsonProperty("y")] + public VGO_PS_MinMaxCurve y; + + /// Rotation by speed curve for the z-axis. + [JsonProperty("z")] + public VGO_PS_MinMaxCurve z; + + /// Rotation multiplier along the x-axis. + [JsonProperty("xMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float xMultiplier = -1.0f; + + /// Rotation multiplier along the y-axis. + [JsonProperty("yMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float yMultiplier = -1.0f; + + /// Rotation multiplier along the z-axis. + [JsonProperty("zMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float zMultiplier = -1.0f; + + /// Set the minimum and maximum speed that this modules applies the rotation curve between. + [JsonProperty("range")] + //public Vector2 range; + public float[] range; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationBySpeedModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationBySpeedModule.cs.meta new file mode 100644 index 0000000..0603feb --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationBySpeedModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a02015b804189c54ea8421333c45f6c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationOverLifetimeModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationOverLifetimeModule.cs new file mode 100644 index 0000000..7a0133f --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationOverLifetimeModule.cs @@ -0,0 +1,53 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_RotationOverLifetimeModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + + /// + /// VGO Particle System RotationOverLifetimeModule + /// + [Serializable] + [JsonObject("vgo.ps.rotationOverLifetimeModule")] + public class VGO_PS_RotationOverLifetimeModule + { + /// Specifies whether the RotationOverLifetimeModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Set the rotation over lifetime on each axis separately. + [JsonProperty("separateAxes")] + public bool separateAxes; + + /// Rotation over lifetime curve for the x-axis. + [JsonProperty("x")] + public VGO_PS_MinMaxCurve x; + + /// Rotation over lifetime curve for the y-axis. + [JsonProperty("y")] + public VGO_PS_MinMaxCurve y; + + /// Rotation over lifetime curve for the z-axis. + [JsonProperty("z")] + public VGO_PS_MinMaxCurve z; + + /// Rotation multiplier along the x-axis. + [JsonProperty("xMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float xMultiplier = -1.0f; + + /// Rotation multiplier along the y-axis. + [JsonProperty("yMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float yMultiplier = -1.0f; + + /// Rotation multiplier along the z-axis. + [JsonProperty("zMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float zMultiplier = -1.0f; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationOverLifetimeModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationOverLifetimeModule.cs.meta new file mode 100644 index 0000000..65405b5 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_RotationOverLifetimeModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 110ec8c7ec4736448ba7ab78cfc115e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ShapeModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ShapeModule.cs new file mode 100644 index 0000000..8661557 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ShapeModule.cs @@ -0,0 +1,205 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_ShapeModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + using UnityEngine; + + /// + /// VGO Particle System ShapeModule + /// + [Serializable] + [JsonObject("vgo.ps.shapeModule")] + public class VGO_PS_ShapeModule + { + /// Specifies whether the ShapeModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// The type of shape to emit particles from. + [JsonProperty("shapeType")] + public ParticleSystemShapeType shapeType; + + /// Angle of the cone to emit particles from. + [JsonProperty("angle")] + public float angle; + + /// Radius of the shape to emit particles from. + [JsonProperty("radius")] + public float radius; + + /// The thickness of the Donut shape to emit particles from. + [JsonProperty("donutRadius")] + public float donutRadius; + + /// The mode to use to generate particles along the radius. + [JsonProperty("radiusMode")] + public ParticleSystemShapeMultiModeValue radiusMode; + + /// Control the gap between particle emission points along the radius. + [JsonProperty("radiusSpread")] + public float radiusSpread; + + /// In animated modes, this determines how quickly the particle emission position moves along the radius. + [JsonProperty("radiusSpeed")] + public VGO_PS_MinMaxCurve radiusSpeed; + + /// A multiplier of the radius speed of the particle emission shape. + [JsonProperty("radiusSpeedMultiplier")] + public float radiusSpeedMultiplier; + + /// Radius thickness of the shape's edge from which to emit particles. + [JsonProperty("radiusThickness")] + public float radiusThickness; + + /// Thickness of the box to emit particles from. + [JsonProperty("boxThickness")] + //public Vector3 boxThickness; + public float[] boxThickness; + + /// Angle of the circle arc to emit particles from. + [JsonProperty("arc")] + public float arc; + + /// The mode that Unity uses to generate particles around the arc. + [JsonProperty("arcMode")] + public ParticleSystemShapeMultiModeValue arcMode; + + /// Control the gap between particle emission points around the arc. + [JsonProperty("arcSpread")] + public float arcSpread; + + /// In animated modes, this determines how quickly the particle emission position moves around the arc. + [JsonProperty("arcSpeed")] + public VGO_PS_MinMaxCurve arcSpeed; + + /// A multiplier of the arc speed of the particle emission shape. + [JsonProperty("arcSpeedMultiplier")] + public float arcSpeedMultiplier; + + /// Length of the cone to emit particles from. + [JsonProperty("length")] + public float length; + + /// Where on the Mesh to emit particles from. + [JsonProperty("meshShapeType")] + public ParticleSystemMeshShapeType meshShapeType; + + /// The mode to use to generate particles on a Mesh. + [JsonProperty("meshSpawnMode")] + public ParticleSystemShapeMultiModeValue meshSpawnMode; + + /// Control the gap between particle emission points across the Mesh. + [JsonProperty("meshSpawnSpread")] + public float meshSpawnSpread; + + /// In animated modes, this determines how quickly the particle emission position moves across the Mesh. + [JsonProperty("meshSpawnSpeed")] + public VGO_PS_MinMaxCurve meshSpawnSpeed; + + /// A multiplier of the Mesh spawn speed. + [JsonProperty("meshSpawnSpeedMultiplier")] + public float meshSpawnSpeedMultiplier; + + ///// Mesh to emit particles from. + //[JsonProperty("mesh")] + //public Mesh mesh; + + ///// MeshRenderer to emit particles from. + //[JsonProperty("meshRenderer")] + //public MeshRenderer meshRenderer; + + ///// SkinnedMeshRenderer to emit particles from. + //[JsonProperty("skinnedMeshRenderer")] + //public SkinnedMeshRenderer skinnedMeshRenderer; + + /// Emit particles from a single Material, or the whole Mesh. + [JsonProperty("useMeshMaterialIndex")] + public bool useMeshMaterialIndex; + + /// Emit particles from a single Material of a Mesh. + [JsonProperty("meshMaterialIndex")] + public int meshMaterialIndex; + + /// Modulate the particle colors with the vertex colors, or the Material color if no vertex colors exist. + [JsonProperty("useMeshColors")] + public bool useMeshColors; + + ///// Sprite to emit particles from. + //[JsonProperty("sprite")] + //public Sprite sprite; + + ///// SpriteRenderer to emit particles from. + //[JsonProperty("spriteRenderer")] + //public SpriteRenderer spriteRenderer; + + /// Move particles away from the surface of the source Mesh. + [JsonProperty("normalOffset")] + public float normalOffset; + + /// Specifies a Texture to tint the particle's start colors. + [JsonProperty("textureIndex", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1)] + //public Texture2D texture; + public int textureIndex = -1; + + /// Selects which channel of the Texture to use for discarding particles. + [JsonProperty("textureClipChannel")] + public ParticleSystemShapeTextureChannel textureClipChannel; + + /// Discards particles when they spawn on an area of the Texture with a value lower than this threshold. + [JsonProperty("textureClipThreshold")] + public float textureClipThreshold; + + /// When enabled, the system applies the RGB channels of the Texture to the particle color when the particle spawns. + [JsonProperty("textureColorAffectsParticles")] + public bool textureColorAffectsParticles; + + /// When enabled, the system applies the alpha channel of the Texture to the particle alpha when the particle spawns. + [JsonProperty("textureAlphaAffectsParticles")] + public bool textureAlphaAffectsParticles; + + /// When enabled, the system takes four neighboring samples from the Texture then combines them to give the final particle value. + [JsonProperty("textureBilinearFiltering")] + public bool textureBilinearFiltering; + + /// When using a Mesh as a source shape type, this option controls which UV channel on the Mesh to use for reading the source Texture. + [JsonProperty("textureUVChannel")] + public int textureUVChannel; + + /// Apply an offset to the position from which the system emits particles. + [JsonProperty("position")] + //public Vector3 position; + public float[] position; + + /// Apply a rotation to the shape from which the system emits particles. + [JsonProperty("rotation")] + //public Vector3 rotation; + public float[] rotation; + + /// Apply scale to the shape from which the system emits particles. + [JsonProperty("scale")] + //public Vector3 scale; + public float[] scale; + + /// Align particles based on their initial direction of travel. + [JsonProperty("alignToDirection")] + public bool alignToDirection; + + /// Randomizes the starting direction of particles. + [JsonProperty("randomDirectionAmount")] + public float randomDirectionAmount; + + /// Makes particles move in a spherical direction from their starting point. + [JsonProperty("sphericalDirectionAmount")] + public float sphericalDirectionAmount; + + /// Randomizes the starting position of particles. + [JsonProperty("randomPositionAmount")] + public float randomPositionAmount; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ShapeModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ShapeModule.cs.meta new file mode 100644 index 0000000..29957c8 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_ShapeModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 76bf58e106041e446b54fd9683206f90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeBySpeedModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeBySpeedModule.cs new file mode 100644 index 0000000..dd2f4b6 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeBySpeedModule.cs @@ -0,0 +1,68 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_SizeBySpeedModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + + /// + /// VGO Particle System SizeBySpeedModule + /// + [Serializable] + [JsonObject("vgo.ps.sizeBySpeedModule")] + public class VGO_PS_SizeBySpeedModule + { + /// Specifies whether the SizeBySpeedModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Set the size by speed on each axis separately. + [JsonProperty("separateAxes")] + public bool separateAxes; + + ///// Curve to control particle size based on speed. + //[JsonProperty("size")] + //[NativeName("X")] + //public VGO_PS_MinMaxCurve size; + + ///// A multiplier for ParticleSystem.SizeBySpeedModule._size. + //[JsonProperty("sizeMultiplier")] + //[NativeName("XMultiplier")] + //public float sizeMultiplier; + + /// Size by speed curve for the x-axis. + [JsonProperty("x")] + public VGO_PS_MinMaxCurve x; + + /// Size by speed curve for the y-axis. + [JsonProperty("y")] + public VGO_PS_MinMaxCurve y; + + /// Size by speed curve for the z-axis. + [JsonProperty("z")] + public VGO_PS_MinMaxCurve z; + + /// Size multiplier along the x-axis. + [JsonProperty("xMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float xMultiplier = -1.0f; + + /// Size multiplier along the y-axis. + [JsonProperty("yMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float yMultiplier = -1.0f; + + /// Size multiplier along the z-axis. + [JsonProperty("zMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float zMultiplier = -1.0f; + + /// Set the minimum and maximum speed that this modules applies the size curve between. + [JsonProperty("range")] + //public Vector2 Range; + public float[] range; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeBySpeedModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeBySpeedModule.cs.meta new file mode 100644 index 0000000..b09a20c --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeBySpeedModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a621dcc56d2d1541827c69ce1464c0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeOverLifetimeModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeOverLifetimeModule.cs new file mode 100644 index 0000000..12c5c1a --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeOverLifetimeModule.cs @@ -0,0 +1,63 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_SizeOverLifetimeModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using System.ComponentModel; + + /// + /// VGO Particle System SizeOverLifetimeModule + /// + [Serializable] + [JsonObject("vgo.ps.sizeOverLifetimeModule")] + public class VGO_PS_SizeOverLifetimeModule + { + /// Specifies whether the SizeOverLifetimeModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Set the size over lifetime on each axis separately. + [JsonProperty("separateAxes")] + public bool separateAxes; + + ///// Curve to control particle size based on lifetime. + //[JsonProperty("size")] + //[NativeName("X")] + //public VGO_PS_MinMaxCurve size; + + ///// A multiplier for ParticleSystem.SizeOverLifetimeModule._size. + //[JsonProperty("sizeMultiplier")] + //[NativeName("XMultiplier")] + //public float sizeMultiplier; + + /// Size over lifetime curve for the x-axis. + [JsonProperty("x")] + public VGO_PS_MinMaxCurve x; + + /// Size over lifetime curve for the y-axis. + [JsonProperty("y")] + public VGO_PS_MinMaxCurve y; + + /// Size over lifetime curve for the z-axis. + [JsonProperty("z")] + public VGO_PS_MinMaxCurve z; + + /// Size multiplier along the x-axis. + [JsonProperty("xMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float xMultiplier = -1.0f; + + /// Size multiplier along the y-axis. + [JsonProperty("yMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float yMultiplier = -1.0f; + + /// Size multiplier along the z-axis. + [JsonProperty("zMultiplier", DefaultValueHandling = DefaultValueHandling.Ignore)] + [DefaultValue(-1.0f)] + public float zMultiplier = -1.0f; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeOverLifetimeModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeOverLifetimeModule.cs.meta new file mode 100644 index 0000000..11db1ca --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SizeOverLifetimeModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17ea5b9fabe813e4aa69a9c1bf349f3e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SubEmittersModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SubEmittersModule.cs new file mode 100644 index 0000000..0975bcb --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SubEmittersModule.cs @@ -0,0 +1,18 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_SubEmittersModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System SubEmittersModule + /// + [Serializable] + [JsonObject("vgo.ps.subEmittersModule")] + public class VGO_PS_SubEmittersModule + { + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SubEmittersModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SubEmittersModule.cs.meta new file mode 100644 index 0000000..c28fd5e --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_SubEmittersModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1372f06ad90576a4d983e949dd928129 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TextureSheetAnimationModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TextureSheetAnimationModule.cs new file mode 100644 index 0000000..e2c10ff --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TextureSheetAnimationModule.cs @@ -0,0 +1,98 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_TextureSheetAnimationModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + using UnityEngine.Rendering; + + /// + /// VGO Particle System TextureSheetAnimationModule + /// + [Serializable] + [JsonObject("vgo.ps.textureSheetAnimationModule")] + public class VGO_PS_TextureSheetAnimationModule + { + /// Specifies whether the TextureSheetAnimationModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Select whether the animated Texture information comes from a grid of frames on a single Texture, or from a list of Sprite objects. + [JsonProperty("mode")] + public ParticleSystemAnimationMode mode; + + /// Defines the tiling of the Texture in the x-axis. + [JsonProperty("numTilesX")] + public int numTilesX; + + /// Defines the tiling of the texture in the y-axis. + [JsonProperty("numTilesY")] + public int numTilesY; + + ///// + //[JsonProperty("sprites")] + //public VGO_Sprite[] sprites; + + ///// The total number of sprites. + //[JsonProperty("spriteCount")] + //public int spriteCount { get; } + + /// Specifies the animation type. + [JsonProperty("animation")] + public ParticleSystemAnimationType animation; + + /// Select how particles choose which row of a Texture Sheet Animation to use. + [JsonProperty("rowMode")] + public ParticleSystemAnimationRowMode rowMode; + + /// + /// Select whether the system bases the playback on mapping a curve to the lifetime of each particle, + /// by using the particle speeds, or if playback simply uses a constant frames per second. + /// + [JsonProperty("timeMode")] + public ParticleSystemAnimationTimeMode timeMode; + + /// + /// Explicitly select which row of the Texture sheet to use. + /// The system uses this property when ParticleSystem.TextureSheetAnimationModule.rowMode is set to Custom. + /// + [JsonProperty("rowIndex")] + public int rowIndex; + + /// A curve to control which frame of the Texture sheet animation to play. + [JsonProperty("frameOverTime")] + public VGO_PS_MinMaxCurve frameOverTime; + + /// The frame over time mutiplier. + [JsonProperty("frameOverTimeMultiplier")] + public float frameOverTimeMultiplier; + + /// Define a random starting frame for the Texture sheet animation. + [JsonProperty("startFrame")] + public VGO_PS_MinMaxCurve startFrame; + + /// The starting frame multiplier. + [JsonProperty("startFrameMultiplier")] + public float startFrameMultiplier; + + /// Specify how particle speeds are mapped to the animation frames. + [JsonProperty("speedRange")] + //public Vector2 speedRange; + public float[] speedRange; + + /// Control how quickly the animation plays. + [JsonProperty("fps")] + public float fps; + + /// Specifies how many times the animation loops during the lifetime of the particle. + [JsonProperty("cycleCount")] + public int cycleCount; + + /// Choose which UV channels receive Texture animation. + [JsonProperty("uvChannelMask")] + public UVChannelFlags uvChannelMask; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TextureSheetAnimationModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TextureSheetAnimationModule.cs.meta new file mode 100644 index 0000000..f8c0413 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TextureSheetAnimationModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c68d3286633538458ef9c7cf8c2eb0d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TrailModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TrailModule.cs new file mode 100644 index 0000000..1b20451 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TrailModule.cs @@ -0,0 +1,102 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_TrailModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Particle System TrailModule + /// + [Serializable] + [JsonObject("vgo.ps.trailModule")] + public class VGO_PS_TrailModule + { + /// Specifies whether the TrailModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Choose how the system generates the particle trails. + [JsonProperty("mode")] + public ParticleSystemTrailMode mode; + + /// Choose what proportion of particles receive a trail. + [JsonProperty("ratio")] + public float ratio; + + /// The curve describing the trail lifetime, throughout the lifetime of the particle. + [JsonProperty("lifetime")] + public VGO_PS_MinMaxCurve lifetime; + + /// A multiplier for ParticleSystem.TrailModule._lifetime. + [JsonProperty("lifetimeMultiplier")] + public float lifetimeMultiplier; + + /// Set the minimum distance each trail can travel before the system adds a new vertex to it. + [JsonProperty("minVertexDistance")] + public float minVertexDistance; + + /// Drop new trail points in world space, regardless of Particle System Simulation Space. + [JsonProperty("worldSpace")] + public bool worldSpace; + + /// Specifies whether trails disappear immediately when their owning particle dies. + [JsonProperty("dieWithParticles")] + public bool dieWithParticles; + + /// Select how many lines to create through the Particle System. + [JsonProperty("ribbonCount")] + public int ribbonCount; + + /// Specifies whether, if you use this system as a sub-emitter, ribbons connect particles from each parent particle independently. + [JsonProperty("splitSubEmitterRibbons")] + public bool splitSubEmitterRibbons; + + /// Adds an extra position to each ribbon, connecting it to the location of the Transform Component. + [JsonProperty("attachRibbonsToTransform")] + public bool attachRibbonsToTransform; + + /// Choose whether the U coordinate of the trail Texture is tiled or stretched. + [JsonProperty("textureMode")] + public ParticleSystemTrailTextureMode textureMode; + + /// Set whether the particle size acts as a multiplier on top of the trail width. + [JsonProperty("sizeAffectsWidth")] + public bool sizeAffectsWidth; + + /// Set whether the particle size acts as a multiplier on top of the trail lifetime. + [JsonProperty("sizeAffectsLifetime")] + public bool sizeAffectsLifetime; + + /// Toggle whether the trail inherits the particle color as its starting color. + [JsonProperty("useMeinheritParticleColorshColors")] + public bool inheritParticleColor; + + /// The gradient that controls the trail colors during the lifetime of the attached particle. + [JsonProperty("colorOverLifetime")] + public VGO_PS_MinMaxGradient colorOverLifetime; + + /// The curve describing the width of each trail point. + [JsonProperty("widthOverTrail")] + public VGO_PS_MinMaxCurve widthOverTrail; + + /// A multiplier for ParticleSystem.TrailModule._widthOverTrail. + [JsonProperty("widthOverTrailMultiplier")] + public float widthOverTrailMultiplier; + + /// The gradient that controls the trail colors over the length of the trail. + [JsonProperty("colorOverTrail")] + public VGO_PS_MinMaxGradient colorOverTrail; + + /// Configures the trails to generate Normals and Tangents. + [JsonProperty("generateLightingData")] + public bool generateLightingData; + + /// Apply a shadow bias to prevent self-shadowing artifacts. + [JsonProperty("shadowBias")] + public float shadowBias; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TrailModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TrailModule.cs.meta new file mode 100644 index 0000000..945e938 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TrailModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d5cad834de46384c96c20a07b5a6173 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TriggerModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TriggerModule.cs new file mode 100644 index 0000000..77e47a6 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TriggerModule.cs @@ -0,0 +1,18 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_TriggerModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + + /// + /// VGO Particle System TriggerModule + /// + [Serializable] + [JsonObject("vgo.ps.triggerModule")] + public class VGO_PS_TriggerModule + { + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TriggerModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TriggerModule.cs.meta new file mode 100644 index 0000000..abcf937 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_TriggerModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: acc45944452209f4b84c4b5cf6c7494e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_VelocityOverLifetimeModule.cs b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_VelocityOverLifetimeModule.cs new file mode 100644 index 0000000..5434394 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_VelocityOverLifetimeModule.cs @@ -0,0 +1,114 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniGLTFforUniVgo +// @Class : VGO_PS_VelocityOverLifetimeModule +// ---------------------------------------------------------------------- +namespace UniGLTFforUniVgo +{ + using Newtonsoft.Json; + using System; + using UnityEngine; + + /// + /// VGO Particle System VelocityOverLifetimeModule + /// + [Serializable] + [JsonObject("vgo.ps.velocityOverLifetimeModule")] + public class VGO_PS_VelocityOverLifetimeModule + { + /// Specifies whether the VelocityOverLifetimeModule is enabled or disabled. + [JsonProperty("enabled")] + public bool enabled; + + /// Curve to control particle speed based on lifetime, on the x-axis. + [JsonProperty("x")] + public VGO_PS_MinMaxCurve x; + + /// Curve to control particle speed based on lifetime, on the y-axis. + [JsonProperty("y")] + public VGO_PS_MinMaxCurve y; + + /// Curve to control particle speed based on lifetime, on the z-axis. + [JsonProperty("z")] + public VGO_PS_MinMaxCurve z; + + /// A multiplier for ParticleSystem.VelocityOverLifetimeModule._x + [JsonProperty("xMultiplier")] + public float xMultiplier; + + /// A multiplier for ParticleSystem.VelocityOverLifetimeModule._y. + [JsonProperty("yMultiplier")] + public float yMultiplier; + + /// A multiplier for ParticleSystem.VelocityOverLifetimeModule._z. + [JsonProperty("zMultiplier")] + public float zMultiplier; + + /// Specifies if the velocities are in local space (rotated with the transform) or world space. + [JsonProperty("space")] + public ParticleSystemSimulationSpace space; + + /// Curve to control particle speed based on lifetime, around the x-axis. + [JsonProperty("orbitalX")] + public VGO_PS_MinMaxCurve orbitalX; + + /// Curve to control particle speed based on lifetime, around the y-axis. + [JsonProperty("orbitalY")] + public VGO_PS_MinMaxCurve orbitalY; + + /// Curve to control particle speed based on lifetime, around the z-axis. + [JsonProperty("orbitalZ")] + public VGO_PS_MinMaxCurve orbitalZ; + + /// Speed multiplier along the x-axis. + [JsonProperty("orbitalXMultiplier")] + public float orbitalXMultiplier; + + /// Speed multiplier along the y-axis. + [JsonProperty("orbitalYMultiplier")] + public float orbitalYMultiplier; + + /// Speed multiplier along the z-axis. + [JsonProperty("orbitalZMultiplier")] + public float orbitalZMultiplier; + + /// Specify a custom center of rotation for the orbital and radial velocities. + [JsonProperty("orbitalOffsetX")] + public VGO_PS_MinMaxCurve orbitalOffsetX; + + /// Specify a custom center of rotation for the orbital and radial velocities. + [JsonProperty("orbitalOffsetY")] + public VGO_PS_MinMaxCurve orbitalOffsetY; + + /// Specify a custom center of rotation for the orbital and radial velocities. + [JsonProperty("orbitalOffsetZ")] + public VGO_PS_MinMaxCurve orbitalOffsetZ; + + /// A multiplier for _orbitalOffsetX. + [JsonProperty("orbitalOffsetXMultiplier")] + public float orbitalOffsetXMultiplier; + + /// A multiplier for _orbitalOffsetY. + [JsonProperty("orbitalOffsetYMultiplier")] + public float orbitalOffsetYMultiplier; + + /// A multiplier for _orbitalOffsetY. + [JsonProperty("orbitalOffsetZMultiplier")] + public float orbitalOffsetZMultiplier; + + /// Curve to control particle speed based on lifetime, away from a center position. + [JsonProperty("radial")] + public VGO_PS_MinMaxCurve radial; + + /// A multiplier for ParticleSystem.VelocityOverLifetimeModule._radial. + [JsonProperty("radialMultiplier")] + public float radialMultiplier; + + /// Curve to control particle speed based on lifetime, without affecting the direction of the particles. + [JsonProperty("speedModifier")] + public VGO_PS_MinMaxCurve speedModifier; + + /// A multiplier for ParticleSystem.VelocityOverLifetimeModule._speedModifier. + [JsonProperty("speedModifierMultiplier")] + public float speedModifierMultiplier; + } +} diff --git a/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_VelocityOverLifetimeModule.cs.meta b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_VelocityOverLifetimeModule.cs.meta new file mode 100644 index 0000000..563dfa2 --- /dev/null +++ b/UniGLTFforUniVgo/Runtime/Schema/Extensions/VgoElements/VGO_PS_VelocityOverLifetimeModule.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e50cfd083817e8243912102a06c2ac8e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs b/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs index 94a00d5..7337a7d 100644 --- a/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs +++ b/UniGLTFforUniVgo/Runtime/Serialization/VgoContractResolver.cs @@ -26,19 +26,74 @@ protected override JsonContract CreateContract(Type objectType) if ((objectType == typeof(ColliderType)) || (objectType == typeof(CollisionDetectionMode)) || + (objectType == typeof(GradientMode)) || + (objectType == typeof(MotionVectorGenerationMode)) || (objectType == typeof(PhysicMaterialCombine)) || - (objectType == typeof(RigidbodyInterpolation))) + (objectType == typeof(RigidbodyInterpolation)) || + (objectType == typeof(SpriteMaskInteraction)) || + (objectType == typeof(WrapMode)) || + (objectType == typeof(WeightedMode)) + ) { contract.Converter = new StringEnumConverter(new DefaultNamingStrategy(), allowIntegerValues: false); } // Rendering - if ((objectType == typeof(LightmapBakeType)) || + if ((objectType == typeof(CullMode)) || + (objectType == typeof(LightmapBakeType)) || + (objectType == typeof(LightProbeUsage)) || (objectType == typeof(LightRenderMode)) || (objectType == typeof(LightShadowResolution)) || (objectType == typeof(LightShadows)) || (objectType == typeof(LightShape)) || - (objectType == typeof(LightType))) + (objectType == typeof(LightType)) || + (objectType == typeof(ReflectionProbeUsage)) || + (objectType == typeof(ShadowCastingMode)) + ) + { + contract.Converter = new StringEnumConverter(new DefaultNamingStrategy(), allowIntegerValues: false); + } + + // ParticleSystem + if ((objectType == typeof(ParticleSystemAnimationMode)) || + (objectType == typeof(ParticleSystemAnimationRowMode)) || + (objectType == typeof(ParticleSystemAnimationTimeMode)) || + (objectType == typeof(ParticleSystemAnimationType)) || + (objectType == typeof(ParticleSystemCollisionMode)) || + (objectType == typeof(ParticleSystemCollisionQuality)) || + (objectType == typeof(ParticleSystemCollisionType)) || + (objectType == typeof(ParticleSystemCullingMode)) || + (objectType == typeof(ParticleSystemCurveMode)) || + (objectType == typeof(ParticleSystemEmitterVelocityMode)) || + (objectType == typeof(ParticleSystemGameObjectFilter)) || + (objectType == typeof(ParticleSystemGradientMode)) || + (objectType == typeof(ParticleSystemInheritVelocityMode)) || + (objectType == typeof(ParticleSystemMeshShapeType)) || + (objectType == typeof(ParticleSystemNoiseQuality)) || + (objectType == typeof(ParticleSystemOverlapAction)) || + (objectType == typeof(ParticleSystemRenderMode)) || + (objectType == typeof(ParticleSystemRenderSpace)) || + (objectType == typeof(ParticleSystemRingBufferMode)) || + (objectType == typeof(ParticleSystemScalingMode)) || + (objectType == typeof(ParticleSystemShapeMultiModeValue)) || + (objectType == typeof(ParticleSystemShapeTextureChannel)) || + (objectType == typeof(ParticleSystemShapeType)) || + (objectType == typeof(ParticleSystemSimulationSpace)) || + (objectType == typeof(ParticleSystemSortMode) || + (objectType == typeof(ParticleSystemStopAction)) || + (objectType == typeof(ParticleSystemTrailMode)) || + (objectType == typeof(ParticleSystemTrailTextureMode)) + ) + ) + { + contract.Converter = new StringEnumConverter(new DefaultNamingStrategy(), allowIntegerValues: false); + } + + // Shader Properties (Particle) + if ((objectType == typeof(ParticleBlendMode)) || + (objectType == typeof(ParticleColorMode)) || + (objectType == typeof(ParticleFlipBookMode)) + ) { contract.Converter = new StringEnumConverter(new DefaultNamingStrategy(), allowIntegerValues: false); } diff --git a/UniStandardParticle.meta b/UniStandardParticle.meta new file mode 100644 index 0000000..9f39282 --- /dev/null +++ b/UniStandardParticle.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 718cfd8566e3e0c429679aa01b0625c3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/LICENSE.md b/UniStandardParticle/LICENSE.md new file mode 100644 index 0000000..8da95f2 --- /dev/null +++ b/UniStandardParticle/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/UniStandardParticle/LICENSE.md.meta b/UniStandardParticle/LICENSE.md.meta new file mode 100644 index 0000000..53206fa --- /dev/null +++ b/UniStandardParticle/LICENSE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 75eef7646099d2241b56472af9c693a2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/Runtime.meta b/UniStandardParticle/Runtime.meta new file mode 100644 index 0000000..7f53692 --- /dev/null +++ b/UniStandardParticle/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2e1be7fbca74834fb958d23af3bb672 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/Runtime/Enums.cs b/UniStandardParticle/Runtime/Enums.cs new file mode 100644 index 0000000..3655c0d --- /dev/null +++ b/UniStandardParticle/Runtime/Enums.cs @@ -0,0 +1,51 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniStandardParticle +// @Class : +// ---------------------------------------------------------------------- +namespace UniStandardParticle +{ + /// + public enum BlendMode + { + /// + Opaque = 0, + /// + Cutout = 1, + /// + Fade = 2, + /// + Transparent = 3, + /// + Additive = 4, + /// + Subtractive = 5, + /// + Modulate = 6, + } + + /// + public enum ColorMode + { + /// + Multiply = 0, + /// + Additive = 1, + /// + Subtractive = 2, + /// + Overlay = 3, + /// + Color = 4, + /// + Difference = 5, + } + + /// + public enum FlipBookMode + { + /// + Simple = 0, + /// + Blended = 1, + } +} \ No newline at end of file diff --git a/UniStandardParticle/Runtime/Enums.cs.meta b/UniStandardParticle/Runtime/Enums.cs.meta new file mode 100644 index 0000000..d7c36f9 --- /dev/null +++ b/UniStandardParticle/Runtime/Enums.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4366a63971a8df04aa50ea7dd563ce9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/Runtime/ParticleDefinition.cs b/UniStandardParticle/Runtime/ParticleDefinition.cs new file mode 100644 index 0000000..3f8bb38 --- /dev/null +++ b/UniStandardParticle/Runtime/ParticleDefinition.cs @@ -0,0 +1,96 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniStandardParticle +// @Class : ParticleDefinition +// ---------------------------------------------------------------------- +namespace UniStandardParticle +{ + using UnityEngine; + using UnityEngine.Rendering; + + /// + /// + /// + public class ParticleDefinition + { + /// + public BlendMode RenderMode { get; set; } + + /// + public ColorMode ColorMode { get; set; } + + /// + public FlipBookMode FlipBookMode { get; set; } + + /// + public CullMode CullMode { get; set; } + + /// + public bool TwoSided { get; set; } + + /// + public bool SoftParticlesEnabled { get; set; } + + /// + public Vector4 SoftParticleFadeParams { get; set; } + + /// + public bool CameraFadingEnabled { get; set; } + + /// + public Vector4 CameraFadeParams { get; set; } + + /// + public bool DistortionEnabled { get; set; } + + /// + public Texture2D GrabTexture { get; set; } + + /// + public float DistortionStrengthScaled { get; set; } + + /// + public float DistortionBlend { get; set; } + + /// + public Color ColorAddSubDiff { get; set; } + + /// + public Texture2D MainTex { get; set; } + + /// + public Vector4 MainTexSt { get; set; } + + /// + public Color Color { get; set; } + + /// + public float Cutoff { get; set; } + + /// + public Texture2D MetallicGlossMap { get; set; } + + /// + public float Metallic { get; set; } + + /// + public float Glossiness { get; set; } + + /// + public Texture2D BumpMap { get; set; } + + /// + public float BumpScale { get; set; } + + /// + public bool LightingEnabled { get; set; } + + /// + public bool EmissionEnabled { get; set; } + + /// + public Color EmissionColor { get; set; } + + /// + public Texture2D EmissionMap { get; set; } + } +} \ No newline at end of file diff --git a/UniStandardParticle/Runtime/ParticleDefinition.cs.meta b/UniStandardParticle/Runtime/ParticleDefinition.cs.meta new file mode 100644 index 0000000..5038eeb --- /dev/null +++ b/UniStandardParticle/Runtime/ParticleDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 768891a8b30ac094b804e62a3f8916d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/Runtime/UniStandardParticle.asmdef b/UniStandardParticle/Runtime/UniStandardParticle.asmdef new file mode 100644 index 0000000..bcf0d8b --- /dev/null +++ b/UniStandardParticle/Runtime/UniStandardParticle.asmdef @@ -0,0 +1,3 @@ +{ + "name": "UniStandardParticle" +} diff --git a/UniStandardParticle/Runtime/UniStandardParticle.asmdef.meta b/UniStandardParticle/Runtime/UniStandardParticle.asmdef.meta new file mode 100644 index 0000000..0429523 --- /dev/null +++ b/UniStandardParticle/Runtime/UniStandardParticle.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fa705c2b2a6cafc47b8e5c653695857f +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/Runtime/Utils.cs b/UniStandardParticle/Runtime/Utils.cs new file mode 100644 index 0000000..9970303 --- /dev/null +++ b/UniStandardParticle/Runtime/Utils.cs @@ -0,0 +1,231 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniStandardParticle +// @Class : Utils +// ---------------------------------------------------------------------- +namespace UniStandardParticle +{ + /// + /// + /// + public static partial class Utils + { + /// + public const string ShaderNameStandardSurface = "Particles/Standard Surface"; + + /// + public const string ShaderNameStandardUnlit = "Particles/Standard Unlit"; + + #region Properties + + /// + public const string PropBlendMode = "_Mode"; + + /// + public const string PropCullMode = "_Cull"; + + /// + public const string PropFlipbookMode = "_FlipbookMode"; + + /// + public const string PropSoftParticlesEnabled = "_SoftParticlesEnabled"; + + /// + public const string PropSoftParticleFadeParams = "_SoftParticleFadeParams"; + + /// + public const string PropSoftParticleNearFadeDistance = "_SoftParticlesNearFadeDistance"; + + /// + public const string PropSoftParticleFarFadeDistance = "_SoftParticlesFarFadeDistance"; + + /// + public const string PropCameraFadingEnabled = "_CameraFadingEnabled"; + + /// + public const string PropCameraFadeParams = "_CameraFadeParams"; + + /// + public const string PropCameraNearFadeDistance = "_CameraNearFadeDistance"; + + /// + public const string PropCameraFarFadeDistance = "_CameraFarFadeDistance"; + + /// + public const string PropDistortionEnabled = "_DistortionEnabled"; + + /// + public const string PropGrabTexture = "_GrabTexture"; + + /// + public const string PropDistortionStrengthScaled = "_DistortionStrengthScaled"; + + /// + public const string PropDistortionBlend = "_DistortionBlend"; + + /// + public const string PropColorAddSubDiff = "_ColorAddSubDiff"; + + /// Albedo + public const string PropMainTex = "_MainTex"; + + /// + public const string PropMainTexSt = "_MainTex_ST"; + + /// + public const string PropColor = "_Color"; + + /// + public const string PropCutoff = "_Cutoff"; + + /// + public const string PropMetallicGlossMap = "_MetallicGlossMap"; + + /// + public const string PropMetallic = "_Metallic"; + + /// + public const string PropGlossiness = "_Glossiness"; + + /// + public const string PropBumpMap = "_BumpMap"; + + /// + public const string PropBumpScale = "_BumpScale"; + + /// + public const string PropLightingEnabled = "_LightingEnabled"; + + /// + public const string PropEmissionEnabled = "_EmissionEnabled"; + + /// + public const string PropEmissionColor = "_EmissionColor"; + + /// + public const string PropEmissionMap = "_EmissionMap"; + + /// + public const string PropBlendOp = "_BlendOp"; + + /// + public const string PropSrcBlend = "_SrcBlend"; + + /// + public const string PropDstBlend = "_DstBlend"; + + /// + public const string PropZWrite = "_ZWrite"; + + #endregion + + #region Keywords + + /// + public const string KeyFlipBookBlending = "_FLIPBOOK_BLENDING"; + + /// + public const string KeyTwoSided = "_TWO_SIDED"; + + /// + public const string KeyFadingOn = "_FADING_ON"; + + /// + public const string KeyDistortionOn = "_DISTORTION_ON"; + + /// + public const string KeyRequireUv2 = "_REQUIRE_UV2"; + + /// + public const string KeyEffectBump = "EFFECT_BUMP"; + + /// + public const string KeyNormalMap = "_NORMALMAP"; + + /// + public const string KeyMetallicGlossMap = "_METALLICGLOSSMAP"; + + /// + public const string KeyEmission = "_EMISSION"; + + /// + public const string KeyAlphaTestOn = "_ALPHATEST_ON"; + + /// + public const string KeyAlphaBlendOn = "_ALPHABLEND_ON"; + + /// + public const string KeyAlphaPremultiplyOn = "_ALPHAPREMULTIPLY_ON"; + + /// + public const string KeyAlphaOverlayOn = "_ALPHAOVERLAY_ON"; + + /// + public const string KeyAlphaModulateOn = "_ALPHAMODULATE_ON"; + + /// + public const string KeyColorOverlayOn = "_COLOROVERLAY_ON"; + + /// + public const string KeyColorColorOn = "_COLORCOLOR_ON"; + + /// + public const string KeyColorAddSubDiffOn = "_COLORADDSUBDIFF_ON"; + + #endregion + + #region Tags + + /// + public const string TagRenderTypeKey = "RenderType"; + + /// + public const string TagRenderTypeValueOpaque = "Opaque"; + + /// + public const string TagRenderTypeValueTransparentCutout = "TransparentCutout"; + + /// + public const string TagRenderTypeValueCutout = "Cutout"; + + /// + public const string TagRenderTypeValueTransparent = "Transparent"; + + /// + public const string TagColorModeKey = "ColorMode"; + + /// + public const string TagColorModeValueMultiply = "Multiply"; + + /// + public const string TagColorModeValueAdditive = "Additive"; + + /// + public const string TagColorModeValueSubtractive = "Subtractive"; + + /// + public const string TagColorModeValueOverlay = "Overlay"; + + /// + public const string TagColorModeValueColor = "Color"; + + /// + public const string TagColorModeValueDifference = "Difference"; + + /// + public const string TagFlipBookModeKey = "FlipBookMode"; + + /// + public const string TagFlipBookModeValueSimple = "Simple"; + + /// + public const string TagFlipBookModeValueBlended = "Blended"; + + #endregion + + /// + public const int DisabledIntValue = 0; + + /// + public const int EnabledIntValue = 1; + } +} \ No newline at end of file diff --git a/UniStandardParticle/Runtime/Utils.cs.meta b/UniStandardParticle/Runtime/Utils.cs.meta new file mode 100644 index 0000000..831c20d --- /dev/null +++ b/UniStandardParticle/Runtime/Utils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f67f5e14bae4c2d4d89dc465c05f2ca2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/Runtime/UtilsGetter.cs b/UniStandardParticle/Runtime/UtilsGetter.cs new file mode 100644 index 0000000..4899285 --- /dev/null +++ b/UniStandardParticle/Runtime/UtilsGetter.cs @@ -0,0 +1,258 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniStandardParticle +// @Class : Utils +// ---------------------------------------------------------------------- +namespace UniStandardParticle +{ + using UnityEngine; + using UnityEngine.Rendering; + + public static partial class Utils + { + /// + /// + /// + /// + /// + public static ParticleDefinition GetParticleParametersFromMaterial(Material material) + { + return new ParticleDefinition + { + RenderMode = GetBlendMode(material), + ColorMode = GetColorMode(material), + FlipBookMode = GetFlipBookMode(material), + CullMode = GetCullMode(material), + SoftParticlesEnabled = GetInt(material, PropSoftParticlesEnabled) == 1, + SoftParticleFadeParams = GetVector(material, PropSoftParticleFadeParams), + CameraFadingEnabled = GetInt(material, PropCameraFadingEnabled) == 1, + CameraFadeParams = GetVector(material, PropCameraFadeParams), + DistortionEnabled = GetInt(material, PropDistortionEnabled) == 1, + GrabTexture = GetTexture(material, PropGrabTexture), + DistortionStrengthScaled = GetFloat(material, PropDistortionStrengthScaled), + DistortionBlend = GetFloat(material, PropDistortionBlend), + ColorAddSubDiff = GetColor(material, PropColorAddSubDiff), + MainTex = GetTexture(material, PropMainTex), + MainTexSt = GetVector(material, PropMainTexSt), + Color = GetColor(material, PropColor), + Cutoff = GetFloat(material, PropCutoff), + MetallicGlossMap = GetTexture(material, PropMetallicGlossMap), + Metallic = GetFloat(material, PropMetallic), + Glossiness = GetFloat(material, PropGlossiness), + BumpMap = GetTexture(material, PropBumpMap), + BumpScale = material.GetFloat(PropBumpScale), + LightingEnabled = (material.shader.name.Contains("Unlit") == false), + EmissionEnabled = material.IsKeywordEnabled(KeyEmission), + EmissionColor = GetColor(material, PropEmissionColor), + EmissionMap = GetTexture(material, PropEmissionMap), + }; + } + + /// + /// + /// + /// + /// + /// + 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 Vector4 GetVector(Material material, string propertyName) + { + if (material.HasProperty(propertyName)) + { + return material.GetVector(propertyName); + } + else + { + return Vector4.zero; + } + } + + /// + /// + /// + /// + /// + private static BlendMode GetBlendMode(Material material) + { + BlendMode blendMode = BlendMode.Opaque; + + if (material.IsKeywordEnabled(KeyAlphaTestOn)) + { + blendMode = BlendMode.Cutout; + } + else if (material.IsKeywordEnabled(KeyAlphaModulateOn)) + { + blendMode = BlendMode.Modulate; + } + else if (material.IsKeywordEnabled(KeyAlphaPremultiplyOn)) + { + blendMode = BlendMode.Transparent; + } + else if (material.IsKeywordEnabled(KeyAlphaBlendOn)) + { + Color colorAddSubDiff = GetColor(material, PropColorAddSubDiff); + + if (colorAddSubDiff == new Color(1.0f, 0.0f, 0.0f, 0.0f)) + { + blendMode = BlendMode.Additive; + } + else if (colorAddSubDiff == new Color(-1.0f, 0.0f, 0.0f, 0.0f)) + { + blendMode = BlendMode.Subtractive; + } + else + { + blendMode = BlendMode.Fade; + } + } + + return blendMode; + } + + /// + /// + /// + /// + /// + private static ColorMode GetColorMode(Material material) + { + ColorMode colorMode = ColorMode.Multiply; + + if (material.IsKeywordEnabled(KeyColorOverlayOn)) + { + colorMode = ColorMode.Overlay; + } + else if (material.IsKeywordEnabled(KeyColorColorOn)) + { + colorMode = ColorMode.Color; + } + else if (material.IsKeywordEnabled(KeyColorAddSubDiffOn)) + { + Color colorAddSubDiff = GetColor(material, PropColorAddSubDiff); + + if (colorAddSubDiff == new Color(1.0f, 0.0f, 0.0f, 0.0f)) + { + colorMode = ColorMode.Additive; + } + else if (colorAddSubDiff == new Color(-1.0f, 0.0f, 0.0f, 0.0f)) + { + colorMode = ColorMode.Subtractive; + } + else if (colorAddSubDiff == new Color(-1.0f, 1.0f, 0.0f, 0.0f)) + { + colorMode = ColorMode.Difference; + } + else + { + colorMode = ColorMode.Additive; + } + } + + return colorMode; + } + + /// + /// + /// + /// + /// + private static FlipBookMode GetFlipBookMode(Material material) + { + if (GetInt(material, PropFlipbookMode) == 1) + { + return FlipBookMode.Blended; + } + else + { + return FlipBookMode.Simple; + } + } + + /// + /// + /// + /// + /// + private static CullMode GetCullMode(Material material) + { + if (material.IsKeywordEnabled(KeyTwoSided)) + { + return CullMode.Off; + } + else + { + return CullMode.Back; + } + } + } +} \ No newline at end of file diff --git a/UniStandardParticle/Runtime/UtilsGetter.cs.meta b/UniStandardParticle/Runtime/UtilsGetter.cs.meta new file mode 100644 index 0000000..5891482 --- /dev/null +++ b/UniStandardParticle/Runtime/UtilsGetter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2eb3be1fb3900234796bf35483f051ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniStandardParticle/Runtime/UtilsSetter.cs b/UniStandardParticle/Runtime/UtilsSetter.cs new file mode 100644 index 0000000..eb28922 --- /dev/null +++ b/UniStandardParticle/Runtime/UtilsSetter.cs @@ -0,0 +1,314 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniStandardParticle +// @Class : Utils +// ---------------------------------------------------------------------- +namespace UniStandardParticle +{ + using UnityEngine; + + public static partial class Utils + { + /// + /// + /// + /// + /// + public static void SetParticleParametersToMaterial(Material material, ParticleDefinition parameters) + { + material.SetInt(PropBlendMode, (int)parameters.RenderMode); + + //SetColorMode(material, parameters.ColorMode); + + SetInt(material, PropFlipbookMode, (int)parameters.FlipBookMode); + SetInt(material, PropCullMode, (int)parameters.CullMode); + + SetKeyword(material, KeyRequireUv2, parameters.FlipBookMode == FlipBookMode.Blended); + SetKeyword(material, KeyTwoSided, parameters.CullMode == UnityEngine.Rendering.CullMode.Off); + SetKeyword(material, KeyFadingOn, parameters.CameraFadingEnabled); + SetKeyword(material, KeyDistortionOn, parameters.DistortionEnabled); + SetKeyword(material, KeyEffectBump, parameters.DistortionEnabled); + SetKeyword(material, KeyNormalMap, (parameters.BumpMap != null)); + SetKeyword(material, KeyMetallicGlossMap, (parameters.MetallicGlossMap != null)); + SetKeyword(material, KeyEmission, parameters.EmissionEnabled); + + SetBool(material, PropSoftParticlesEnabled, parameters.SoftParticlesEnabled); + SetVector(material, PropSoftParticleFadeParams, parameters.SoftParticleFadeParams); + //SetFloat(material, PropSoftParticleNearFadeDistance, parameters.SoftParticleFadeParams.x); + //SetFloat(material, PropSoftParticleFarFadeDistance, parameters.SoftParticleFadeParams.y); + + SetBool(material, PropCameraFadingEnabled, parameters.CameraFadingEnabled); + SetVector(material, PropCameraFadeParams, parameters.CameraFadeParams); + //SetFloat(material, PropCameraNearFadeDistance, parameters.CameraFadeParams.x); + //SetFloat(material, PropCameraFarFadeDistance, parameters.CameraFadeParams.y); + + SetBool(material, PropDistortionEnabled, parameters.DistortionEnabled); + SetTexture(material, PropGrabTexture, parameters.GrabTexture); + SetFloat(material, PropDistortionStrengthScaled, parameters.DistortionStrengthScaled); + SetFloat(material, PropDistortionBlend, parameters.DistortionBlend); + SetColor(material, PropColorAddSubDiff, parameters.ColorAddSubDiff); + + SetTexture(material, PropMainTex, parameters.MainTex); + SetVector(material, PropMainTexSt, parameters.MainTexSt); + //material.SetTextureScale(PropMainTex, new Vector2(parameters.MainTexSt[0], parameters.MainTexSt[1])); + //material.SetTextureOffset(PropMainTex, new Vector2(parameters.MainTexSt[2], parameters.MainTexSt[3])); + SetColor(material, PropColor, parameters.Color); + SetFloat(material, PropCutoff, parameters.Cutoff); + + SetTexture(material, PropMetallicGlossMap, parameters.MetallicGlossMap); + SetFloat(material, PropMetallic, parameters.Metallic); + SetFloat(material, PropGlossiness, parameters.Glossiness); + + SetTexture(material, PropBumpMap, parameters.BumpMap); + SetFloat(material, PropBumpScale, parameters.BumpScale); + + SetBool(material, PropLightingEnabled, parameters.LightingEnabled); + SetBool(material, PropEmissionEnabled, parameters.EmissionEnabled); + SetColor(material, PropEmissionColor, parameters.EmissionColor); + SetTexture(material, PropEmissionMap, parameters.EmissionMap); + + material.SetShaderPassEnabled("Always", parameters.DistortionEnabled); + + //material.mainTexture = parameters.MainTex; + //material.color = parameters.Color; + //material.mainTextureScale = new Vector2(parameters.MainTexSt[0], parameters.MainTexSt[1]); + //material.mainTextureOffset = new Vector2(parameters.MainTexSt[2], parameters.MainTexSt[3]); + + SetBlendMode(material, parameters.RenderMode); + SetColorMode(material, parameters.ColorMode); + } + + /// + /// + /// + /// + /// + public static void SetBlendMode(Material material, BlendMode blendMode) + { + //material.SetInt(PropBlendMode, (int)blendMode); + + switch (blendMode) + { + case BlendMode.Opaque: + material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueOpaque); + material.SetInt(PropBlendOp, (int)UnityEngine.Rendering.BlendOp.Add); + material.SetInt(PropSrcBlend, (int)UnityEngine.Rendering.BlendMode.One); + material.SetInt(PropDstBlend, (int)UnityEngine.Rendering.BlendMode.Zero); + material.SetInt(PropZWrite, 1); + SetKeyword(material, KeyAlphaTestOn, false); + SetKeyword(material, KeyAlphaBlendOn, false); + SetKeyword(material, KeyAlphaPremultiplyOn, false); + SetKeyword(material, KeyAlphaModulateOn, false); + material.renderQueue = -1; + break; + case BlendMode.Cutout: + material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparentCutout); + material.SetInt(PropBlendOp, (int)UnityEngine.Rendering.BlendOp.Add); + material.SetInt(PropSrcBlend, (int)UnityEngine.Rendering.BlendMode.One); + material.SetInt(PropDstBlend, (int)UnityEngine.Rendering.BlendMode.Zero); + material.SetInt(PropZWrite, 1); + SetKeyword(material, KeyAlphaTestOn, true); + SetKeyword(material, KeyAlphaBlendOn, false); + SetKeyword(material, KeyAlphaPremultiplyOn, false); + SetKeyword(material, KeyAlphaModulateOn, false); + material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.AlphaTest; + break; + case BlendMode.Fade: + material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); + material.SetInt(PropBlendOp, (int)UnityEngine.Rendering.BlendOp.Add); + material.SetInt(PropSrcBlend, (int)UnityEngine.Rendering.BlendMode.SrcAlpha); + material.SetInt(PropDstBlend, (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); + material.SetInt(PropZWrite, 0); + SetKeyword(material, KeyAlphaTestOn, false); + SetKeyword(material, KeyAlphaBlendOn, true); + SetKeyword(material, KeyAlphaPremultiplyOn, false); + SetKeyword(material, KeyAlphaModulateOn, false); + material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent; + break; + case BlendMode.Transparent: + material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); + material.SetInt(PropBlendOp, (int)UnityEngine.Rendering.BlendOp.Add); + material.SetInt(PropSrcBlend, (int)UnityEngine.Rendering.BlendMode.One); + material.SetInt(PropDstBlend, (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); + material.SetInt(PropZWrite, 0); + SetKeyword(material, KeyAlphaTestOn, false); + SetKeyword(material, KeyAlphaBlendOn, false); + SetKeyword(material, KeyAlphaPremultiplyOn, true); + SetKeyword(material, KeyAlphaModulateOn, false); + material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent; + break; + case BlendMode.Additive: + material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); + material.SetInt(PropBlendOp, (int)UnityEngine.Rendering.BlendOp.Add); + material.SetInt(PropSrcBlend, (int)UnityEngine.Rendering.BlendMode.SrcAlpha); + material.SetInt(PropDstBlend, (int)UnityEngine.Rendering.BlendMode.One); + material.SetInt(PropZWrite, 0); + SetKeyword(material, KeyAlphaTestOn, false); + SetKeyword(material, KeyAlphaBlendOn, true); + SetKeyword(material, KeyAlphaPremultiplyOn, false); + SetKeyword(material, KeyAlphaModulateOn, false); + material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent; + break; + case BlendMode.Subtractive: + material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); + material.SetInt(PropBlendOp, (int)UnityEngine.Rendering.BlendOp.ReverseSubtract); + material.SetInt(PropSrcBlend, (int)UnityEngine.Rendering.BlendMode.SrcAlpha); + material.SetInt(PropDstBlend, (int)UnityEngine.Rendering.BlendMode.One); + material.SetInt(PropZWrite, 0); + SetKeyword(material, KeyAlphaTestOn, false); + SetKeyword(material, KeyAlphaBlendOn, true); + SetKeyword(material, KeyAlphaPremultiplyOn, false); + SetKeyword(material, KeyAlphaModulateOn, false); + material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent; + break; + case BlendMode.Modulate: + material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); + material.SetInt(PropBlendOp, (int)UnityEngine.Rendering.BlendOp.Add); + material.SetInt(PropSrcBlend, (int)UnityEngine.Rendering.BlendMode.DstColor); + material.SetInt(PropDstBlend, (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); + material.SetInt(PropZWrite, 0); + SetKeyword(material, KeyAlphaTestOn, false); + SetKeyword(material, KeyAlphaBlendOn, false); + SetKeyword(material, KeyAlphaPremultiplyOn, false); + SetKeyword(material, KeyAlphaModulateOn, true); + material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent; + break; + } + } + + /// + /// + /// + /// + /// + public static void SetColorMode(Material material, ColorMode colorMode) + { + switch (colorMode) + { + case ColorMode.Multiply: + SetKeyword(material, KeyColorOverlayOn, false); + SetKeyword(material, KeyColorAddSubDiffOn, false); + SetKeyword(material, KeyColorAddSubDiffOn, false); + break; + case ColorMode.Overlay: + SetKeyword(material, KeyColorOverlayOn, true); + SetKeyword(material, KeyColorAddSubDiffOn, false); + SetKeyword(material, KeyColorAddSubDiffOn, false); + break; + case ColorMode.Color: + SetKeyword(material, KeyColorOverlayOn, false); + SetKeyword(material, KeyColorAddSubDiffOn, true); + SetKeyword(material, KeyColorAddSubDiffOn, false); + break; + case ColorMode.Additive: + case ColorMode.Subtractive: + case ColorMode.Difference: + SetKeyword(material, KeyColorOverlayOn, false); + SetKeyword(material, KeyColorAddSubDiffOn, false); + SetKeyword(material, KeyColorAddSubDiffOn, true); + break; + } + } + + /// + /// + /// + /// + /// + /// + 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 SetVector(Material material, string propertyName, Vector4 val) + { + if (material.HasProperty(propertyName)) + { + material.SetVector(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 SetKeyword(Material material, string keyword, bool required) + { + if (required) + { + material.EnableKeyword(keyword); + } + else + { + material.DisableKeyword(keyword); + } + } + } +} \ No newline at end of file diff --git a/UniStandardParticle/Runtime/UtilsSetter.cs.meta b/UniStandardParticle/Runtime/UtilsSetter.cs.meta new file mode 100644 index 0000000..b2c09a6 --- /dev/null +++ b/UniStandardParticle/Runtime/UtilsSetter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19c579c1cf61aff47aea80fef866a2fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/README.ja.md b/UniVgo/README.ja.md index c02d82d..3f2bebc 100644 --- a/UniVgo/README.ja.md +++ b/UniVgo/README.ja.md @@ -26,8 +26,8 @@ ___ |パッケージ名|所有者|リポジトリー|仕様バージョン|プログラム バージョン|リリース日| |:---:|:---:|:---:|:---:|:---:|:---:| -|newtonsoft-json-for-unity|jillejr|GitHub|12.0.2|12.0.201|2020年1月4日| -|UniVGO|IzayoiJiichan|GitHub|VGO 0.4|0.6.0|2020年1月17日| +|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日| ___ ## インストール @@ -59,7 +59,7 @@ ___ ], "dependencies": { "com.unity.ugui": "1.0.0", - "jillejr.newtonsoft.json-for-unity": "12.0.201", + "jillejr.newtonsoft.json-for-unity": "12.0.301", "com.unity.modules.ai": "1.0.0", ... "com.unity.modules.xr": "1.0.0" @@ -79,8 +79,8 @@ AまたはBのいずれかを行ってください。 { "dependencies": { "com.unity.ugui": "1.0.0", - "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.6.0", - "jillejr.newtonsoft.json-for-unity": "12.0.201", + "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.7.0", + "jillejr.newtonsoft.json-for-unity": "12.0.301", "com.unity.modules.ai": "1.0.0", ... "com.unity.modules.xr": "1.0.0" @@ -100,7 +100,7 @@ https://github.com/izayoijiichan/VGO/releases ``` Packages - izayoi.univgo@0.6.0-preview + izayoi.univgo@0.7.0-preview DepthFirstScheduler MToon ShaderProperty @@ -127,8 +127,8 @@ VGO のメタ情報です。 |定義名|説明|型|固定値| |:---|:---|:---:|:---:| |Generator Name|生成ツールの名前です。|string|UniVGO| -|Generator Version|生成ツールのバージョンです。|string|0.6.0| -|Spec Version|VGOの仕様バージョンです。|string|0.4| +|Generator Version|生成ツールのバージョンです。|string|0.7.0| +|Spec Version|VGOの仕様バージョンです。|string|0.5| - Root の GameObject に1つ付与しておく必要があります。 - ユーザーが設定可能な項目はありません。 @@ -174,6 +174,19 @@ Box, Capsule, Sphere タイプに対応しています。 詳細は Unity 公式のマニュアルをご覧ください。 +UniVGO では、Cookie, Flare, Halo は対象外です。 +また、ランタイムロードを行う場合、Realtime 設定のみ描画され、Baked は反映されません。 + +### Particle System + +パーティクル システムの設定です。 +1つの GameObject に対し1つまで付与することが可能です。 + +詳細は Unity 公式のマニュアルをご覧ください。 + +UniVGO では、Collision, Triggers, SubEmitters, TextureSheetAnimation, CustomData のモジュールは対象外です。 +また、Mesh, Texture, Sprite モードも対象外となり、Material でのみ動作します。 + ___ ## Shader @@ -182,12 +195,15 @@ ___ |シェーダー名|説明| |:---|:---| |Standard|標準シェーダー| +|Particles/Standard Surface|Particle System 専用シェーダー| +|Particles/Standard Unlit|Particle System 専用 Unlit シェーダー| |Unlit/Color|| |Unlit/Texture|| |Unlit/Transparent|| |Unlit/Transparent Cutout|| |UniGLTF/Unlit|| |VRM/MToon|| + ___ ## VGO のセットアップ @@ -295,6 +311,7 @@ ___ } } ~~~ +VgoImporter はコルーチンやタスクを使用することでの非同期処理にも対応しています。 ___ ## その他の情報 @@ -320,7 +337,7 @@ ___ |MToon.Editor|MToon シェーダー ユーティリティー|-|*| |ShaderProperty.Runtime|シェーダーのプロパティー情報|*|*| |UniGLTFforUniVgo|UniGLTF(UniVGO用)|*|*| -|UniUnlit|Unlit シェーダー ユーティリティー|*|*| +|UniStandardParticle|Particle シェーダー ユーティリティー|*|*| |UniUnlit.Editor|Unlit シェーダー ユーティリティー|-|*| |UniVgo|VGO メインプログラム|*|*| |UniVgo.Editor|VGO の入出力|-|*| @@ -335,11 +352,6 @@ ___ GameObject の`tag`は、取り込みを行う際、予め UnityEditor にてタグの定義を追加しておく必要があります。 また、ランタイムロードを行う場合も同様です。 -### ライトについて - -Cookie, Flare, Halo は対象外です。 -また、ランタイムロードを行う場合、Realtime 設定のみ描画され、Baked は反映されません。 - ___ ## VGO の仕様について @@ -350,13 +362,14 @@ ___ glTFに関する仕様を公開してくださっている KhronosGroup 様をはじめとする皆様、 glTFに関するプログラムを開発・公開してくださっている ousttrue 様、 +MToon シェーダーを開発・公開してくださっている Santarh 様、 VRMに関する仕様及び関連プログラムを公開・配布してくださっているVRMコンソーシアム様、株式会社ドワンゴ様、 Unityを開発してくださっている Unity Technologies 様、 その他関連する皆様には心より感謝いたします。 この場を借りて御礼申し上げます。 ___ -最終更新日:2020年1月17日 +最終更新日:2020年1月23日 編集者:十六夜おじいちゃん *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/UniVgo/README.md b/UniVgo/README.md index 255554d..c2653d3 100644 --- a/UniVgo/README.md +++ b/UniVgo/README.md @@ -26,8 +26,8 @@ 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.2|12.0.201|4 Jan, 2020| -|UniVGO|IzayoiJiichan|GitHub|VGO 0.4|0.6.0|17 Jan, 2020| +|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| ___ ## Install @@ -56,7 +56,7 @@ You need to be careful where you add them. ], "dependencies": { "com.unity.ugui": "1.0.0", - "jillejr.newtonsoft.json-for-unity": "12.0.201", + "jillejr.newtonsoft.json-for-unity": "12.0.301", "com.unity.modules.ai": "1.0.0", ... "com.unity.modules.xr": "1.0.0" @@ -76,8 +76,8 @@ Write the following in `/Packages/package.json` { "dependencies": { "com.unity.ugui": "1.0.0", - "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.6.0", - "jillejr.newtonsoft.json-for-unity": "12.0.201", + "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.7.0", + "jillejr.newtonsoft.json-for-unity": "12.0.301", "com.unity.modules.ai": "1.0.0", ... "com.unity.modules.xr": "1.0.0" @@ -97,7 +97,7 @@ Unzip the file and place it in the `Packages` folder. ``` Packages - izayoi.univgo@0.6.0-preview + izayoi.univgo@0.7.0-preview DepthFirstScheduler MToon ShaderProperty @@ -124,8 +124,8 @@ Meta information of VGO. |definition name|description|type|fixed value| |:---|:---|:---:|:---:| |Generator Name|The name of the generation tool.|string|UniVGO| -|Generator Version|The generation tool version.|string|0.6.0| -|Spec Version|VGO specification version.|string|0.4| +|Generator Version|The generation tool version.|string|0.7.0| +|Spec Version|VGO specification version.|string|0.5| - It is necessary to give one to Root GameObject. - There are no user configurable items. @@ -171,6 +171,19 @@ It is possible to add up to one for each GameObject. See the official Unity manual for details. +In UniVGO, Cookies, Flare and Halo are not supported. +In addition, when performing runtime loading, only the Realtime setting is drawn, and Baked is not reflected. + +### Particle System + +Settings for the particle system. +It is possible to add up to one for each GameObject. + +See the official Unity manual for details. + +In UniVGO, Collision, Triggers, SubEmitters, TextureSheetAnimation, CustomData modules are not supported. +Mesh, Texture, and Sprite modes are also excluded, and only works with Material. + ___ ## Shader @@ -179,12 +192,15 @@ The supported shaders are as follows. |shader name|descriptoin| |:---|:---| |Standard|Standard shader| +|Particles/Standard Surface|Particle System dedicated shader| +|Particles/Standard Unlit|Particle System dedicated Unlit shader| |Unlit/Color|| |Unlit/Texture|| |Unlit/Transparent|| |Unlit/Transparent Cutout|| |UniGLTF/Unlit|| |VRM/MToon|| + ___ ## VGO setup @@ -292,7 +308,7 @@ The following is a simple sample program. } ~~~ -VgoImporter also supports asynchronous processing using Coroutine and Task. +VgoImporter also supports asynchronous processing using Coroutine or Task. ___ ## Other information @@ -319,6 +335,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|*|*| +|UniStandardParticle|Particle shader utility|*|*| |UniUnlit|Unlit shader utility|*|*| |UniUnlit.Editor|Unlit shader utility|-|*| |UniVgo|VGO main program|*|*| @@ -334,11 +351,6 @@ When the package is installed in the project, the script is automatically compil When importing GameObject `tag`, it is necessary to add tag definitions in UnityEditor in advance. The same applies when performing runtime loading. -### About light - -Cookie, Flare, Halo are not supported. -In addition, when performing runtime loading, only the Realtime setting is drawn, and Baked is not reflected. - ___ ## About VGO specifications @@ -349,13 +361,14 @@ ___ I would like to express my sincere appreciation to Everyone, including KhronosGroup, who published the specifications about glTF, +Dear Santarh for developing and releasing MToon shaders, Dear ousttrue for developing and publishing a program about glTF, VRM Consortium, Dwango Co., Ltd., who has published and distributed VRM specifications and related programs, Unity Technologies, who is developing Unity, and other related people. I would like to take this opportunity to thank you. ___ -Last updated: 17 January, 2020 +Last updated: 23 January, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/UniVgo/Runtime/Converters/ArrayConverter.cs b/UniVgo/Runtime/Converters/ArrayConverter.cs index 3274352..c68be48 100644 --- a/UniVgo/Runtime/Converters/ArrayConverter.cs +++ b/UniVgo/Runtime/Converters/ArrayConverter.cs @@ -51,6 +51,36 @@ public static Color ToColor(float[] values, bool gamma = false) } } + /// + /// Convert float[4] to Quaternion. + /// + /// + /// + /// + public static Quaternion ToQuaternion(float[] values, bool reverseZ = false) + { + if (values == null) + { + return default; + } + + if (values.Length == 4) + { + Quaternion quaternion = new Quaternion(values[0], values[1], values[2], values[3]); + + if (reverseZ) + { + return quaternion.ReverseZ(); + } + else + { + return quaternion; + } + } + + return default; + } + /// /// Convert float[2] to Vector2. /// @@ -100,5 +130,35 @@ public static Vector3 ToVector3(float[] values, bool reverseZ = false) return default; } + + /// + /// Convert float[4] to Vector4. + /// + /// + /// + /// + public static Vector4 ToVector4(float[] values, bool reverseZ = false) + { + if (values == null) + { + return default; + } + + if (values.Length == 4) + { + Vector4 vecter4 = new Vector4(values[0], values[1], values[2], values[3]); + + if (reverseZ) + { + return vecter4.ReverseZ(); + } + else + { + return vecter4; + } + } + + return default; + } } } \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoAnimationCurveConverter.cs b/UniVgo/Runtime/Converters/VgoAnimationCurveConverter.cs new file mode 100644 index 0000000..c5edcd8 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoAnimationCurveConverter.cs @@ -0,0 +1,81 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoAnimationCurveConverter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using UniGLTFforUniVgo; + using UnityEngine; + + /// + /// VGO AnimationCurve Converter + /// + public class VgoAnimationCurveConverter + { + /// + /// Create VGO_AnimationCurve from AnimationCurve. + /// + /// + /// + public static VGO_AnimationCurve CreateFrom(AnimationCurve animationCurve) + { + if (animationCurve == null) + { + return default; + } + + var vgoAnimationCurve = new VGO_AnimationCurve() + { + keys = null, + preWrapMode = animationCurve.preWrapMode, + postWrapMode = animationCurve.postWrapMode, + }; + + if (animationCurve.keys != null) + { + vgoAnimationCurve.keys = new VGO_Keyframe[animationCurve.keys.Length]; + + for (int i = 0; i < animationCurve.keys.Length; i++) + { + vgoAnimationCurve.keys[i] = VgoKeyframeConverter.CreateFrom(animationCurve.keys[i]); + } + } + + return vgoAnimationCurve; + } + + /// + /// Create AnimationCurve from VGO_AnimationCurve. + /// + /// + /// + public static AnimationCurve CreateAnimationCurve(VGO_AnimationCurve vgoAnimationCurve) + { + if (vgoAnimationCurve == null) + { + return default; + } + + var animationCurve = new AnimationCurve() + { + //keys = null, + preWrapMode = vgoAnimationCurve.preWrapMode, + postWrapMode = vgoAnimationCurve.postWrapMode, + }; + + if (vgoAnimationCurve.keys != null) + { + var keys = new Keyframe[vgoAnimationCurve.keys.Length]; + + for (int i = 0; i < vgoAnimationCurve.keys.Length; i++) + { + keys[i] = VgoKeyframeConverter.CreateKeyframe(vgoAnimationCurve.keys[i]); + } + + animationCurve.keys = keys; + } + + return animationCurve; + } + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoAnimationCurveConverter.cs.meta b/UniVgo/Runtime/Converters/VgoAnimationCurveConverter.cs.meta new file mode 100644 index 0000000..e6406b6 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoAnimationCurveConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ddcd28e8eb7e82c4697fe3245bbca159 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/Converters/VgoGradientConverter.cs b/UniVgo/Runtime/Converters/VgoGradientConverter.cs new file mode 100644 index 0000000..c28aa92 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoGradientConverter.cs @@ -0,0 +1,117 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoGradientConverter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using UniGLTFforUniVgo; + using UnityEngine; + + /// + /// VGO Gradient Converter + /// + public class VgoGradientConverter + { + /// + /// Create VGO_Gradient from Gradient. + /// + /// + /// + public static VGO_Gradient CreateFrom(Gradient gradient) + { + if (gradient == null) + { + return default; + } + + var vgoGradient = new VGO_Gradient() + { + colorKeys = null, + alphaKeys = null, + mode = gradient.mode, + }; + + if (gradient.colorKeys != null) + { + vgoGradient.colorKeys = new VGO_GradientColorKey[gradient.colorKeys.Length]; + + for (int i = 0; i < gradient.colorKeys.Length; i++) + { + vgoGradient.colorKeys[i] = new VGO_GradientColorKey() + { + color = gradient.colorKeys[i].color.linear.ToArray(), + time = gradient.colorKeys[i].time, + }; + } + } + + if (gradient.alphaKeys != null) + { + vgoGradient.alphaKeys = new VGO_GradientAlphaKey[gradient.alphaKeys.Length]; + + for (int i = 0; i < gradient.alphaKeys.Length; i++) + { + vgoGradient.alphaKeys[i] = new VGO_GradientAlphaKey() + { + alpha = gradient.alphaKeys[i].alpha, + time = gradient.alphaKeys[i].time, + }; + } + } + + return vgoGradient; + } + + /// + /// Create Gradient from VGO_Gradient. + /// + /// + /// + public static Gradient CreateGradient(VGO_Gradient vgoGradient) + { + if (vgoGradient == null) + { + return default; + } + + var gradient = new Gradient() + { + //colorKeys = null, + //alphaKeys = null, + mode = vgoGradient.mode, + }; + + if (vgoGradient.colorKeys != null) + { + var colorKeys = new GradientColorKey[vgoGradient.colorKeys.Length]; + + for (int i = 0; i < vgoGradient.colorKeys.Length; i++) + { + colorKeys[i] = new GradientColorKey( + col: ArrayConverter.ToColor(vgoGradient.colorKeys[i].color, gamma: true), + time: vgoGradient.colorKeys[i].time + ); + } + + gradient.colorKeys = colorKeys; + } + + if (vgoGradient.alphaKeys != null) + { + var alphaKeys = new GradientAlphaKey[vgoGradient.alphaKeys.Length]; + + for (int i = 0; i < vgoGradient.alphaKeys.Length; i++) + { + alphaKeys[i] = new GradientAlphaKey( + alpha: vgoGradient.alphaKeys[i].alpha, + time: vgoGradient.alphaKeys[i].time + ); + } + + gradient.alphaKeys = alphaKeys; + } + + return gradient; + } + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoGradientConverter.cs.meta b/UniVgo/Runtime/Converters/VgoGradientConverter.cs.meta new file mode 100644 index 0000000..22aa6e9 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoGradientConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef051cb93f845bf4aa891cef338d6704 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/Converters/VgoKeyframeConverter.cs b/UniVgo/Runtime/Converters/VgoKeyframeConverter.cs new file mode 100644 index 0000000..9a76eb3 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoKeyframeConverter.cs @@ -0,0 +1,76 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoKeyframeConverter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using UniGLTFforUniVgo; + using UnityEngine; + + /// + /// VGO Keyframe Converter + /// + public class VgoKeyframeConverter + { + /// + /// Create VGO_Keyframe from Keyframe. + /// + /// + /// + public static VGO_Keyframe CreateFrom(Keyframe keyframe) + { + return new VGO_Keyframe() + { + time = keyframe.time, + value = keyframe.value, + inTangent = keyframe.inTangent, + outTangent = keyframe.outTangent, + inWeight = keyframe.inWeight, + outWeight = keyframe.outWeight, + weightedMode = keyframe.weightedMode, + }; + } + + /// + /// Create Keyframe from VGO_Keyframe. + /// + /// + /// + public static Keyframe CreateKeyframe(VGO_Keyframe vgoKeyframe) + { + if (vgoKeyframe == null) + { + return default; + } + + switch (vgoKeyframe.weightedMode) + { + case WeightedMode.None: + return new Keyframe( + time: vgoKeyframe.time, + value: vgoKeyframe.value, + inTangent: vgoKeyframe.inTangent, + outTangent: vgoKeyframe.outTangent + ); + + case WeightedMode.In: + case WeightedMode.Out: + case WeightedMode.Both: + return new Keyframe( + time: vgoKeyframe.time, + value: vgoKeyframe.value, + inTangent: vgoKeyframe.inTangent, + outTangent: vgoKeyframe.outTangent, + inWeight: vgoKeyframe.inWeight, + outWeight: vgoKeyframe.outWeight + ); + + default: + return new Keyframe( + time: vgoKeyframe.time, + value: vgoKeyframe.value + ); + } + } + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoKeyframeConverter.cs.meta b/UniVgo/Runtime/Converters/VgoKeyframeConverter.cs.meta new file mode 100644 index 0000000..5020717 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoKeyframeConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50a4d709e08aa154eb53908caaca8e16 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/Converters/VgoParticleSystemBurstConverter.cs b/UniVgo/Runtime/Converters/VgoParticleSystemBurstConverter.cs new file mode 100644 index 0000000..e082883 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoParticleSystemBurstConverter.cs @@ -0,0 +1,91 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoParticleSystemBurstConverter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using UniGLTFforUniVgo; + using static UnityEngine.ParticleSystem; + + /// + /// VGO ParticleSystem Burst Converter + /// + public class VgoParticleSystemBurstConverter + { + /// + /// Create VGO_PS_Burst from Burst. + /// + /// + /// + public static VGO_PS_Burst CreateFrom(Burst burst) + { + return new VGO_PS_Burst() + { + time = burst.time, + count = VgoParticleSystemMinMaxCurveConverter.CreateFrom(burst.count), + cycleCount = burst.cycleCount, + repeatInterval = burst.repeatInterval, + probability = burst.probability, + }; + } + + /// + /// Create Burst from VGO_PS_Burst. + /// + /// + /// + public static Burst CreateBurst(VGO_PS_Burst vgoBurst) + { + if (vgoBurst == null) + { + return default; + } + + float time = 0.0f; + + if (0.0f <= vgoBurst.time) + { + time = vgoBurst.time; + } + + MinMaxCurve count = default; + + if (vgoBurst.count != null) + { + count = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoBurst.count); + } + + int cycleCount = 0; + + if (0 <= vgoBurst.cycleCount) + { + cycleCount = vgoBurst.cycleCount; + } + + float repeatInterval = 0.010f; + + if (0.010f <= vgoBurst.repeatInterval) + { + repeatInterval = vgoBurst.repeatInterval; + } + + float probability = 1.0f; + + if ((0.0f <= vgoBurst.probability) && (vgoBurst.probability <= 1.0f)) + { + probability = vgoBurst.probability; + } + + Burst burst = new Burst( + _time: time, + _count: count, + _cycleCount: cycleCount, + _repeatInterval: repeatInterval + ); + + burst.probability = probability; + + return burst; + } + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoParticleSystemBurstConverter.cs.meta b/UniVgo/Runtime/Converters/VgoParticleSystemBurstConverter.cs.meta new file mode 100644 index 0000000..100b002 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoParticleSystemBurstConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b5a80e44ca52bb4ebfd35fec5dbe38b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxCurveConverter.cs b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxCurveConverter.cs new file mode 100644 index 0000000..de03288 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxCurveConverter.cs @@ -0,0 +1,103 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoParticleSystemMinMaxCurveConverter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using UniGLTFforUniVgo; + using UnityEngine; + using static UnityEngine.ParticleSystem; + + /// + /// VGO ParticleSystem MinMaxCurve Converter + /// + public class VgoParticleSystemMinMaxCurveConverter + { + /// + /// Create VGO_PS_MinMaxCurve from MinMaxCurve. + /// + /// + /// + public static VGO_PS_MinMaxCurve CreateFrom(MinMaxCurve minMaxCurve) + { + switch (minMaxCurve.mode) + { + case ParticleSystemCurveMode.Constant: + return new VGO_PS_MinMaxCurve() + { + mode = ParticleSystemCurveMode.Constant, + constant = minMaxCurve.constant, + }; + + case ParticleSystemCurveMode.Curve: + return new VGO_PS_MinMaxCurve() + { + mode = ParticleSystemCurveMode.Curve, + curveMultiplier = minMaxCurve.curveMultiplier, + curve = VgoAnimationCurveConverter.CreateFrom(minMaxCurve.curve), + }; + + case ParticleSystemCurveMode.TwoCurves: + return new VGO_PS_MinMaxCurve() + { + mode = ParticleSystemCurveMode.TwoCurves, + curveMultiplier = minMaxCurve.curveMultiplier, + curveMin = VgoAnimationCurveConverter.CreateFrom(minMaxCurve.curveMin), + curveMax = VgoAnimationCurveConverter.CreateFrom(minMaxCurve.curveMax), + }; + + case ParticleSystemCurveMode.TwoConstants: + return new VGO_PS_MinMaxCurve() + { + mode = ParticleSystemCurveMode.TwoConstants, + constantMin = minMaxCurve.constantMin, + constantMax = minMaxCurve.constantMax, + }; + + default: + return null; + } + } + + /// + /// Create MinMaxCurve from VGO_PS_MinMaxCurve. + /// + /// + /// + public static MinMaxCurve CreateMinMaxCurve(VGO_PS_MinMaxCurve vgoMinMaxCurve) + { + if (vgoMinMaxCurve == null) + { + return default; + } + + switch (vgoMinMaxCurve.mode) + { + case ParticleSystemCurveMode.Constant: + return new MinMaxCurve(constant: vgoMinMaxCurve.constant); + + case ParticleSystemCurveMode.Curve: + return new MinMaxCurve( + multiplier: vgoMinMaxCurve.curveMultiplier, + curve: VgoAnimationCurveConverter.CreateAnimationCurve(vgoMinMaxCurve.curve) + ); + + case ParticleSystemCurveMode.TwoCurves: + return new MinMaxCurve( + multiplier: vgoMinMaxCurve.curveMultiplier, + min: VgoAnimationCurveConverter.CreateAnimationCurve(vgoMinMaxCurve.curveMin), + max: VgoAnimationCurveConverter.CreateAnimationCurve(vgoMinMaxCurve.curveMax) + ); + + case ParticleSystemCurveMode.TwoConstants: + return new MinMaxCurve( + min: vgoMinMaxCurve.constantMin, + max: vgoMinMaxCurve.constantMax + ); + + default: + return default; + } + } + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxCurveConverter.cs.meta b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxCurveConverter.cs.meta new file mode 100644 index 0000000..6189ddb --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxCurveConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5897398c86427c4897dc55aea94df7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxGradientConverter.cs b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxGradientConverter.cs new file mode 100644 index 0000000..101f302 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxGradientConverter.cs @@ -0,0 +1,121 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoParticleSystemMinMaxGradientConverter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using UniGLTFforUniVgo; + using UnityEngine; + using static UnityEngine.ParticleSystem; + + /// + /// VGO ParticleSystem MinMaxGradient Converter + /// + public class VgoParticleSystemMinMaxGradientConverter + { + /// + /// Create VGO_PS_MinMaxGradient from MinMaxGradient. + /// + /// + /// + public static VGO_PS_MinMaxGradient CreateFrom(MinMaxGradient minMaxGradient) + { + switch (minMaxGradient.mode) + { + case ParticleSystemGradientMode.Color: + return new VGO_PS_MinMaxGradient() + { + mode = ParticleSystemGradientMode.Color, + color = minMaxGradient.color.linear.ToArray(), + }; + + case ParticleSystemGradientMode.Gradient: + return new VGO_PS_MinMaxGradient() + { + mode = ParticleSystemGradientMode.Gradient, + gradient = VgoGradientConverter.CreateFrom(minMaxGradient.gradient), + }; + + case ParticleSystemGradientMode.TwoColors: + return new VGO_PS_MinMaxGradient() + { + mode = ParticleSystemGradientMode.TwoColors, + colorMin = minMaxGradient.colorMin.linear.ToArray(), + colorMax = minMaxGradient.colorMax.linear.ToArray(), + }; + + case ParticleSystemGradientMode.TwoGradients: + return new VGO_PS_MinMaxGradient() + { + mode = ParticleSystemGradientMode.TwoGradients, + gradientMin = VgoGradientConverter.CreateFrom(minMaxGradient.gradientMin), + gradientMax = VgoGradientConverter.CreateFrom(minMaxGradient.gradientMax), + }; + + case ParticleSystemGradientMode.RandomColor: + // @notice + return new VGO_PS_MinMaxGradient() + { + mode = ParticleSystemGradientMode.RandomColor, + colorMin = minMaxGradient.colorMin.linear.ToArray(), + colorMax = minMaxGradient.colorMax.linear.ToArray(), + gradientMin = VgoGradientConverter.CreateFrom(minMaxGradient.gradientMin), + gradientMax = VgoGradientConverter.CreateFrom(minMaxGradient.gradientMax), + }; + + default: + return default; + } + } + + /// + /// Create MinMaxGradient from VGO_PS_MinMaxGradient. + /// + /// + /// + public static MinMaxGradient CreateMinMaxGradient(VGO_PS_MinMaxGradient vgoMinMaxGradient) + { + if (vgoMinMaxGradient == null) + { + return default; + } + + switch (vgoMinMaxGradient.mode) + { + case ParticleSystemGradientMode.Color: + return new MinMaxGradient(color: ArrayConverter.ToColor(vgoMinMaxGradient.color, gamma: true)); + + case ParticleSystemGradientMode.Gradient: + return new MinMaxGradient(gradient: VgoGradientConverter.CreateGradient(vgoMinMaxGradient.gradient)); + + case ParticleSystemGradientMode.TwoColors: + return new MinMaxGradient( + min: ArrayConverter.ToColor(vgoMinMaxGradient.colorMin, gamma: true), + max: ArrayConverter.ToColor(vgoMinMaxGradient.colorMax, gamma: true) + ); + + case ParticleSystemGradientMode.TwoGradients: + return new MinMaxGradient( + min: VgoGradientConverter.CreateGradient(vgoMinMaxGradient.gradientMin), + max: VgoGradientConverter.CreateGradient(vgoMinMaxGradient.gradientMax) + ); + + case ParticleSystemGradientMode.RandomColor: + // @notice + //var minMaxGradient = new MinMaxGradient( + // min: VgoGradientConverter.CreateGradient(vgoMinMaxGradient.GradientMin), + // max: VgoGradientConverter.CreateGradient(vgoMinMaxGradient.GradientMax) + //); + var minMaxGradient = new MinMaxGradient( + min: ArrayConverter.ToColor(vgoMinMaxGradient.colorMin, gamma: true), + max: ArrayConverter.ToColor(vgoMinMaxGradient.colorMax, gamma: true) + ); + minMaxGradient.mode = ParticleSystemGradientMode.RandomColor; + return minMaxGradient; + + default: + return default; + } + } + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxGradientConverter.cs.meta b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxGradientConverter.cs.meta new file mode 100644 index 0000000..14210f9 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoParticleSystemMinMaxGradientConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5441888e313f0d64a8cf2bad63647ecf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/Converters/VgoTransformConverter.cs b/UniVgo/Runtime/Converters/VgoTransformConverter.cs new file mode 100644 index 0000000..1c8de72 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoTransformConverter.cs @@ -0,0 +1,60 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoTransformConverter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using UniGLTFforUniVgo; + using UnityEngine; + + /// + /// VGO Gradient Converter + /// + public class VgoTransformConverter + { + /// + /// Create VGO_Transform from Transform. + /// + /// + /// + public static VGO_Transform CreateFrom(Transform transform) + { + if (transform == null) + { + return default; + } + + var vgoTransform = new VGO_Transform() + { + position = transform.localPosition.ReverseZ().ToArray(), + rotation = transform.localRotation.ReverseZ().ToArray(), + scale = transform.localScale.ToArray(), + }; + + return vgoTransform; + } + + /// + /// Create Transform from VGO_Transform. + /// + /// + /// + /// + public static void SetComponentValue(Transform transform, VGO_Transform vgoTransform) + { + if (transform == null) + { + return; // @notice + } + + if (vgoTransform == null) + { + return; + } + + transform.localPosition = ArrayConverter.ToVector3(vgoTransform.position, reverseZ: true); + transform.localRotation = ArrayConverter.ToQuaternion(vgoTransform.rotation, reverseZ: true); + transform.localScale = ArrayConverter.ToVector3(vgoTransform.scale); + } + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/Converters/VgoTransformConverter.cs.meta b/UniVgo/Runtime/Converters/VgoTransformConverter.cs.meta new file mode 100644 index 0000000..5229750 --- /dev/null +++ b/UniVgo/Runtime/Converters/VgoTransformConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b92e520031c7fa64da244ee0fe3f8642 +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 d129374..97227ab 100644 --- a/UniVgo/Runtime/IO/VgoExporter.cs +++ b/UniVgo/Runtime/IO/VgoExporter.cs @@ -24,6 +24,7 @@ protected override IEnumerable ExtensionUsed glTF_VGO.ExtensionName, VGO_nodes.ExtensionName, VGO_materials.ExtensionName, + VGO_materials_particle.ExtensionName, KHR_materials_unlit.ExtensionName, VRMC_materials_mtoon.ExtensionName, }; @@ -37,6 +38,7 @@ protected override IEnumerable ExtensionsRequired glTF_VGO.ExtensionName, VGO_nodes.ExtensionName, VGO_materials.ExtensionName, + VGO_materials_particle.ExtensionName, KHR_materials_unlit.ExtensionName, VRMC_materials_mtoon.ExtensionName, }; @@ -44,6 +46,13 @@ protected override IEnumerable ExtensionsRequired #endregion + #region Properties + + /// VGO ParticleSystem exporter. + public virtual VgoParticleSystemExporter VgoParticleSystemExporter { get; protected set; } + + #endregion + #region Constructors /// @@ -52,6 +61,7 @@ protected override IEnumerable ExtensionsRequired /// public VgoExporter(glTF gltf) : base(gltf) { + VgoParticleSystemExporter = new VgoParticleSystemExporter(); } #endregion @@ -173,6 +183,15 @@ protected virtual void SetGltfNodeExtensions(glTFNode gltfNode, GameObject srcNo existsData = true; } + // vgo.particleSystem + if (srcNode.TryGetComponentEx(out ParticleSystem particleSystem) && + srcNode.TryGetComponentEx(out ParticleSystemRenderer particleSystemRenderer)) + { + nodeVgo.particleSystem = VgoParticleSystemExporter.Create(particleSystem, particleSystemRenderer, glTF); + + existsData = true; + } + // vgo.right if (srcNode.TryGetComponentEx(out VgoRight vgoRight)) { diff --git a/UniVgo/Runtime/IO/VgoImporter.cs b/UniVgo/Runtime/IO/VgoImporter.cs index a800836..a1c0185 100644 --- a/UniVgo/Runtime/IO/VgoImporter.cs +++ b/UniVgo/Runtime/IO/VgoImporter.cs @@ -12,6 +12,13 @@ namespace UniVgo /// public class VgoImporter : ImporterContext { + #region Properties + + /// VGO ParticleSystem importer. + public virtual VgoParticleSystemImporter VgoParticleSystemImporter { get; protected set; } + + #endregion + #region Constructors /// @@ -20,6 +27,7 @@ public class VgoImporter : ImporterContext public VgoImporter() { SetMaterialImporter(new VgoMaterialImporter(this)); + VgoParticleSystemImporter = new VgoParticleSystemImporter(); } #endregion @@ -105,6 +113,12 @@ protected virtual void SetupChildComponent(GameObject go, glTFNode gltfNode) go.AddComponent(nodeVGO.light); } + // ParticleSystem + if (nodeVGO.particleSystem != null) + { + VgoParticleSystemImporter.AddComponent(go, nodeVGO.particleSystem, GetMaterials(), GetTextures()); + } + // VgoRight if (nodeVGO.right != null) { diff --git a/UniVgo/Runtime/IO/VgoMaterialExporter.cs b/UniVgo/Runtime/IO/VgoMaterialExporter.cs index 9859b0b..cc8756f 100644 --- a/UniVgo/Runtime/IO/VgoMaterialExporter.cs +++ b/UniVgo/Runtime/IO/VgoMaterialExporter.cs @@ -7,6 +7,7 @@ namespace UniVgo using MToon; using UniGLTFforUniVgo; using UnityEngine; + using UniStandardParticle; /// /// VGO Material Exporter @@ -23,12 +24,18 @@ public class VgoMaterialExporter : MaterialExporter /// public override glTFMaterial ExportMaterial(Material m, TextureExportManager textureManager) { - if (m.shader.name == ShaderName.VRM_MToon) + switch (m.shader.name) { - return CreateVrmMtoonMaterial(m, textureManager); - } + case ShaderName.Particles_Standard_Surface: + case ShaderName.Particles_Standard_Unlit: + return CreateParticleMaterial(m, textureManager); - return base.ExportMaterial(m, textureManager); + case ShaderName.VRM_MToon: + return CreateVrmMtoonMaterial(m, textureManager); + + default: + return base.ExportMaterial(m, textureManager); + } } #endregion @@ -61,6 +68,169 @@ protected override glTFMaterial CreateMaterial(Material m) } } + /// + /// Create a Particle material. + /// + /// + /// + /// + protected virtual glTFMaterial CreateParticleMaterial(Material m, TextureExportManager textureManager) + { + ParticleDefinition particleDefinition = UniStandardParticle.Utils.GetParticleParametersFromMaterial(m); + + var vgoParticle = new VGO_materials_particle() + { + renderMode = (ParticleBlendMode)particleDefinition.RenderMode, + colorMode = (ParticleColorMode)particleDefinition.ColorMode, + flipBookMode = (ParticleFlipBookMode)particleDefinition.FlipBookMode, + cullMode = particleDefinition.CullMode, + softParticlesEnabled = particleDefinition.SoftParticlesEnabled, + softParticleFadeParams = particleDefinition.SoftParticleFadeParams.ToArray(), + cameraFadingEnabled = particleDefinition.CameraFadingEnabled, + cameraFadeParams = particleDefinition.CameraFadeParams.ToArray(), + distortionEnabled = particleDefinition.DistortionEnabled, + grabTextureIndex = -1, + distortionStrengthScaled = particleDefinition.DistortionStrengthScaled, + distortionBlend = particleDefinition.DistortionBlend, + colorAddSubDiff = particleDefinition.ColorAddSubDiff.linear.ToArray(), + mainTexIndex = -1, + mainTexSt = particleDefinition.MainTexSt.ToArray(), + color = particleDefinition.Color.linear.ToArray(), + cutoff = particleDefinition.Cutoff, + metallicGlossMapIndex = -1, + metallic = particleDefinition.Metallic, + glossiness = particleDefinition.Glossiness, + bumpMapIndex = -1, + bumpScale = particleDefinition.BumpScale, + lightingEnabled = particleDefinition.LightingEnabled, + emissionEnabled = particleDefinition.EmissionEnabled, + emissionColor = particleDefinition.EmissionColor.linear.ToArray(), + emissionMapIndex = -1, + }; + + // Textures + vgoParticle.grabTextureIndex = textureManager.CopyAndGetIndex(particleDefinition.GrabTexture, RenderTextureReadWrite.sRGB); + vgoParticle.mainTexIndex = textureManager.CopyAndGetIndex(particleDefinition.MainTex, RenderTextureReadWrite.sRGB); + vgoParticle.metallicGlossMapIndex = textureManager.CopyAndGetIndex(particleDefinition.MetallicGlossMap, RenderTextureReadWrite.sRGB); + vgoParticle.bumpMapIndex = textureManager.ConvertAndGetIndex(particleDefinition.BumpMap, new NormalConverter()); + vgoParticle.emissionMapIndex = textureManager.CopyAndGetIndex(particleDefinition.EmissionMap, RenderTextureReadWrite.sRGB); + + var material = new glTFMaterial(); + + material.name = m.name; + + // Alpha Mode + switch (vgoParticle.renderMode) + { + case ParticleBlendMode.Opaque: + material.alphaMode = glTFBlendMode.OPAQUE.ToString(); + break; + + case ParticleBlendMode.Cutout: + material.alphaMode = glTFBlendMode.MASK.ToString(); + break; + + case ParticleBlendMode.Fade: + case ParticleBlendMode.Transparent: + case ParticleBlendMode.Additive: + case ParticleBlendMode.Subtractive: + case ParticleBlendMode.Modulate: + material.alphaMode = glTFBlendMode.BLEND.ToString(); + break; + + default: + break; + } + + // Alpha Cutoff + if (vgoParticle.renderMode == ParticleBlendMode.Cutout) + { + material.alphaCutoff = vgoParticle.cutoff; + } + + // Double Sided + switch (vgoParticle.cullMode) + { + case UnityEngine.Rendering.CullMode.Off: + material.doubleSided = true; + break; + + case UnityEngine.Rendering.CullMode.Front: + case UnityEngine.Rendering.CullMode.Back: + material.doubleSided = false; + break; + + default: + break; + } + + // PBR Metallic Roughness + { + if (vgoParticle.color != null) + { + if (material.pbrMetallicRoughness == null) + { + material.pbrMetallicRoughness = new glTFPbrMetallicRoughness(); + } + + material.pbrMetallicRoughness.baseColorFactor = vgoParticle.color; + } + + if (vgoParticle.mainTexIndex != -1) + { + if (material.pbrMetallicRoughness == null) + { + material.pbrMetallicRoughness = new glTFPbrMetallicRoughness(); + } + + material.pbrMetallicRoughness.baseColorTexture = new glTFMaterialBaseColorTextureInfo() + { + index = vgoParticle.mainTexIndex, + }; + + //material.pbrMetallicRoughness.metallicFactor = 1.0f; + //material.pbrMetallicRoughness.roughnessFactor = 1.0f; + } + } + + // Normal Texture + if (vgoParticle.bumpMapIndex != -1) + { + material.normalTexture = new glTFMaterialNormalTextureInfo() + { + index = vgoParticle.bumpMapIndex, + }; + } + + // Emissive + if (vgoParticle.emissionEnabled) + { + material.emissiveFactor = vgoParticle.emissionColor; + + if (vgoParticle.emissionMapIndex != -1) + { + material.emissiveTexture = new glTFMaterialEmissiveTextureInfo() + { + index = vgoParticle.emissionMapIndex, + }; + } + } + + // extensions + material.extensions = new glTFMaterial_extensions() + { + VGO_materials = new VGO_materials(m.shader.name), + VGO_materials_particle = vgoParticle, + }; + + if (m.shader.name == ShaderName.Particles_Standard_Unlit) + { + material.extensions.KHR_materials_unlit = new KHR_materials_unlit(); + } + + return material; + } + /// /// Create a VRM default material. /// diff --git a/UniVgo/Runtime/IO/VgoMaterialImporter.cs b/UniVgo/Runtime/IO/VgoMaterialImporter.cs index 78e2e24..09950b4 100644 --- a/UniVgo/Runtime/IO/VgoMaterialImporter.cs +++ b/UniVgo/Runtime/IO/VgoMaterialImporter.cs @@ -5,9 +5,11 @@ namespace UniVgo { using MToon; + using System.Collections.Generic; using UniGLTFforUniVgo; using UnityEngine; using UnityEngine.Rendering; + using UniStandardParticle; /// /// VGO Material Importer @@ -39,6 +41,10 @@ public override Material CreateMaterial(int i, glTFMaterial src, bool hasVertexC { if (src.extensions != null) { + if (src.extensions.VGO_materials_particle != null) + { + return CreateParticleMaterial(i, src); + } if (src.extensions.KHR_materials_unlit != null) { return CreateUnlitMaterial(i, src, hasVertexColor); @@ -56,6 +62,71 @@ public override Material CreateMaterial(int i, glTFMaterial src, bool hasVertexC #region Protected Methods + /// + /// Create a Particle material. + /// + /// + /// + /// + protected virtual Material CreateParticleMaterial(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 + + ParticleDefinition particleDefinition = CreateParticleDefinition(src.extensions.VGO_materials_particle); + + UniStandardParticle.Utils.SetParticleParametersToMaterial(material, particleDefinition); + + return material; + } + + /// + /// Create a Particle definition. + /// + /// + /// + protected virtual ParticleDefinition CreateParticleDefinition(VGO_materials_particle vgoParticle) + { + ParticleDefinition particleDefinition = new ParticleDefinition() + { + RenderMode = (UniStandardParticle.BlendMode)vgoParticle.renderMode, + ColorMode = (UniStandardParticle.ColorMode)vgoParticle.colorMode, + FlipBookMode = (UniStandardParticle.FlipBookMode)vgoParticle.flipBookMode, + CullMode = vgoParticle.cullMode, + SoftParticlesEnabled = vgoParticle.softParticlesEnabled, + SoftParticleFadeParams = ArrayConverter.ToVector4(vgoParticle.softParticleFadeParams), + CameraFadingEnabled = vgoParticle.cameraFadingEnabled, + CameraFadeParams = ArrayConverter.ToVector4(vgoParticle.cameraFadeParams), + DistortionEnabled = vgoParticle.distortionEnabled, + GrabTexture = GetTexture(UniStandardParticle.Utils.PropGrabTexture, vgoParticle.grabTextureIndex), + DistortionStrengthScaled = vgoParticle.distortionStrengthScaled, + DistortionBlend = vgoParticle.distortionBlend, + ColorAddSubDiff = ArrayConverter.ToColor(vgoParticle.colorAddSubDiff, gamma: true), + MainTex = GetTexture(UniStandardParticle.Utils.PropMainTex, vgoParticle.mainTexIndex), + MainTexSt = ArrayConverter.ToVector4(vgoParticle.mainTexSt), + Color = ArrayConverter.ToColor(vgoParticle.color, gamma: true), + Cutoff = vgoParticle.cutoff, + MetallicGlossMap = GetTexture(UniStandardParticle.Utils.PropMetallicGlossMap, vgoParticle.metallicGlossMapIndex), + Metallic = vgoParticle.metallic, + Glossiness = vgoParticle.glossiness, + BumpMap = GetTexture(UniStandardParticle.Utils.PropBumpMap, vgoParticle.bumpMapIndex), + BumpScale = vgoParticle.bumpScale, + LightingEnabled = vgoParticle.lightingEnabled, + EmissionEnabled = vgoParticle.emissionEnabled, + EmissionColor = ArrayConverter.ToColor(vgoParticle.emissionColor, gamma: true), + EmissionMap = GetTexture(UniStandardParticle.Utils.PropEmissionMap, vgoParticle.emissionMapIndex), + }; + + return particleDefinition; + } + /// /// Create a Unlit material. /// diff --git a/UniVgo/Runtime/IO/VgoParticleSystemExporter.cs b/UniVgo/Runtime/IO/VgoParticleSystemExporter.cs new file mode 100644 index 0000000..5e461fa --- /dev/null +++ b/UniVgo/Runtime/IO/VgoParticleSystemExporter.cs @@ -0,0 +1,783 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoParticleSystemExporter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using System; + using System.Linq; + using UniGLTFforUniVgo; + using UnityEngine; + using static UnityEngine.ParticleSystem; + + /// + /// VGO Particle System Exporter + /// + public class VgoParticleSystemExporter + { + #region Public Methods + + /// + /// Create VGO_ParticleSystem. + /// + /// + /// + /// + /// + public virtual VGO_ParticleSystem Create(ParticleSystem particleSystem, ParticleSystemRenderer particleSystemRenderer, glTF gltf) + { + if (particleSystem == null) + { + return null; + } + + var vgoParticleSystem = new VGO_ParticleSystem() + { + main = CreateVgoModule(particleSystem.main), + emission = CreateVgoModule(particleSystem.emission), + shape = CreateVgoModule(particleSystem.shape, gltf), + velocityOverLifetime = CreateVgoModule(particleSystem.velocityOverLifetime), + limitVelocityOverLifetime = CreateVgoModule(particleSystem.limitVelocityOverLifetime), + inheritVelocity = CreateVgoModule(particleSystem.inheritVelocity), + forceOverLifetime = CreateVgoModule(particleSystem.forceOverLifetime), + colorOverLifetime = CreateVgoModule(particleSystem.colorOverLifetime), + colorBySpeed = CreateVgoModule(particleSystem.colorBySpeed), + sizeOverLifetime = CreateVgoModule(particleSystem.sizeOverLifetime), + sizeBySpeed = CreateVgoModule(particleSystem.sizeBySpeed), + rotationOverLifetime = CreateVgoModule(particleSystem.rotationOverLifetime), + rotationBySpeed = CreateVgoModule(particleSystem.rotationBySpeed), + externalForces = CreateVgoModule(particleSystem.externalForces), + noise = CreateVgoModule(particleSystem.noise), + //Collision = CreateVgoModule(particleSystem.collision), + //Trigger = CreateVgoModule(particleSystem.trigger), + //SubEmitters = CreateVgoModule(particleSystem.subEmitters), + //TextureSheetAnimation = CreateVgoModule(particleSystem.textureSheetAnimation), + lights = CreateVgoModule(particleSystem.lights), + trails = CreateVgoModule(particleSystem.trails), + //CustomData = CreateVgoModule(particleSystem.customData), + renderer = CreateVgoPsRenderer(particleSystemRenderer, gltf), + }; + + return vgoParticleSystem; + } + + #endregion + + #region Protected Methods (Module) + + /// + /// Create VGO_PS_MainModule from MainModule. + /// + /// + /// + protected virtual VGO_PS_MainModule CreateVgoModule(MainModule module) + { + var vgoModule = new VGO_PS_MainModule() + { + duration = module.duration, + loop = module.loop, + prewarm = module.prewarm, + startDelay = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startDelay), + startDelayMultiplier = module.startDelayMultiplier, + startLifetime = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startLifetime), + startLifetimeMultiplier = module.startLifetimeMultiplier, + startSpeed = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startSpeed), + startSpeedMultiplier = module.startSpeedMultiplier, + startSize3D = module.startSize3D, + startRotation3D = module.startRotation3D, + flipRotation = module.flipRotation, + startColor = VgoParticleSystemMinMaxGradientConverter.CreateFrom(module.startColor), + gravityModifier = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.gravityModifier), + gravityModifierMultiplier = module.gravityModifierMultiplier, + simulationSpace = module.simulationSpace, + simulationSpeed = module.simulationSpeed, + customSimulationSpace = VgoTransformConverter.CreateFrom(module.customSimulationSpace), + useUnscaledTime = module.useUnscaledTime, + scalingMode = module.scalingMode, + playOnAwake = module.playOnAwake, + emitterVelocityMode = module.emitterVelocityMode, + maxParticles = module.maxParticles, + stopAction = module.stopAction, + cullingMode = module.cullingMode, + ringBufferMode = module.ringBufferMode, + }; + + if (module.startSize3D) + { + vgoModule.startSizeX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startSizeX); + vgoModule.startSizeY = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startSizeY); + vgoModule.startSizeZ = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startSizeZ); + vgoModule.startSizeXMultiplier = module.startSizeXMultiplier; + vgoModule.startSizeYMultiplier = module.startSizeYMultiplier; + vgoModule.startSizeZMultiplier = module.startSizeZMultiplier; + } + else + { + vgoModule.startSize = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startSize); + vgoModule.startSizeMultiplier = module.startSizeMultiplier; + } + + if (module.startRotation3D) + { + vgoModule.startRotationX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startRotationX); + vgoModule.startRotationY = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startRotationY); + vgoModule.startRotationZ = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startRotationZ); + vgoModule.StartRotationXMultiplier = module.startRotationXMultiplier; + vgoModule.StartRotationYMultiplier = module.startRotationYMultiplier; + vgoModule.StartRotationZMultiplier = module.startRotationZMultiplier; + } + else + { + vgoModule.startRotation = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.startRotation); + vgoModule.StartRotationMultiplier = module.startRotationMultiplier; + } + + if (module.ringBufferMode == ParticleSystemRingBufferMode.LoopUntilReplaced) + { + vgoModule.ringBufferLoopRange = module.ringBufferLoopRange.ToArray(); + } + + return vgoModule; + } + + /// + /// Create VGO_PS_EmissionModule from EmissionModule. + /// + /// + /// + protected virtual VGO_PS_EmissionModule CreateVgoModule(EmissionModule module) + { + var vgoModule = new VGO_PS_EmissionModule() + { + enabled = module.enabled, + rateOverTime = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.rateOverTime), + rateOverTimeMultiplier = module.rateOverTimeMultiplier, + rateOverDistance = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.rateOverDistance), + rateOverDistanceMultiplier = module.rateOverDistanceMultiplier, + //BurstCount = module.burstCount, + }; + + if (module.burstCount > 0) + { + Burst[] bursts = new Burst[module.burstCount]; + + module.GetBursts(bursts); + + if ((bursts != null) && bursts.Any()) + { + vgoModule.bursts = new VGO_PS_Burst[bursts.Length]; + + for (int idx = 0; idx < bursts.Length; idx++) + { + vgoModule.bursts[idx] = VgoParticleSystemBurstConverter.CreateFrom(bursts[idx]); + } + } + } + + return vgoModule; + } + + /// + /// Create VGO_PS_ShapeModule from ShapeModule. + /// + /// + /// + /// + /// + /// @notice TextureIO.ExportTexture() may export the same texture multiple times. + /// + protected virtual VGO_PS_ShapeModule CreateVgoModule(ShapeModule module, glTF gltf) + { + var vgoShapeModule = new VGO_PS_ShapeModule() + { + enabled = module.enabled, + shapeType = module.shapeType, + angle = module.angle, + radius = module.radius, + donutRadius = module.donutRadius, + radiusMode = module.radiusMode, + radiusSpread = module.radiusSpread, + radiusSpeed = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.radiusSpeed), + radiusSpeedMultiplier = module.radiusSpeedMultiplier, + radiusThickness = module.radiusThickness, + boxThickness = module.boxThickness.ReverseZ().ToArray(), + arc = module.arc, + arcMode = module.arcMode, + arcSpread = module.arcSpread, + arcSpeed = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.arcSpeed), + arcSpeedMultiplier = module.arcSpeedMultiplier, + length = module.length, + meshShapeType = module.meshShapeType, + meshSpawnMode = module.meshSpawnMode, + meshSpawnSpread = module.meshSpawnSpread, + meshSpawnSpeed = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.meshSpawnSpread), + meshSpawnSpeedMultiplier = module.meshSpawnSpeedMultiplier, + //mesh + //meshRenderer + //skinnedMeshRenderer + useMeshMaterialIndex = module.useMeshMaterialIndex, + meshMaterialIndex = module.meshMaterialIndex, + useMeshColors = module.useMeshColors, + //sprite + //spriteRenderer + normalOffset = module.normalOffset, + textureIndex = -1, + textureClipChannel = module.textureClipChannel, + textureClipThreshold = module.textureClipThreshold, + textureColorAffectsParticles = module.textureColorAffectsParticles, + textureAlphaAffectsParticles = module.textureAlphaAffectsParticles, + textureBilinearFiltering = module.textureBilinearFiltering, + textureUVChannel = module.textureUVChannel, + position = module.position.ReverseZ().ToArray(), + rotation = module.rotation.ReverseZ().ToArray(), + scale = module.scale.ToArray(), + alignToDirection = module.alignToDirection, + randomPositionAmount = module.randomPositionAmount, + sphericalDirectionAmount = module.sphericalDirectionAmount, + randomDirectionAmount = module.randomDirectionAmount, + }; + + if (module.texture != null) + { + vgoShapeModule.textureIndex = TextureIO.ExportTexture(gltf, gltf.buffers.Count - 1, module.texture, glTFTextureTypes.Unknown); + } + + return vgoShapeModule; + } + + /// + /// Create VGO_PS_VelocityOverLifetimeModule from VelocityOverLifetimeModule. + /// + /// + /// + protected virtual VGO_PS_VelocityOverLifetimeModule CreateVgoModule(VelocityOverLifetimeModule module) + { + return new VGO_PS_VelocityOverLifetimeModule() + { + enabled = module.enabled, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + y = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.y), + z = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.z), + xMultiplier = module.xMultiplier, + yMultiplier = module.yMultiplier, + zMultiplier = module.zMultiplier, + space = module.space, + orbitalX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.orbitalX), + orbitalY = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.orbitalY), + orbitalZ = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.orbitalZ), + orbitalXMultiplier = module.orbitalXMultiplier, + orbitalYMultiplier = module.orbitalYMultiplier, + orbitalZMultiplier = module.orbitalZMultiplier, + orbitalOffsetX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.orbitalOffsetX), + orbitalOffsetY = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.orbitalOffsetY), + orbitalOffsetZ = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.orbitalOffsetZ), + orbitalOffsetXMultiplier = module.orbitalOffsetXMultiplier, + orbitalOffsetYMultiplier = module.orbitalOffsetYMultiplier, + orbitalOffsetZMultiplier = module.orbitalOffsetZMultiplier, + radial = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.radial), + radialMultiplier = module.radialMultiplier, + speedModifier = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.speedModifier), + speedModifierMultiplier = module.speedModifierMultiplier, + }; + } + + /// + /// Create VGO_PS_VelocityOverLifetimeModule from VelocityOverLifetimeModule. + /// + /// + /// + protected virtual VGO_PS_LimitVelocityOverLifetimeModule CreateVgoModule(LimitVelocityOverLifetimeModule module) + { + var vgoModule = new VGO_PS_LimitVelocityOverLifetimeModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + space = module.space, + dampen = module.dampen, + drag = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.drag), + dragMultiplier = module.dragMultiplier, + multiplyDragByParticleSize = module.multiplyDragByParticleSize, + multiplyDragByParticleVelocity = module.multiplyDragByParticleVelocity, + }; + + if (module.separateAxes) + { + vgoModule.limitX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.limitX); + vgoModule.limitY = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.limitY); + vgoModule.limitZ = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.limitZ); + vgoModule.limitXMultiplier = module.limitXMultiplier; + vgoModule.limitYMultiplier = module.limitYMultiplier; + vgoModule.limitZMultiplier = module.limitZMultiplier; + } + else + { + vgoModule.limitX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.limit); + vgoModule.limitXMultiplier = module.limitMultiplier; + } + + return vgoModule; + } + + /// + /// Create VGO_PS_InheritVelocityModule from InheritVelocityModule. + /// + /// + /// + protected virtual VGO_PS_InheritVelocityModule CreateVgoModule(InheritVelocityModule module) + { + return new VGO_PS_InheritVelocityModule() + { + enabled = module.enabled, + mode = module.mode, + curve = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.curve), + curveMultiplier = module.curveMultiplier, + }; + } + + /// + /// Create VGO_PS_ForceOverLifetimeModule from ForceOverLifetimeModule. + /// + /// + /// + protected virtual VGO_PS_ForceOverLifetimeModule CreateVgoModule(ForceOverLifetimeModule module) + { + return new VGO_PS_ForceOverLifetimeModule() + { + enabled = module.enabled, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + y = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.y), + z = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.z), + xMultiplier = module.xMultiplier, + yMultiplier = module.yMultiplier, + zMultiplier = module.zMultiplier, + space = module.space, + randomized = module.randomized, + }; + } + + /// + /// Create VGO_PS_ColorOverLifetimeModule from ColorOverLifetimeModule. + /// + /// + /// + protected virtual VGO_PS_ColorOverLifetimeModule CreateVgoModule(ColorOverLifetimeModule module) + { + return new VGO_PS_ColorOverLifetimeModule() + { + enabled = module.enabled, + color = VgoParticleSystemMinMaxGradientConverter.CreateFrom(module.color), + }; + } + + /// + /// Create VGO_PS_ColorBySpeedModule from ColorBySpeedModule. + /// + /// + /// + protected virtual VGO_PS_ColorBySpeedModule CreateVgoModule(ColorBySpeedModule module) + { + return new VGO_PS_ColorBySpeedModule() + { + enabled = module.enabled, + color = VgoParticleSystemMinMaxGradientConverter.CreateFrom(module.color), + range = module.range.ToArray(), + }; + } + + /// + /// Create VGO_PS_SizeOverLifetimeModule from SizeOverLifetimeModule. + /// + /// + /// + protected virtual VGO_PS_SizeOverLifetimeModule CreateVgoModule(SizeOverLifetimeModule module) + { + if (module.separateAxes) + { + return new VGO_PS_SizeOverLifetimeModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + y = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.y), + z = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.z), + xMultiplier = module.xMultiplier, + yMultiplier = module.yMultiplier, + zMultiplier = module.zMultiplier, + }; + } + else + { + return new VGO_PS_SizeOverLifetimeModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.size), + xMultiplier = module.sizeMultiplier, + }; + } + } + + /// + /// Create VGO_PS_SizeBySpeedModule from SizeBySpeedModule. + /// + /// + /// + protected virtual VGO_PS_SizeBySpeedModule CreateVgoModule(SizeBySpeedModule module) + { + if (module.separateAxes) + { + return new VGO_PS_SizeBySpeedModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + y = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.y), + z = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.z), + xMultiplier = module.xMultiplier, + yMultiplier = module.yMultiplier, + zMultiplier = module.zMultiplier, + range = module.range.ToArray(), + }; + } + else + { + return new VGO_PS_SizeBySpeedModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.size), + xMultiplier = module.sizeMultiplier, + range = module.range.ToArray(), + }; + } + } + + /// + /// Create VGO_PS_RotationOverLifetimeModule from RotationOverLifetimeModule. + /// + /// + /// + protected virtual VGO_PS_RotationOverLifetimeModule CreateVgoModule(RotationOverLifetimeModule module) + { + if (module.separateAxes) + { + return new VGO_PS_RotationOverLifetimeModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + y = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.y), + z = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.z), + xMultiplier = module.xMultiplier, + yMultiplier = module.yMultiplier, + zMultiplier = module.zMultiplier, + }; + } + else + { + return new VGO_PS_RotationOverLifetimeModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + xMultiplier = module.xMultiplier, + }; + } + } + + /// + /// Create VGO_PS_RotationBySpeedModule from RotationBySpeedModule. + /// + /// + /// + protected virtual VGO_PS_RotationBySpeedModule CreateVgoModule(RotationBySpeedModule module) + { + if (module.separateAxes) + { + return new VGO_PS_RotationBySpeedModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + y = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.y), + z = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.z), + xMultiplier = module.xMultiplier, + yMultiplier = module.yMultiplier, + zMultiplier = module.zMultiplier, + range = module.range.ToArray(), + }; + } + else + { + return new VGO_PS_RotationBySpeedModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + x = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.x), + xMultiplier = module.xMultiplier, + range = module.range.ToArray(), + }; + } + } + + /// + /// Create VGO_PS_ExternalForcesModule from ExternalForcesModule. + /// + /// + /// + protected virtual VGO_PS_ExternalForcesModule CreateVgoModule(ExternalForcesModule module) + { + return new VGO_PS_ExternalForcesModule() + { + enabled = module.enabled, + multiplierCurve = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.multiplierCurve), + multiplier = module.multiplier, + influenceFilter = module.influenceFilter, + influenceMask = module.influenceMask.value, + }; + } + + /// + /// Create VGO_PS_NoiseModule from NoiseModule. + /// + /// + /// + protected virtual VGO_PS_NoiseModule CreateVgoModule(NoiseModule module) + { + var vgoModule = new VGO_PS_NoiseModule() + { + enabled = module.enabled, + separateAxes = module.separateAxes, + frequency = module.frequency, + scrollSpeed = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.scrollSpeed), + scrollSpeedMultiplier = module.scrollSpeedMultiplier, + damping = module.damping, + octaveCount = module.octaveCount, + octaveMultiplier = module.octaveMultiplier, + octaveScale = module.octaveScale, + quality = module.quality, + remapEnabled = module.remapEnabled, + positionAmount = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.positionAmount), + rotationAmount = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.rotationAmount), + sizeAmount = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.sizeAmount), + }; + + if (module.separateAxes) + { + vgoModule.strengthX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.strengthX); + vgoModule.strengthY = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.strengthY); + vgoModule.strengthZ = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.strengthZ); + vgoModule.strengthXMultiplier = module.strengthXMultiplier; + vgoModule.strengthYMultiplier = module.strengthYMultiplier; + vgoModule.strengthZMultiplier = module.strengthZMultiplier; + + if (module.remapEnabled) + { + vgoModule.remapX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.remapX); + vgoModule.remapY = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.remapY); + vgoModule.remapZ = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.remapZ); + vgoModule.remapXMultiplier = module.remapXMultiplier; + vgoModule.remapYMultiplier = module.remapYMultiplier; + vgoModule.remapZMultiplier = module.remapZMultiplier; + } + } + else + { + vgoModule.strengthX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.strengthX); + vgoModule.strengthXMultiplier = module.strengthXMultiplier; + + if (module.remapEnabled) + { + vgoModule.remapX = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.remapX); + vgoModule.remapXMultiplier = module.remapXMultiplier; + } + } + + return vgoModule; + } + + /// + /// Create VGO_PS_LightsModule from LightsModule. + /// + /// + /// + protected virtual VGO_PS_LightsModule CreateVgoModule(LightsModule module) + { + return new VGO_PS_LightsModule() + { + enabled = module.enabled, + ratio = module.ratio, + useRandomDistribution = module.useRandomDistribution, + light = VgoLightConverter.CreateFrom(module.light), + useParticleColor = module.useParticleColor, + sizeAffectsRange = module.sizeAffectsRange, + alphaAffectsIntensity = module.alphaAffectsIntensity, + range = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.range), + rangeMultiplier = module.rangeMultiplier, + intensity = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.intensity), + intensityMultiplier = module.intensityMultiplier, + maxLights = module.maxLights, + }; + } + + /// + /// Create VGO_PS_CollisionModule from CollisionModule. + /// + /// + /// + protected virtual VGO_PS_CollisionModule CreateVgoModule(CollisionModule module) + { + throw new NotImplementedException(); + } + + /// + /// Create VGO_PS_TriggerModule from TriggerModule. + /// + /// + /// + protected virtual VGO_PS_TriggerModule CreateVgoModule(TriggerModule module) + { + throw new NotImplementedException(); + } + + /// + /// Create VGO_PS_SubEmittersModule from SubEmittersModule. + /// + /// + /// + protected virtual VGO_PS_SubEmittersModule CreateVgoModule(SubEmittersModule module) + { + throw new NotImplementedException(); + } + + /// + /// Create VGO_PS_TextureSheetAnimationModule from TextureSheetAnimationModule. + /// + /// + /// + protected virtual VGO_PS_TextureSheetAnimationModule CreateVgoModule(TextureSheetAnimationModule module) + { + throw new NotImplementedException(); + } + + /// + /// Create VGO_PS_TrailModule from TrailModule. + /// + /// + /// + protected virtual VGO_PS_TrailModule CreateVgoModule(TrailModule module) + { + return new VGO_PS_TrailModule() + { + enabled = module.enabled, + mode = module.mode, + ratio = module.ratio, + lifetime = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.lifetime), + lifetimeMultiplier = module.lifetimeMultiplier, + minVertexDistance = module.minVertexDistance, + worldSpace = module.worldSpace, + dieWithParticles = module.dieWithParticles, + ribbonCount = module.ribbonCount, + splitSubEmitterRibbons = module.splitSubEmitterRibbons, + attachRibbonsToTransform = module.attachRibbonsToTransform, + textureMode = module.textureMode, + sizeAffectsWidth = module.sizeAffectsWidth, + sizeAffectsLifetime = module.sizeAffectsLifetime, + inheritParticleColor = module.inheritParticleColor, + colorOverLifetime = VgoParticleSystemMinMaxGradientConverter.CreateFrom(module.colorOverLifetime), + widthOverTrail = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.widthOverTrail), + widthOverTrailMultiplier = module.widthOverTrailMultiplier, + colorOverTrail = VgoParticleSystemMinMaxGradientConverter.CreateFrom(module.colorOverTrail), + generateLightingData = module.generateLightingData, + shadowBias = module.shadowBias, + }; + } + + /// + /// Create VGO_PS_CustomDataModule from CustomDataModule. + /// + /// + /// + protected virtual VGO_PS_CustomDataModule CreateVgoModule(CustomDataModule module) + { + throw new NotImplementedException(); + } + + /// + /// Create VGO_PS_Renderer from ParticleSystemRenderer. + /// + /// + /// + /// + protected virtual VGO_PS_Renderer CreateVgoPsRenderer(ParticleSystemRenderer particleSystemRenderer, glTF gltf) + { + return new VGO_PS_Renderer() + { + enabled = particleSystemRenderer.enabled, + renderMode = particleSystemRenderer.renderMode, + cameraVelocityScale = particleSystemRenderer.cameraVelocityScale, + velocityScale = particleSystemRenderer.velocityScale, + lengthScale = particleSystemRenderer.lengthScale, + normalDirection = particleSystemRenderer.normalDirection, + sharedMaterial = GetMaterialIndex(particleSystemRenderer.sharedMaterial, gltf), + trailMaterialIndex = GetMaterialIndex(particleSystemRenderer.trailMaterial, gltf), + sortMode = particleSystemRenderer.sortMode, + sortingFudge = particleSystemRenderer.sortingFudge, + minParticleSize = particleSystemRenderer.minParticleSize, + maxParticleSize = particleSystemRenderer.maxParticleSize, + alignment = particleSystemRenderer.alignment, + flip = particleSystemRenderer.flip.ReverseZ().ToArray(), + allowRoll = particleSystemRenderer.allowRoll, + pivot = particleSystemRenderer.pivot.ReverseZ().ToArray(), + maskInteraction = particleSystemRenderer.maskInteraction, + enableGPUInstancing = particleSystemRenderer.enableGPUInstancing, + shadowCastingMode = particleSystemRenderer.shadowCastingMode, + receiveShadows = particleSystemRenderer.receiveShadows, + shadowBias = particleSystemRenderer.shadowBias, + motionVectorGenerationMode = particleSystemRenderer.motionVectorGenerationMode, + forceRenderingOff = particleSystemRenderer.forceRenderingOff, + rendererPriority = particleSystemRenderer.rendererPriority, + renderingLayerMask = particleSystemRenderer.renderingLayerMask, + sortingLayerID = particleSystemRenderer.sortingLayerID, + sortingOrder = particleSystemRenderer.sortingOrder, + lightProbeUsage = particleSystemRenderer.lightProbeUsage, + reflectionProbeUsage = particleSystemRenderer.reflectionProbeUsage, + probeAnchor = VgoTransformConverter.CreateFrom(particleSystemRenderer.probeAnchor), + }; + } + + #endregion + + #region Protected Methods (Utility) + + /// + /// Get a material index. + /// + /// + /// + /// + protected virtual int GetMaterialIndex(Material material, glTF gltf) + { + if (material == null) + { + return -1; + } + + if (gltf.materials == null) + { + return -1; + } + + var gltfMaterial = gltf.materials.FirstOrDefault(m => m.name.Equals(material.name)); + + if (gltfMaterial == null) + { + return -1; + } + + return gltf.materials.IndexOf(gltfMaterial); + } + + #endregion + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/IO/VgoParticleSystemExporter.cs.meta b/UniVgo/Runtime/IO/VgoParticleSystemExporter.cs.meta new file mode 100644 index 0000000..4eba589 --- /dev/null +++ b/UniVgo/Runtime/IO/VgoParticleSystemExporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7005a554fd2749646b503eb9726f67e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/IO/VgoParticleSystemImporter.cs b/UniVgo/Runtime/IO/VgoParticleSystemImporter.cs new file mode 100644 index 0000000..de8053e --- /dev/null +++ b/UniVgo/Runtime/IO/VgoParticleSystemImporter.cs @@ -0,0 +1,930 @@ +// ---------------------------------------------------------------------- +// @Namespace : UniVgo +// @Class : VgoParticleSystemImporter +// ---------------------------------------------------------------------- +namespace UniVgo +{ + using System; + using System.Collections.Generic; + using System.Linq; + using UniGLTFforUniVgo; + using UnityEngine; + using static UnityEngine.ParticleSystem; + + /// + /// VGO Particle System Importer + /// + public class VgoParticleSystemImporter + { + #region Public Methods + + /// + /// Adds a ParticleSystem component to the game object. + /// + /// + /// + /// + /// + /// Returns ParticleSystem component. + public virtual ParticleSystem AddComponent(GameObject go, VGO_ParticleSystem vgoParticleSystem, IList materialList, IList textureItemList) + { + ParticleSystem particleSystem = go.GetComponent(); + + if (particleSystem == null) + { + particleSystem = go.AddComponent(); + } + + if (vgoParticleSystem != null) + { + SetModuleValue(particleSystem, vgoParticleSystem.main); + SetModuleValue(particleSystem, vgoParticleSystem.emission); + SetModuleValue(particleSystem, vgoParticleSystem.shape, textureItemList); + SetModuleValue(particleSystem, vgoParticleSystem.velocityOverLifetime); + SetModuleValue(particleSystem, vgoParticleSystem.limitVelocityOverLifetime); + SetModuleValue(particleSystem, vgoParticleSystem.inheritVelocity); + SetModuleValue(particleSystem, vgoParticleSystem.forceOverLifetime); + SetModuleValue(particleSystem, vgoParticleSystem.colorOverLifetime); + SetModuleValue(particleSystem, vgoParticleSystem.colorBySpeed); + SetModuleValue(particleSystem, vgoParticleSystem.sizeOverLifetime); + SetModuleValue(particleSystem, vgoParticleSystem.sizeBySpeed); + SetModuleValue(particleSystem, vgoParticleSystem.rotationOverLifetime); + SetModuleValue(particleSystem, vgoParticleSystem.rotationBySpeed); + SetModuleValue(particleSystem, vgoParticleSystem.externalForces); + SetModuleValue(particleSystem, vgoParticleSystem.noise); + //SetModuleValue(particleSystem, vgoParticleSystem.Collision); + //SetModuleValue(particleSystem, vgoParticleSystem.Trigger); + //SetModuleValue(particleSystem, vgoParticleSystem.SubEmitters); + //SetModuleValue(particleSystem, vgoParticleSystem.TextureSheetAnimation); + SetModuleValue(particleSystem, vgoParticleSystem.lights); + SetModuleValue(particleSystem, vgoParticleSystem.trails); + //SetModuleValue(particleSystem, vgoParticleSystem.CustomData); + } + + ParticleSystemRenderer particleSystemRenderer = go.GetComponent(); + + if (particleSystemRenderer == null) + { + particleSystemRenderer = go.AddComponent(); + } + + if (particleSystemRenderer != null) + { + SetComponentValue(particleSystemRenderer, vgoParticleSystem.renderer, materialList); + } + + return particleSystem; + } + + #endregion + + #region Protected Methods (Module) + + /// + /// Set ParticleSystem main field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_MainModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + MainModule module = particleSystem.main; + + // @notice + if (Application.isPlaying == false) + { + module.duration = vgoModule.duration; + } + + module.loop = vgoModule.loop; + module.prewarm = vgoModule.prewarm; + module.startDelay = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startDelay); + module.startDelayMultiplier = vgoModule.startDelayMultiplier; + module.startLifetime = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startLifetime); + module.startLifetimeMultiplier = vgoModule.startLifetimeMultiplier; + module.startSpeed = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startSpeed); + module.startSpeedMultiplier = vgoModule.startSpeedMultiplier; + + module.startSize3D = vgoModule.startSize3D; + + if (vgoModule.startSize3D) + { + module.startSizeX = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startSizeX); + module.startSizeY = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startSizeY); + module.startSizeZ = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startSizeZ); + module.startSizeXMultiplier = vgoModule.startSizeXMultiplier; + module.startSizeYMultiplier = vgoModule.startSizeYMultiplier; + module.startSizeZMultiplier = vgoModule.startSizeZMultiplier; + } + else + { + module.startSize = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startSize); + module.startSizeMultiplier = vgoModule.startSizeMultiplier; + } + + module.startRotation3D = vgoModule.startRotation3D; + + if (vgoModule.startRotation3D) + { + module.startRotationX = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startRotationX); + module.startRotationY = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startRotationY); + module.startRotationZ = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startRotationZ); + module.startRotationXMultiplier = vgoModule.StartRotationXMultiplier; + module.startRotationYMultiplier = vgoModule.StartRotationYMultiplier; + module.startRotationZMultiplier = vgoModule.StartRotationZMultiplier; + } + else + { + module.startRotation = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.startRotation); + module.startRotationMultiplier = vgoModule.StartRotationMultiplier; + } + + module.flipRotation = vgoModule.flipRotation; + module.startColor = VgoParticleSystemMinMaxGradientConverter.CreateMinMaxGradient(vgoModule.startColor); + module.gravityModifier = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.gravityModifier); + module.gravityModifierMultiplier = vgoModule.gravityModifierMultiplier; + + module.simulationSpace = vgoModule.simulationSpace; + module.simulationSpeed = vgoModule.simulationSpeed; + VgoTransformConverter.SetComponentValue(module.customSimulationSpace, vgoModule.customSimulationSpace); + + module.useUnscaledTime = vgoModule.useUnscaledTime; + module.scalingMode = vgoModule.scalingMode; + module.playOnAwake = vgoModule.playOnAwake; + module.emitterVelocityMode = vgoModule.emitterVelocityMode; + module.maxParticles = vgoModule.maxParticles; + module.stopAction = vgoModule.stopAction; + module.cullingMode = vgoModule.cullingMode; + module.ringBufferMode = vgoModule.ringBufferMode; + + if (vgoModule.ringBufferMode == ParticleSystemRingBufferMode.LoopUntilReplaced) + { + module.ringBufferLoopRange = ArrayConverter.ToVector2(vgoModule.ringBufferLoopRange); + } + } + + /// + /// Set ParticleSystem emission field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_EmissionModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + EmissionModule module = particleSystem.emission; + + module.enabled = vgoModule.enabled; + module.rateOverTime = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.rateOverTime); + module.rateOverTimeMultiplier = vgoModule.rateOverTimeMultiplier; + module.rateOverDistance = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.rateOverDistance); + module.rateOverDistanceMultiplier = vgoModule.rateOverDistanceMultiplier; + //module.burstCount = vgoModule.BurstCount; + + if ((vgoModule.bursts != null) && vgoModule.bursts.Any()) + { + module.burstCount = vgoModule.bursts.Length; + + for (int idx = 0; idx < vgoModule.bursts.Length; idx++) + { + module.SetBurst(idx, VgoParticleSystemBurstConverter.CreateBurst(vgoModule.bursts[idx])); + } + } + } + + /// + /// Set ParticleSystem shape field value. + /// + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_ShapeModule vgoModule, IList textureItemList) + { + if (vgoModule == null) + { + return; + } + + ShapeModule module = particleSystem.shape; + + module.enabled = vgoModule.enabled; + module.shapeType = vgoModule.shapeType; + module.angle = vgoModule.angle; + module.radius = vgoModule.radius; + module.donutRadius = vgoModule.donutRadius; + module.radiusMode = vgoModule.radiusMode; + module.radiusSpread = vgoModule.radiusSpread; + module.radiusSpeed = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.radiusSpeed); + module.radiusSpeedMultiplier = vgoModule.radiusSpeedMultiplier; + module.radiusThickness = vgoModule.radiusThickness; + module.boxThickness = ArrayConverter.ToVector3(vgoModule.boxThickness, reverseZ: true); + module.arc = vgoModule.arc; + module.arcMode = vgoModule.arcMode; + module.arcSpread = vgoModule.arcSpread; + module.arcSpeed = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.arcSpeed); + module.arcSpeedMultiplier = vgoModule.arcSpeedMultiplier; + module.length = vgoModule.length; + module.meshShapeType = vgoModule.meshShapeType; + module.meshSpawnMode = vgoModule.meshSpawnMode; + module.meshSpawnSpread = vgoModule.meshSpawnSpread; + module.meshSpawnSpeed = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.meshSpawnSpeed); + module.meshSpawnSpeedMultiplier = vgoModule.meshSpawnSpeedMultiplier; + //module.mesh; + //module.meshRenderer; + //module.skinnedMeshRenderer; + module.useMeshMaterialIndex = vgoModule.useMeshMaterialIndex; + module.meshMaterialIndex = vgoModule.meshMaterialIndex; + module.useMeshColors = vgoModule.useMeshColors; + //module.sprite; + //module.spriteRenderer; + module.normalOffset = vgoModule.normalOffset; + if ((textureItemList != null) && (-1 < vgoModule.textureIndex) && (vgoModule.textureIndex < textureItemList.Count)) + { + module.texture = textureItemList[vgoModule.textureIndex].Texture; + } + module.textureClipChannel = vgoModule.textureClipChannel; + module.textureClipThreshold = vgoModule.textureClipThreshold; + module.textureColorAffectsParticles = vgoModule.textureColorAffectsParticles; + module.textureAlphaAffectsParticles = vgoModule.textureAlphaAffectsParticles; + module.textureBilinearFiltering = vgoModule.textureBilinearFiltering; + module.textureUVChannel = vgoModule.textureUVChannel; + module.position = ArrayConverter.ToVector3(vgoModule.position, reverseZ: true); + module.rotation = ArrayConverter.ToVector3(vgoModule.rotation, reverseZ: true); + module.scale = ArrayConverter.ToVector3(vgoModule.scale); + module.alignToDirection = vgoModule.alignToDirection; + module.randomPositionAmount = vgoModule.randomPositionAmount; + module.sphericalDirectionAmount = vgoModule.sphericalDirectionAmount; + module.randomDirectionAmount = vgoModule.randomDirectionAmount; + } + + /// + /// Set ParticleSystem velocityOverLifetime field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_VelocityOverLifetimeModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + VelocityOverLifetimeModule module = particleSystem.velocityOverLifetime; + + module.enabled = vgoModule.enabled; + + module.xMultiplier = vgoModule.xMultiplier; + module.yMultiplier = vgoModule.yMultiplier; + module.zMultiplier = vgoModule.zMultiplier; + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.y = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.y); + module.z = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.z); + + module.space = vgoModule.space; + + module.orbitalX = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.orbitalX); + module.orbitalY = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.orbitalY); + module.orbitalZ = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.orbitalZ); + module.orbitalXMultiplier = vgoModule.orbitalXMultiplier; + module.orbitalYMultiplier = vgoModule.orbitalYMultiplier; + module.orbitalZMultiplier = vgoModule.orbitalZMultiplier; + + module.orbitalOffsetX = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.orbitalOffsetX); + module.orbitalOffsetY = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.orbitalOffsetY); + module.orbitalOffsetZ = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.orbitalOffsetZ); + module.orbitalOffsetXMultiplier = vgoModule.orbitalOffsetXMultiplier; + module.orbitalOffsetYMultiplier = vgoModule.orbitalOffsetYMultiplier; + module.orbitalOffsetZMultiplier = vgoModule.orbitalOffsetZMultiplier; + + module.radial = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.radial); + module.radialMultiplier = vgoModule.radialMultiplier; + + module.speedModifier = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.speedModifier); + module.speedModifierMultiplier = vgoModule.speedModifierMultiplier; + } + + /// + /// Set ParticleSystem limitVelocityOverLifetime field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_LimitVelocityOverLifetimeModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + LimitVelocityOverLifetimeModule module = particleSystem.limitVelocityOverLifetime; + + module.enabled = vgoModule.enabled; + module.separateAxes = vgoModule.separateAxes; + + if (vgoModule.separateAxes) + { + module.limitX = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.limitX); + module.limitY = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.limitY); + module.limitZ = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.limitZ); + module.limitXMultiplier = vgoModule.limitXMultiplier; + module.limitYMultiplier = vgoModule.limitYMultiplier; + module.limitZMultiplier = vgoModule.limitZMultiplier; + } + else + { + module.limit = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.limitX); + module.limitMultiplier = vgoModule.limitXMultiplier; + } + + module.space = vgoModule.space; + module.dampen = vgoModule.dampen; + module.drag = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.drag); + module.dragMultiplier = vgoModule.dragMultiplier; + module.multiplyDragByParticleSize = vgoModule.multiplyDragByParticleSize; + module.multiplyDragByParticleVelocity = vgoModule.multiplyDragByParticleVelocity; + } + + /// + /// Set ParticleSystem inhelitVelocity field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_InheritVelocityModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + InheritVelocityModule module = particleSystem.inheritVelocity; + + module.enabled = vgoModule.enabled; + module.mode = vgoModule.mode; + module.curve = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.curve); + module.curveMultiplier = vgoModule.curveMultiplier; + } + + /// + /// Set ParticleSystem forceOverLifetime field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_ForceOverLifetimeModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + ForceOverLifetimeModule module = particleSystem.forceOverLifetime; + + module.enabled = vgoModule.enabled; + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.y = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.y); + module.z = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.z); + module.xMultiplier = vgoModule.xMultiplier; + module.yMultiplier = vgoModule.yMultiplier; + module.zMultiplier = vgoModule.zMultiplier; + module.space = vgoModule.space; + module.randomized = vgoModule.randomized; + } + + /// + /// Set ParticleSystem colorOverLifetime field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_ColorOverLifetimeModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + ColorOverLifetimeModule module = particleSystem.colorOverLifetime; + + module.enabled = vgoModule.enabled; + module.color = VgoParticleSystemMinMaxGradientConverter.CreateMinMaxGradient(vgoModule.color); + } + + /// + /// Set ParticleSystem colorOverLifetime field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_ColorBySpeedModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + ColorBySpeedModule module = particleSystem.colorBySpeed; + + module.enabled = vgoModule.enabled; + module.color = VgoParticleSystemMinMaxGradientConverter.CreateMinMaxGradient(vgoModule.color); + module.range = ArrayConverter.ToVector2(vgoModule.range); + } + + /// + /// Set ParticleSystem sizeOverLifetime field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_SizeOverLifetimeModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + SizeOverLifetimeModule module = particleSystem.sizeOverLifetime; + + module.enabled = vgoModule.enabled; + module.separateAxes = vgoModule.separateAxes; + + if (vgoModule.separateAxes) + { + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.y = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.y); + module.z = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.z); + module.xMultiplier = vgoModule.xMultiplier; + module.yMultiplier = vgoModule.yMultiplier; + module.zMultiplier = vgoModule.zMultiplier; + } + else + { + module.size = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.sizeMultiplier = vgoModule.xMultiplier; + } + } + + /// + /// Set ParticleSystem sizeBySpeed field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_SizeBySpeedModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + SizeBySpeedModule module = particleSystem.sizeBySpeed; + + module.enabled = vgoModule.enabled; + module.separateAxes = vgoModule.separateAxes; + + if (vgoModule.separateAxes) + { + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.y = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.y); + module.z = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.z); + module.xMultiplier = vgoModule.xMultiplier; + module.yMultiplier = vgoModule.yMultiplier; + module.zMultiplier = vgoModule.zMultiplier; + } + else + { + module.size = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.sizeMultiplier = vgoModule.xMultiplier; + } + + module.range = ArrayConverter.ToVector2(vgoModule.range); + } + + /// + /// Set ParticleSystem rotationOverLifetime field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_RotationOverLifetimeModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + RotationOverLifetimeModule module = particleSystem.rotationOverLifetime; + + module.enabled = vgoModule.enabled; + module.separateAxes = vgoModule.separateAxes; + + if (vgoModule.separateAxes) + { + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.y = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.y); + module.z = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.z); + module.xMultiplier = vgoModule.xMultiplier; + module.yMultiplier = vgoModule.yMultiplier; + module.zMultiplier = vgoModule.zMultiplier; + } + else + { + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.xMultiplier = vgoModule.xMultiplier; + } + } + + /// + /// Set ParticleSystem rotationBySpeed field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_RotationBySpeedModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + RotationBySpeedModule module = particleSystem.rotationBySpeed; + + module.enabled = vgoModule.enabled; + module.separateAxes = vgoModule.separateAxes; + + if (vgoModule.separateAxes) + { + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.y = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.y); + module.z = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.z); + module.xMultiplier = vgoModule.xMultiplier; + module.yMultiplier = vgoModule.yMultiplier; + module.zMultiplier = vgoModule.zMultiplier; + } + else + { + module.x = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.x); + module.xMultiplier = vgoModule.xMultiplier; + } + + module.range = ArrayConverter.ToVector2(vgoModule.range); + } + + /// + /// Set ParticleSystem externalForcesModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_ExternalForcesModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + ExternalForcesModule module = particleSystem.externalForces; + + module.enabled = vgoModule.enabled; + module.multiplierCurve = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.multiplierCurve); + module.multiplier = vgoModule.multiplier; + module.influenceFilter = vgoModule.influenceFilter; + module.influenceMask = new LayerMask() { value = vgoModule.influenceMask }; + } + + /// + /// Set ParticleSystem noiseModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_NoiseModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + NoiseModule module = particleSystem.noise; + + module.enabled = vgoModule.enabled; + module.separateAxes = vgoModule.separateAxes; + + if (vgoModule.separateAxes) + { + module.strengthX = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.strengthX); + module.strengthY = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.strengthY); + module.strengthZ = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.strengthZ); + module.strengthXMultiplier = vgoModule.strengthXMultiplier; + module.strengthYMultiplier = vgoModule.strengthYMultiplier; + module.strengthZMultiplier = vgoModule.strengthZMultiplier; + } + else + { + module.strength = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.strengthX); + module.strengthMultiplier = vgoModule.strengthXMultiplier; + } + + module.frequency = vgoModule.frequency; + module.scrollSpeed = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.scrollSpeed); + module.scrollSpeedMultiplier = vgoModule.scrollSpeedMultiplier; + module.damping = vgoModule.damping; + module.octaveCount = vgoModule.octaveCount; + module.octaveMultiplier = vgoModule.octaveMultiplier; + module.octaveScale = vgoModule.octaveScale; + module.quality = vgoModule.quality; + module.remapEnabled = vgoModule.remapEnabled; + + if (vgoModule.remapEnabled) + { + if (vgoModule.separateAxes) + { + module.remapX = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.remapX); + module.remapY = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.remapY); + module.remapZ = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.remapZ); + module.remapXMultiplier = vgoModule.remapXMultiplier; + module.remapYMultiplier = vgoModule.remapYMultiplier; + module.remapZMultiplier = vgoModule.remapZMultiplier; + } + else + { + module.remap = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.remapX); + module.remapMultiplier = vgoModule.remapXMultiplier; + } + } + + module.positionAmount = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.positionAmount); + module.rotationAmount = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.rotationAmount); + module.sizeAmount = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.sizeAmount); + } + + /// + /// Set ParticleSystem collisionModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_CollisionModule vgoModule) + { + throw new NotImplementedException(); + } + + /// + /// Set ParticleSystem triggerModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_TriggerModule vgoModule) + { + throw new NotImplementedException(); + } + + /// + /// Set ParticleSystem subEmittersModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_SubEmittersModule vgoModule) + { + throw new NotImplementedException(); + } + + /// + /// Set ParticleSystem textureSheetAnimationModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_TextureSheetAnimationModule vgoModule) + { + throw new NotImplementedException(); + } + + /// + /// Set ParticleSystem lightsModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_LightsModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + LightsModule module = particleSystem.lights; + + module.enabled = vgoModule.enabled; + module.ratio = vgoModule.ratio; + module.useRandomDistribution = vgoModule.useRandomDistribution; + module.useParticleColor = vgoModule.useParticleColor; + module.sizeAffectsRange = vgoModule.sizeAffectsRange; + module.alphaAffectsIntensity = vgoModule.alphaAffectsIntensity; + module.range = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.range); + module.rangeMultiplier = vgoModule.rangeMultiplier; + module.intensity = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.intensity); + module.intensityMultiplier = vgoModule.intensityMultiplier; + module.maxLights = vgoModule.maxLights; + + if (vgoModule.light != null) + { + // @notice + Light goLight = particleSystem.gameObject.GetComponent(); + + if (goLight == null) + { + goLight = particleSystem.gameObject.AddComponent(); + } + + VgoLightConverter.SetComponentValue(goLight, vgoModule.light); + + goLight.enabled = false; + + module.light = goLight; + + if (Application.isEditor) + { + // @todo + } + } + } + + /// + /// Set ParticleSystem noiseModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_TrailModule vgoModule) + { + if (vgoModule == null) + { + return; + } + + TrailModule module = particleSystem.trails; + + module.enabled = vgoModule.enabled; + module.mode = vgoModule.mode; + + // PerParticle + module.ratio = vgoModule.ratio; + module.lifetime = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.lifetime); + module.lifetimeMultiplier = vgoModule.lifetimeMultiplier; + module.minVertexDistance = vgoModule.minVertexDistance; + module.worldSpace = vgoModule.worldSpace; + module.dieWithParticles = vgoModule.dieWithParticles; + + // Ribbon + module.ribbonCount = vgoModule.ribbonCount; + module.splitSubEmitterRibbons = vgoModule.splitSubEmitterRibbons; + module.attachRibbonsToTransform = vgoModule.attachRibbonsToTransform; + + module.textureMode = vgoModule.textureMode; + module.sizeAffectsWidth = vgoModule.sizeAffectsWidth; + module.sizeAffectsLifetime = vgoModule.sizeAffectsLifetime; + module.inheritParticleColor = vgoModule.inheritParticleColor; + module.colorOverLifetime = VgoParticleSystemMinMaxGradientConverter.CreateMinMaxGradient(vgoModule.colorOverLifetime); + module.widthOverTrail = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.widthOverTrail); + module.widthOverTrailMultiplier = vgoModule.widthOverTrailMultiplier; + module.colorOverTrail = VgoParticleSystemMinMaxGradientConverter.CreateMinMaxGradient(vgoModule.colorOverTrail); + module.generateLightingData = vgoModule.generateLightingData; + module.shadowBias = vgoModule.shadowBias; + } + + /// + /// Set ParticleSystem customDataModule field value. + /// + /// + /// + protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_CustomDataModule vgoModule) + { + throw new NotImplementedException(); + } + + #endregion + + #region Protected Methods (Renderer) + + /// + /// Set particleSystemRenderer field value. + /// + /// + /// + /// + public virtual void SetComponentValue(ParticleSystemRenderer particleSystemRenderer, VGO_PS_Renderer vgoRenderer, IList materialList) + { + if (vgoRenderer == null) + { + return; + } + + particleSystemRenderer.enabled = vgoRenderer.enabled; + particleSystemRenderer.renderMode = vgoRenderer.renderMode; + + // Billboard + particleSystemRenderer.cameraVelocityScale = vgoRenderer.cameraVelocityScale; + particleSystemRenderer.velocityScale = vgoRenderer.velocityScale; + particleSystemRenderer.lengthScale = vgoRenderer.lengthScale; + particleSystemRenderer.normalDirection = vgoRenderer.normalDirection; + + // Material + if ((materialList != null) && (-1 < vgoRenderer.sharedMaterial) && (vgoRenderer.sharedMaterial < materialList.Count)) + { + particleSystemRenderer.sharedMaterial = materialList[vgoRenderer.sharedMaterial]; + } + + if ((materialList != null) && (-1 < vgoRenderer.trailMaterialIndex) && (vgoRenderer.trailMaterialIndex < materialList.Count)) + { + particleSystemRenderer.trailMaterial = materialList[vgoRenderer.trailMaterialIndex]; + } + + particleSystemRenderer.sortMode = vgoRenderer.sortMode; + particleSystemRenderer.sortingFudge = vgoRenderer.sortingFudge; + particleSystemRenderer.minParticleSize = vgoRenderer.minParticleSize; + particleSystemRenderer.maxParticleSize = vgoRenderer.maxParticleSize; + particleSystemRenderer.alignment = vgoRenderer.alignment; + particleSystemRenderer.flip = ArrayConverter.ToVector3(vgoRenderer.flip, reverseZ: true); + particleSystemRenderer.allowRoll = vgoRenderer.allowRoll; + particleSystemRenderer.pivot = ArrayConverter.ToVector3(vgoRenderer.pivot, reverseZ: true); + + particleSystemRenderer.maskInteraction = vgoRenderer.maskInteraction; + particleSystemRenderer.enableGPUInstancing = vgoRenderer.enableGPUInstancing; + + // Shadow + particleSystemRenderer.shadowCastingMode = vgoRenderer.shadowCastingMode; + particleSystemRenderer.receiveShadows = vgoRenderer.receiveShadows; + particleSystemRenderer.shadowBias = vgoRenderer.shadowBias; + + particleSystemRenderer.motionVectorGenerationMode = vgoRenderer.motionVectorGenerationMode; + particleSystemRenderer.forceRenderingOff = vgoRenderer.forceRenderingOff; + particleSystemRenderer.rendererPriority = vgoRenderer.rendererPriority; + particleSystemRenderer.renderingLayerMask = vgoRenderer.renderingLayerMask; + particleSystemRenderer.sortingLayerID = vgoRenderer.sortingLayerID; + particleSystemRenderer.sortingOrder = vgoRenderer.sortingOrder; + particleSystemRenderer.lightProbeUsage = vgoRenderer.lightProbeUsage; + particleSystemRenderer.reflectionProbeUsage = vgoRenderer.reflectionProbeUsage; + + // @notice + VgoTransformConverter.SetComponentValue(particleSystemRenderer.probeAnchor, vgoRenderer.probeAnchor); + + if (particleSystemRenderer.sharedMaterial != null) + { + //SetVertexStream(particleSystemRenderer, particleSystemRenderer.sharedMaterial); + } + } + + /// + /// Set vertex stream. + /// + /// + /// + protected virtual void SetVertexStream(ParticleSystemRenderer particleSystemRenderer, Material material) + { + bool useLighting = (material.GetFloat(UniStandardParticle.Utils.PropLightingEnabled) > 0.0f); + bool useFlipbookBlending = (material.GetFloat(UniStandardParticle.Utils.PropFlipbookMode) > 0.0f); + bool useTangents = useLighting && material.GetTexture(UniStandardParticle.Utils.PropBumpMap); + + //bool useGPUInstancing = ShaderUtil.HasProceduralInstancing(material.shader); + bool useGPUInstancing = particleSystemRenderer.enableGPUInstancing; + + List streams = new List(); + + streams.Add(ParticleSystemVertexStream.Position); + + if (useLighting) + { + streams.Add(ParticleSystemVertexStream.Normal); + } + + streams.Add(ParticleSystemVertexStream.Color); + streams.Add(ParticleSystemVertexStream.UV); + + if (useTangents) + { + streams.Add(ParticleSystemVertexStream.Tangent); + } + + if (useFlipbookBlending) + { + streams.Add(ParticleSystemVertexStream.UV2); + streams.Add(ParticleSystemVertexStream.AnimBlend); + } + + List instancedStreams = new List(streams); + + if (useGPUInstancing) + { + instancedStreams.Add(ParticleSystemVertexStream.AnimFrame); + } + + // Set the streams on all systems using this material + //if (useGPUInstancing && + // particleSystemRenderer.renderMode == ParticleSystemRenderMode.Mesh && + // particleSystemRenderer.supportsMeshInstancing) + if (useGPUInstancing && (particleSystemRenderer.renderMode == ParticleSystemRenderMode.Mesh)) + { + particleSystemRenderer.SetActiveVertexStreams(instancedStreams); + } + else + { + particleSystemRenderer.SetActiveVertexStreams(streams); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/UniVgo/Runtime/IO/VgoParticleSystemImporter.cs.meta b/UniVgo/Runtime/IO/VgoParticleSystemImporter.cs.meta new file mode 100644 index 0000000..cf4c341 --- /dev/null +++ b/UniVgo/Runtime/IO/VgoParticleSystemImporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 63a1c1a2b1047234ab926de5867f756f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UniVgo/Runtime/IO/VgoShaderStore.cs b/UniVgo/Runtime/IO/VgoShaderStore.cs index b7919fa..fcc5c2e 100644 --- a/UniVgo/Runtime/IO/VgoShaderStore.cs +++ b/UniVgo/Runtime/IO/VgoShaderStore.cs @@ -14,6 +14,12 @@ public class VgoShaderStore : ShaderStore { #region Fields + /// Particles/Standard Surface + Shader _ParticlesStandardSurface; + + /// Particles/Standard Unlit + Shader _ParticlesStandardUnlit; + /// VRM/UnlitTexture Shader _VrmUnlitTexture; @@ -33,6 +39,32 @@ public class VgoShaderStore : ShaderStore #region Properties + /// Particles/Standard Surface + protected Shader ParticlesStandardSurface + { + get + { + if (_ParticlesStandardSurface == null) + { + _ParticlesStandardSurface = Shader.Find(ShaderName.Particles_Standard_Surface); + } + return _ParticlesStandardSurface; + } + } + + /// Particles/Standard Unlit + protected Shader ParticlesStandardUnlit + { + get + { + if (_ParticlesStandardUnlit == null) + { + _ParticlesStandardUnlit = Shader.Find(ShaderName.Particles_Standard_Unlit); + } + return _ParticlesStandardUnlit; + } + } + /// VRM/UnlitTexture protected Shader VrmUnlitTexture { @@ -136,6 +168,12 @@ public override Shader GetShader(glTFMaterial material) { switch (material.extensions.VGO_materials.shaderName) { + case ShaderName.Particles_Standard_Surface: + return ParticlesStandardSurface; + + case ShaderName.Particles_Standard_Unlit: + return ParticlesStandardUnlit; + case ShaderName.UniGLTF_StandardVColor: return VColor; @@ -174,6 +212,18 @@ public override Shader GetShader(glTFMaterial material) } } + if (material.extensions.VGO_materials_particle != null) + { + if (material.extensions.KHR_materials_unlit != null) + { + return ParticlesStandardUnlit; + } + else + { + return ParticlesStandardSurface; + } + } + if (material.extensions.KHR_materials_unlit != null) { return UniUnlit; diff --git a/UniVgo/Runtime/UniVgo.asmdef b/UniVgo/Runtime/UniVgo.asmdef index 1e5053b..3629317 100644 --- a/UniVgo/Runtime/UniVgo.asmdef +++ b/UniVgo/Runtime/UniVgo.asmdef @@ -3,6 +3,7 @@ "references": [ "ShaderProperty.Runtime", "MToon", + "UniStandardParticle", "UniUnlit", "UniGLTFforUniVgo" ], diff --git a/UniVgo/Runtime/Utils/ShaderName.cs b/UniVgo/Runtime/Utils/ShaderName.cs index ee53a2e..fe30294 100644 --- a/UniVgo/Runtime/Utils/ShaderName.cs +++ b/UniVgo/Runtime/Utils/ShaderName.cs @@ -9,6 +9,12 @@ namespace UniVgo /// public class ShaderName { + /// + public const string Particles_Standard_Surface = "Particles/Standard Surface"; + + /// + public const string Particles_Standard_Unlit = "Particles/Standard Unlit"; + /// public const string UniGLTF_StandardVColor = "UniGLTF/StandardVColor"; diff --git a/UniVgo/Runtime/Vgo.cs b/UniVgo/Runtime/Vgo.cs index ee5758f..cf0e57c 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.4"; + public const string SpecVersion = "0.5"; } } \ No newline at end of file diff --git a/UniVgo/Runtime/VgoVersion.cs b/UniVgo/Runtime/VgoVersion.cs index f6721ab..7e45d6f 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 = 6; + public const int MINOR = 7; /// Patch - public const int PATCH = 1; + public const int PATCH = 0; /// Version - public const string VERSION = "0.6.1"; + public const string VERSION = "0.7.0"; } } diff --git a/package.json b/package.json index eb15943..6d7da43 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,19 @@ "name": "izayoi.univgo", "displayName": "UniVGO", "description": "UniVGO is a package that can handle VGO files in Unity.", - "version": "0.6.1-preview", + "version": "0.7.0-preview", "type": "tool", "category": "", "keywords": [ - "unity", "glb", "glTF", + "unity", + "collier", + "rigidbody", + "light", + "ParticleSystem", + "shader", + "mtoon", "vgo" ], "unity": "2018.3", @@ -25,6 +31,6 @@ "url": "git+https://github.com/izayoijiichan/VGO.git" }, "dependencies": { - "jillejr.newtonsoft.json-for-unity": "12.0.201" + "jillejr.newtonsoft.json-for-unity": "12.0.301" } } \ No newline at end of file