com.warwlock.mtree 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm.yml +19 -0
- package/CHANGELOG.md +17 -0
- package/CHANGELOG.md.meta +7 -0
- package/Documentation~/Documentation.md +3 -0
- package/Editor/BranchEditor.cs +545 -0
- package/Editor/BranchEditor.cs.meta +16 -0
- package/Editor/EditorCallbacks.cs +69 -0
- package/Editor/EditorCallbacks.cs.meta +11 -0
- package/Editor/MTree.Editor.asmdef +18 -0
- package/Editor/MTree.Editor.asmdef.meta +7 -0
- package/Editor/MenuItem.cs +31 -0
- package/Editor/MenuItem.cs.meta +11 -0
- package/Editor/MtreeBezierInspector.cs +161 -0
- package/Editor/MtreeBezierInspector.cs.meta +11 -0
- package/Editor/MtreeEditor.cs +434 -0
- package/Editor/MtreeEditor.cs.meta +11 -0
- package/Editor/TemplateInspector.cs +66 -0
- package/Editor/TemplateInspector.cs.meta +12 -0
- package/Editor/ValuesEditor.cs +18 -0
- package/Editor/ValuesEditor.cs.meta +11 -0
- package/Editor/VertexColorAdjustmentEditor.cs +169 -0
- package/Editor/VertexColorAdjustmentEditor.cs.meta +11 -0
- package/Editor.meta +8 -0
- package/LICENSE +21 -0
- package/LICENSE.meta +7 -0
- package/README.md +68 -0
- package/README.md.meta +7 -0
- package/Resources/Mtree/MtreeBillboardCamera.prefab +204 -0
- package/Resources/Mtree/MtreeBillboardCamera.prefab.meta +8 -0
- package/Resources/Mtree/Sprites/DeleteCrossSprite.png +0 -0
- package/Resources/Mtree/Sprites/DeleteCrossSprite.png.meta +116 -0
- package/Resources/Mtree/Sprites/TreeFunctionSprite.png +0 -0
- package/Resources/Mtree/Sprites/TreeFunctionSprite.png.meta +116 -0
- package/Resources/Mtree/Sprites/TreeFunctionSpriteSelected.psd +0 -0
- package/Resources/Mtree/Sprites/TreeFunctionSpriteSelected.psd.meta +116 -0
- package/Resources/Mtree/Sprites.meta +8 -0
- package/Resources/Mtree/Vertex Color Editor/Mtree Vertex Color GameObject.prefab +104 -0
- package/Resources/Mtree/Vertex Color Editor/Mtree Vertex Color GameObject.prefab.meta +7 -0
- package/Resources/Mtree/Vertex Color Editor.meta +8 -0
- package/Resources/Mtree/branches.fbx +0 -0
- package/Resources/Mtree/branches.fbx.meta +137 -0
- package/Resources/Mtree.meta +8 -0
- package/Resources.meta +8 -0
- package/Runtime/AO/DensityAO.cs +203 -0
- package/Runtime/AO/DensityAO.cs.meta +11 -0
- package/Runtime/AO/KDTree.cs +169 -0
- package/Runtime/AO/KDTree.cs.meta +11 -0
- package/Runtime/AO/WeightedRandom.cs +74 -0
- package/Runtime/AO/WeightedRandom.cs.meta +11 -0
- package/Runtime/AO.meta +8 -0
- package/Runtime/Bezier/Bezier.cs +69 -0
- package/Runtime/Bezier/Bezier.cs.meta +11 -0
- package/Runtime/Bezier/MtreeBezier.cs +185 -0
- package/Runtime/Bezier/MtreeBezier.cs.meta +11 -0
- package/Runtime/Bezier.meta +8 -0
- package/Runtime/ExampleSceneManager.cs +165 -0
- package/Runtime/ExampleSceneManager.cs.meta +11 -0
- package/Runtime/LODValues.cs +44 -0
- package/Runtime/LODValues.cs.meta +11 -0
- package/Runtime/LeafPoint.cs +135 -0
- package/Runtime/LeafPoint.cs.meta +11 -0
- package/Runtime/MTree.Runtime.asmdef +3 -0
- package/Runtime/MTree.Runtime.asmdef.meta +7 -0
- package/Runtime/MTree.cs +569 -0
- package/Runtime/MTree.cs.meta +11 -0
- package/Runtime/MtreeComponent.cs +482 -0
- package/Runtime/MtreeComponent.cs.meta +11 -0
- package/Runtime/MtreeVariables.cs +11 -0
- package/Runtime/MtreeVariables.cs.meta +11 -0
- package/Runtime/MtreeWind.cs +94 -0
- package/Runtime/MtreeWind.cs.meta +11 -0
- package/Runtime/Node.cs +331 -0
- package/Runtime/Node.cs.meta +11 -0
- package/Runtime/SimplexNoise.cs +166 -0
- package/Runtime/SimplexNoise.cs.meta +11 -0
- package/Runtime/Splines.cs +379 -0
- package/Runtime/Splines.cs.meta +11 -0
- package/Runtime/TreeBilboard.cs +290 -0
- package/Runtime/TreeBilboard.cs.meta +11 -0
- package/Runtime/TreeFunctions/BranchFunction.cs +92 -0
- package/Runtime/TreeFunctions/BranchFunction.cs.meta +11 -0
- package/Runtime/TreeFunctions/GrowFunction.cs +81 -0
- package/Runtime/TreeFunctions/GrowFunction.cs.meta +11 -0
- package/Runtime/TreeFunctions/LeafFunction.cs +111 -0
- package/Runtime/TreeFunctions/LeafFunction.cs.meta +11 -0
- package/Runtime/TreeFunctions/RootsFunction.cs +77 -0
- package/Runtime/TreeFunctions/RootsFunction.cs.meta +11 -0
- package/Runtime/TreeFunctions/SplitFunction.cs +50 -0
- package/Runtime/TreeFunctions/SplitFunction.cs.meta +11 -0
- package/Runtime/TreeFunctions/TreeFunctionAsset.cs +105 -0
- package/Runtime/TreeFunctions/TreeFunctionAsset.cs.meta +11 -0
- package/Runtime/TreeFunctions/TrunkFunction.cs +88 -0
- package/Runtime/TreeFunctions/TrunkFunction.cs.meta +11 -0
- package/Runtime/TreeFunctions.meta +8 -0
- package/Runtime/TreePoint.cs +27 -0
- package/Runtime/TreePoint.cs.meta +11 -0
- package/Runtime/TreeTemplate.cs +50 -0
- package/Runtime/TreeTemplate.cs.meta +12 -0
- package/Runtime/Utils.cs +268 -0
- package/Runtime/Utils.cs.meta +11 -0
- package/Runtime/VSProIntegration.cs +132 -0
- package/Runtime/VSProIntegration.cs.meta +11 -0
- package/Runtime.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Birch.asset +364 -0
- package/Samples~/ExampleTemplates/Examples/Birch.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Bush.asset +385 -0
- package/Samples~/ExampleTemplates/Examples/Bush.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Eastern Pine.asset +482 -0
- package/Samples~/ExampleTemplates/Examples/Eastern Pine.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/FantasyTree.asset +406 -0
- package/Samples~/ExampleTemplates/Examples/FantasyTree.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Fern.asset +291 -0
- package/Samples~/ExampleTemplates/Examples/Fern.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/High Poly.asset +300 -0
- package/Samples~/ExampleTemplates/Examples/High Poly.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/LightingData.asset +0 -0
- package/Samples~/ExampleTemplates/Examples/LightingData.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Birch Outline.mat +196 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Birch Outline.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Birch.mat +196 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Birch.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Fern.mat +181 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Fern.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark HighPoly.mat +201 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark HighPoly.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Oak.mat +208 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Oak.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Palm.mat +180 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Palm.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Pine.mat +206 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Pine.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Ponderossa.mat +206 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Ponderossa.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Poplar.mat +172 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark/Bark Poplar.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Bark.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Example Scene/Floor.mat +392 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Example Scene/Floor.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Example Scene.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Fern.mat +202 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Fern.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs HighPoly.mat +265 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs HighPoly.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Needles.mat +267 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Needles.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Palm.mat +232 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Palm.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Palmate.mat +250 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Palmate.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Pine.mat +247 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Pine.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Poplar.mat +223 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Poplar.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Serrate Outline.mat +262 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Serrate Outline.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Serrate.mat +281 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Serrate.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Stone Pine.mat +267 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Stone Pine.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Willow.mat +236 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs/Leafs Willow.mat.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials/Leafs.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Materials.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Oak.asset +364 -0
- package/Samples~/ExampleTemplates/Examples/Oak.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Old Oak.asset +364 -0
- package/Samples~/ExampleTemplates/Examples/Old Oak.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Palm.asset +500 -0
- package/Samples~/ExampleTemplates/Examples/Palm.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Pine 2.asset +387 -0
- package/Samples~/ExampleTemplates/Examples/Pine 2.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Pine.asset +405 -0
- package/Samples~/ExampleTemplates/Examples/Pine.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Ponderossa Pine.asset +478 -0
- package/Samples~/ExampleTemplates/Examples/Ponderossa Pine.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Poplar.asset +309 -0
- package/Samples~/ExampleTemplates/Examples/Poplar.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/ReflectionProbe-0.exr +0 -0
- package/Samples~/ExampleTemplates/Examples/ReflectionProbe-0.exr.meta +117 -0
- package/Samples~/ExampleTemplates/Examples/Small Pine.asset +273 -0
- package/Samples~/ExampleTemplates/Examples/Small Pine.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Small Tree.asset +364 -0
- package/Samples~/ExampleTemplates/Examples/Small Tree.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Birch_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Birch_C.png.meta +74 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Birch_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Birch_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Damaged_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Damaged_C.png.meta +116 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Damaged_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Damaged_N.png.meta +116 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_1_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_1_C.png.meta +132 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_1_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_1_N.png.meta +116 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_2_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_2_C.png.meta +132 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_3_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_3_C.png.meta +132 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_3_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_3_N.png.meta +116 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_4_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_4_C.png.meta +132 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_4_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Decidious_4_N.png.meta +116 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Oak_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Oak_C.png.meta +74 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Oak_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Oak_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Palm_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Palm_C.png.meta +74 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Palm_N.bmp +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Palm_N.bmp.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Pine_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Pine_C.png.meta +74 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Pine_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark/Bark_Pine_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Bark.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch Serrate_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch Serrate_C.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch Serrate_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch Serrate_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Needles_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Needles_C.png.meta +99 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Needles_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Needles_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Palmate_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Palmate_C.png.meta +99 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Palmate_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Palmate_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_1_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_1_C.png.meta +88 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_1_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_1_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_2_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_2_C.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_2_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Pine_2_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Poplar_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Poplar_C.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Poplar_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch/Branch_Poplar_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Branch.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Color Ramp/Ramp_PSD.psd +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Color Ramp/Ramp_PSD.psd.meta +76 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Color Ramp/Ramp_Toon.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Color Ramp/Ramp_Toon.png.meta +76 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Color Ramp.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Fern_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Fern_C.png.meta +99 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Fern_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Fern_N.png.meta +88 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Palm_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Palm_C.png.meta +88 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Palm_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Palm_N.png.meta +88 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Willow_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Willow_C.png.meta +99 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Willow_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Leaf_Willow_N.png.meta +88 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Single_Serrated_C.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Single_Serrated_C.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Single_Serrated_N.png +0 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs/Single_Serrated_N.png.meta +96 -0
- package/Samples~/ExampleTemplates/Examples/Textures/Single Leafs.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Textures.meta +8 -0
- package/Samples~/ExampleTemplates/Examples/Willow.asset +364 -0
- package/Samples~/ExampleTemplates/Examples/Willow.asset.meta +8 -0
- package/Samples~/ExampleTemplates/Examples.meta +8 -0
- package/Samples~/ExampleTemplates/Examples.unity +12660 -0
- package/Samples~/ExampleTemplates/Examples.unity.meta +7 -0
- package/Samples~/ExampleTemplates.meta +8 -0
- package/Shaders/BarkShader.shadergraph +17215 -0
- package/Shaders/BarkShader.shadergraph.meta +10 -0
- package/Shaders/Editor/BarkEditor.cs +100 -0
- package/Shaders/Editor/BarkEditor.cs.meta +11 -0
- package/Shaders/Editor/LeafEditor.cs +173 -0
- package/Shaders/Editor/LeafEditor.cs.meta +11 -0
- package/Shaders/Editor.meta +8 -0
- package/Shaders/LeafShader.shadergraph +34803 -0
- package/Shaders/LeafShader.shadergraph.meta +10 -0
- package/Shaders/MTree.Shaders.asmdef +3 -0
- package/Shaders/MTree.Shaders.asmdef.meta +7 -0
- package/Shaders/leafFunctions.hlsl +201 -0
- package/Shaders/leafFunctions.hlsl.meta +7 -0
- package/Shaders/vertexFunc.hlsl +55 -0
- package/Shaders/vertexFunc.hlsl.meta +7 -0
- package/Shaders.meta +8 -0
- package/package.json +36 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e0a43faff4d99644e8707dd9bad91d13
|
|
3
|
+
ScriptedImporter:
|
|
4
|
+
internalIDToNameTable: []
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
serializedVersion: 2
|
|
7
|
+
userData:
|
|
8
|
+
assetBundleName:
|
|
9
|
+
assetBundleVariant:
|
|
10
|
+
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
//#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
|
2
|
+
|
|
3
|
+
#ifndef leafFuncs
|
|
4
|
+
#define leafFuncs
|
|
5
|
+
|
|
6
|
+
void DirectionalEquation_float( float _WindDirection, out float2 output)
|
|
7
|
+
{
|
|
8
|
+
float d = _WindDirection * 0.0174532924;
|
|
9
|
+
float xL = cos(d) + 1 / 2;
|
|
10
|
+
float zL = sin(d) + 1 / 2;
|
|
11
|
+
output = float2(zL,xL);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
void If252_g478_float( int m_Switch , float3 m_Leaves , float3 m_Palm , float3 m_Grass , float3 m_None, out float3 output)
|
|
15
|
+
{
|
|
16
|
+
float3 Output = m_None;
|
|
17
|
+
if(m_Switch == 0){Output = m_Leaves;}
|
|
18
|
+
if(m_Switch == 1){Output = m_Palm;}
|
|
19
|
+
if(m_Switch == 2){Output = m_Grass;}
|
|
20
|
+
if(m_Switch == 3){Output = m_None;}
|
|
21
|
+
output = Output;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
void HSVToRGB_float( float3 c, out float3 output)
|
|
25
|
+
{
|
|
26
|
+
float4 K = float4( 1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0 );
|
|
27
|
+
float3 p = abs( frac( c.xxx + K.xyz ) * 6.0 - K.www );
|
|
28
|
+
output = c.z * lerp( K.xxx, saturate( p - K.xxx ), c.y );
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
void RGBToHSV_float(float3 c, out float3 output)
|
|
32
|
+
{
|
|
33
|
+
float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
34
|
+
float4 p = lerp( float4( c.bg, K.wz ), float4( c.gb, K.xy ), step( c.b, c.g ) );
|
|
35
|
+
float4 q = lerp( float4( p.xyw, c.r ), float4( c.r, p.yzx ), step( p.x, c.r ) );
|
|
36
|
+
float d = q.x - min( q.w, q.y );
|
|
37
|
+
float e = 1.0e-10;
|
|
38
|
+
output = float3( abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void If4_g459_float( float Mode , float Cull , float3 Flip , float3 Mirror , float3 None, out float3 output)
|
|
42
|
+
{
|
|
43
|
+
float3 OUT = None;
|
|
44
|
+
if(Cull == 0){
|
|
45
|
+
if(Mode == 0)
|
|
46
|
+
OUT = Flip;
|
|
47
|
+
if(Mode == 1)
|
|
48
|
+
OUT = Mirror;
|
|
49
|
+
if(Mode == 2)
|
|
50
|
+
OUT == None;
|
|
51
|
+
}else{
|
|
52
|
+
OUT = None;
|
|
53
|
+
}
|
|
54
|
+
output = OUT;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
void Dither8x8Bayer_float( int x, int y, out float output)
|
|
58
|
+
{
|
|
59
|
+
const float dither[ 64 ] = {
|
|
60
|
+
1, 49, 13, 61, 4, 52, 16, 64,
|
|
61
|
+
33, 17, 45, 29, 36, 20, 48, 32,
|
|
62
|
+
9, 57, 5, 53, 12, 60, 8, 56,
|
|
63
|
+
41, 25, 37, 21, 44, 28, 40, 24,
|
|
64
|
+
3, 51, 15, 63, 2, 50, 14, 62,
|
|
65
|
+
35, 19, 47, 31, 34, 18, 46, 30,
|
|
66
|
+
11, 59, 7, 55, 10, 58, 6, 54,
|
|
67
|
+
43, 27, 39, 23, 42, 26, 38, 22};
|
|
68
|
+
int r = y * 8 + x;
|
|
69
|
+
output = dither[r] / 64; // same # of instructions as pre-dividing due to compiler magic
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
void worldOutNormal_float(float3 worldTangent, float3 worldBiTangent, float3 worldNormal, float3 tanNormal, out float3 output)
|
|
73
|
+
{
|
|
74
|
+
float3 tanToWorld0 = float3( worldTangent.x, worldBiTangent.x, worldNormal.x );
|
|
75
|
+
float3 tanToWorld1 = float3( worldTangent.y, worldBiTangent.y, worldNormal.y );
|
|
76
|
+
float3 tanToWorld2 = float3( worldTangent.z, worldBiTangent.z, worldNormal.z );
|
|
77
|
+
|
|
78
|
+
output = float3(dot(tanToWorld0,tanNormal), dot(tanToWorld1,tanNormal), dot(tanToWorld2,tanNormal));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void GetCommFunc_float(out float4 dir, out float4 col, out float fade)
|
|
82
|
+
{
|
|
83
|
+
#ifndef SHADERGRAPH_PREVIEW
|
|
84
|
+
dir = _MainLightPosition;
|
|
85
|
+
col = _MainLightColor;
|
|
86
|
+
#else
|
|
87
|
+
dir = float4(0, 1, 0, 0);
|
|
88
|
+
col = float4(1, 1, 1, 1);
|
|
89
|
+
#endif
|
|
90
|
+
|
|
91
|
+
fade = unity_LODFade.x;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
float _WindStrength;
|
|
95
|
+
float _RandomWindOffset;
|
|
96
|
+
float _WindPulse;
|
|
97
|
+
float _WindDirection;
|
|
98
|
+
float _WindTurbulence;
|
|
99
|
+
|
|
100
|
+
void WindProps_float(out float WindStrength,
|
|
101
|
+
out float RandomWindOffset,
|
|
102
|
+
out float WindPulse,
|
|
103
|
+
out float WindDirection,
|
|
104
|
+
out float WindTurbulence)
|
|
105
|
+
{
|
|
106
|
+
WindStrength = _WindStrength;
|
|
107
|
+
RandomWindOffset = _RandomWindOffset;
|
|
108
|
+
WindPulse = _WindPulse;
|
|
109
|
+
WindDirection = _WindDirection;
|
|
110
|
+
WindTurbulence = _WindTurbulence;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
void GetMatrix_float(out float4x4 objTOworld)
|
|
114
|
+
{
|
|
115
|
+
objTOworld = GetObjectToWorldMatrix();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
119
|
+
|
|
120
|
+
float2 DirectionalEquation(float _WindDirection)
|
|
121
|
+
{
|
|
122
|
+
float d = _WindDirection * 0.0174532924;
|
|
123
|
+
float xL = cos(d) + 1 / 2;
|
|
124
|
+
float zL = sin(d) + 1 / 2;
|
|
125
|
+
return float2(zL, xL);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
float3 If252_g478(int m_Switch, float3 m_Leaves, float3 m_Palm, float3 m_Grass, float3 m_None)
|
|
129
|
+
{
|
|
130
|
+
float3 Output = m_None;
|
|
131
|
+
if (m_Switch == 0)
|
|
132
|
+
{
|
|
133
|
+
Output = m_Leaves;
|
|
134
|
+
}
|
|
135
|
+
if (m_Switch == 1)
|
|
136
|
+
{
|
|
137
|
+
Output = m_Palm;
|
|
138
|
+
}
|
|
139
|
+
if (m_Switch == 2)
|
|
140
|
+
{
|
|
141
|
+
Output = m_Grass;
|
|
142
|
+
}
|
|
143
|
+
if (m_Switch == 3)
|
|
144
|
+
{
|
|
145
|
+
Output = m_None;
|
|
146
|
+
}
|
|
147
|
+
return Output;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
float3 HSVToRGB(float3 c)
|
|
151
|
+
{
|
|
152
|
+
float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
|
153
|
+
float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
|
|
154
|
+
return c.z * lerp(K.xxx, saturate(p - K.xxx), c.y);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
float3 RGBToHSV(float3 c)
|
|
158
|
+
{
|
|
159
|
+
float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
160
|
+
float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g));
|
|
161
|
+
float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r));
|
|
162
|
+
float d = q.x - min(q.w, q.y);
|
|
163
|
+
float e = 1.0e-10;
|
|
164
|
+
return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
|
165
|
+
}
|
|
166
|
+
float3 If4_g459(float Mode, float Cull, float3 Flip, float3 Mirror, float3 None)
|
|
167
|
+
{
|
|
168
|
+
float3 OUT = None;
|
|
169
|
+
if (Cull == 0)
|
|
170
|
+
{
|
|
171
|
+
if (Mode == 0)
|
|
172
|
+
OUT = Flip;
|
|
173
|
+
if (Mode == 1)
|
|
174
|
+
OUT = Mirror;
|
|
175
|
+
if (Mode == 2)
|
|
176
|
+
OUT == None;
|
|
177
|
+
}
|
|
178
|
+
else
|
|
179
|
+
{
|
|
180
|
+
OUT = None;
|
|
181
|
+
}
|
|
182
|
+
return OUT;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
inline float Dither8x8Bayer(int x, int y)
|
|
186
|
+
{
|
|
187
|
+
const float dither[64] =
|
|
188
|
+
{
|
|
189
|
+
1, 49, 13, 61, 4, 52, 16, 64,
|
|
190
|
+
33, 17, 45, 29, 36, 20, 48, 32,
|
|
191
|
+
9, 57, 5, 53, 12, 60, 8, 56,
|
|
192
|
+
41, 25, 37, 21, 44, 28, 40, 24,
|
|
193
|
+
3, 51, 15, 63, 2, 50, 14, 62,
|
|
194
|
+
35, 19, 47, 31, 34, 18, 46, 30,
|
|
195
|
+
11, 59, 7, 55, 10, 58, 6, 54,
|
|
196
|
+
43, 27, 39, 23, 42, 26, 38, 22
|
|
197
|
+
};
|
|
198
|
+
int r = y * 8 + x;
|
|
199
|
+
return dither[r] / 64; // same # of instructions as pre-dividing due to compiler magic
|
|
200
|
+
}
|
|
201
|
+
#endif
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#include "leafFunctions.hlsl"
|
|
2
|
+
|
|
3
|
+
void VertexCustomFunc_float(float3 worldPos, float3 vertCol, float3 worldNorm, out float3 output)
|
|
4
|
+
{
|
|
5
|
+
int m_Switch252_g478 = _WindModeLeaves;
|
|
6
|
+
float3 VAR_VertexPosition21_g478 = worldPos;
|
|
7
|
+
float3 break109_g478 = VAR_VertexPosition21_g478;
|
|
8
|
+
float VAR_WindStrength43_g478 = (_WindStrength * _GlobalWindInfluence);
|
|
9
|
+
float4 transform37_g478 = mul(GetObjectToWorldMatrix(), float4(0, 0, 0, 1));
|
|
10
|
+
float2 appendResult38_g478 = (float2(transform37_g478.x, transform37_g478.z));
|
|
11
|
+
float dotResult2_g479 = dot(appendResult38_g478, float2(12.9898, 78.233));
|
|
12
|
+
float lerpResult8_g479 = lerp(0.8, ((_RandomWindOffset / 2.0) + 0.9), frac((sin(dotResult2_g479) * 43758.55)));
|
|
13
|
+
float VAR_RandomTime16_g478 = ((_TimeParameters.x * 0.05) * lerpResult8_g479);
|
|
14
|
+
float FUNC_Turbulence36_g478 = (sin(((VAR_RandomTime16_g478 * 40.0) - (VAR_VertexPosition21_g478.z / 15.0))) * 0.5);
|
|
15
|
+
float VAR_WindPulse274_g478 = _WindPulse;
|
|
16
|
+
float FUNC_Angle73_g478 = (VAR_WindStrength43_g478 * (1.0 + sin(((((VAR_RandomTime16_g478 * 2.0) + FUNC_Turbulence36_g478) - (VAR_VertexPosition21_g478.z / 50.0)) - (vertCol.r / 20.0)))) * sqrt(vertCol.r) * 0.2 * VAR_WindPulse274_g478);
|
|
17
|
+
float VAR_SinA80_g478 = sin(FUNC_Angle73_g478);
|
|
18
|
+
float VAR_CosA78_g478 = cos(FUNC_Angle73_g478);
|
|
19
|
+
float _WindDirection164_g478 = _WindDirection;
|
|
20
|
+
float2 localDirectionalEquation164_g478 = DirectionalEquation(_WindDirection164_g478);
|
|
21
|
+
float2 break165_g478 = localDirectionalEquation164_g478;
|
|
22
|
+
float VAR_xLerp83_g478 = break165_g478.x;
|
|
23
|
+
float lerpResult118_g478 = lerp(break109_g478.x, ((break109_g478.y * VAR_SinA80_g478) + (break109_g478.x * VAR_CosA78_g478)), VAR_xLerp83_g478);
|
|
24
|
+
float3 break98_g478 = VAR_VertexPosition21_g478;
|
|
25
|
+
float3 break105_g478 = VAR_VertexPosition21_g478;
|
|
26
|
+
float VAR_zLerp95_g478 = break165_g478.y;
|
|
27
|
+
float lerpResult120_g478 = lerp(break105_g478.z, ((break105_g478.y * VAR_SinA80_g478) + (break105_g478.z * VAR_CosA78_g478)), VAR_zLerp95_g478);
|
|
28
|
+
float3 appendResult122_g478 = (float3(lerpResult118_g478, ((break98_g478.y * VAR_CosA78_g478) - (break98_g478.z * VAR_SinA80_g478)), lerpResult120_g478));
|
|
29
|
+
float3 FUNC_vertexPos123_g478 = appendResult122_g478;
|
|
30
|
+
float3 break236_g478 = FUNC_vertexPos123_g478;
|
|
31
|
+
half FUNC_SinFunction195_g478 = sin(((VAR_RandomTime16_g478 * 200.0 * (0.2 + vertCol.g)) + (vertCol.g * 10.0) + FUNC_Turbulence36_g478 + (VAR_VertexPosition21_g478.z / 2.0)));
|
|
32
|
+
float VAR_GlobalWindTurbulence194_g478 = (_WindTurbulence * _GlobalTurbulenceInfluence);
|
|
33
|
+
float3 appendResult237_g478 = (float3(break236_g478.x, (break236_g478.y + (FUNC_SinFunction195_g478 * vertCol.b * (FUNC_Angle73_g478 + (VAR_WindStrength43_g478 / 200.0)) * VAR_GlobalWindTurbulence194_g478)), break236_g478.z));
|
|
34
|
+
float3 OUT_Leafs_Standalone244_g478 = appendResult237_g478;
|
|
35
|
+
float3 m_Leaves252_g478 = OUT_Leafs_Standalone244_g478;
|
|
36
|
+
float3 ase_worldNormal = worldNorm;
|
|
37
|
+
float3 normalizedWorldNormal = normalize(ase_worldNormal);
|
|
38
|
+
float3 appendResult234_g478 = (float3((normalizedWorldNormal.x * vertCol.g), (normalizedWorldNormal.y / vertCol.r), (normalizedWorldNormal.z * vertCol.g)));
|
|
39
|
+
float3 OUT_Palm_Standalone243_g478 = (((FUNC_SinFunction195_g478 * vertCol.b * (FUNC_Angle73_g478 + (VAR_WindStrength43_g478 / 200.0)) * VAR_GlobalWindTurbulence194_g478) * appendResult234_g478) + FUNC_vertexPos123_g478);
|
|
40
|
+
float3 m_Palm252_g478 = OUT_Palm_Standalone243_g478;
|
|
41
|
+
float3 break221_g478 = FUNC_vertexPos123_g478;
|
|
42
|
+
float temp_output_202_0_g478 = (FUNC_SinFunction195_g478 * vertCol.b * (FUNC_Angle73_g478 + (VAR_WindStrength43_g478 / 200.0)));
|
|
43
|
+
float lerpResult203_g478 = lerp(0.0, temp_output_202_0_g478, VAR_xLerp83_g478);
|
|
44
|
+
float lerpResult196_g478 = lerp(0.0, temp_output_202_0_g478, VAR_zLerp95_g478);
|
|
45
|
+
float3 appendResult197_g478 = (float3((break221_g478.x + lerpResult203_g478), break221_g478.y, (break221_g478.z + lerpResult196_g478)));
|
|
46
|
+
float3 OUT_Grass_Standalone245_g478 = appendResult197_g478;
|
|
47
|
+
float3 m_Grass252_g478 = OUT_Grass_Standalone245_g478;
|
|
48
|
+
float3 m_None252_g478 = FUNC_vertexPos123_g478;
|
|
49
|
+
float3 localIf252_g478 = If252_g478(m_Switch252_g478, m_Leaves252_g478, m_Palm252_g478, m_Grass252_g478, m_None252_g478);
|
|
50
|
+
float3 OUT_Leafs262_g478 = localIf252_g478;
|
|
51
|
+
float3 temp_output_5_0_g478 = mul(GetWorldToObjectMatrix(), float4(OUT_Leafs262_g478, 0.0)).xyz;
|
|
52
|
+
float3 OUT_VertexPos261 = temp_output_5_0_g478;
|
|
53
|
+
|
|
54
|
+
output = OUT_VertexPos261;
|
|
55
|
+
}
|
package/Shaders.meta
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "com.warwlock.mtree",
|
|
3
|
+
"displayName": "MTree",
|
|
4
|
+
"version": "1.0.2",
|
|
5
|
+
"unity": "2021.3",
|
|
6
|
+
"unityRelease": "45f2",
|
|
7
|
+
"description": "A powerful procedural tree creation tool for Unity. Now it is completely Open Source (MIT).",
|
|
8
|
+
"documentationUrl": "https://github.com/Warwlock/MTree/blob/main/Documentation~/Documentation.md",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"licensesUrl": "https://github.com/Warwlock/MTree/blob/main/LICENSE.md",
|
|
11
|
+
"changelogUrl": "https://github.com/Warwlock/MTree/blob/main/CHANGELOG.md",
|
|
12
|
+
"author": "Warwlock",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"unity",
|
|
15
|
+
"rendering",
|
|
16
|
+
"graphics",
|
|
17
|
+
"procedural"
|
|
18
|
+
],
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/Warwlock/MTree/issues"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "ssh://git@github.com:Warwlock/MTree.git"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"com.unity.shadergraph": "12.1.16"
|
|
28
|
+
},
|
|
29
|
+
"samples": [
|
|
30
|
+
{
|
|
31
|
+
"displayName": "Example Templates",
|
|
32
|
+
"description": "A demo scene containing example MTree Templates.",
|
|
33
|
+
"path": "Samples~/ExampleTemplates"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|