chore: update shading

master
hoba 10 months ago
parent c8e813ae70
commit c0c267339d
  1. 137
      Assets/Main.unity
  2. 6
      Assets/Main/Ground.mat
  3. 150
      Assets/Main/Skybox.mat
  4. 8
      Assets/Main/Skybox.mat.meta
  5. 2
      Assets/Resources/New GoldbergPolyhedron.gph.meta
  6. 136
      Assets/Resources/New Material 1.mat
  7. 8
      Assets/Resources/New Material 1.mat.meta
  8. 22
      Assets/Resources/New Material.mat
  9. 2701
      Assets/Resources/New VFX.vfx
  10. 14
      Assets/Resources/New VFX.vfx.meta
  11. 1
      Assets/UltraCombos.Metamesh/Editor/GeodesicMesh.cs
  12. 25
      Assets/UltraCombos.Metamesh/Editor/GoldbergBuilder.cs
  13. 8
      Assets/UltraCombos.Metamesh/Editor/GoldbergPolyhedronImporter.cs
  14. 14
      Assets/UltraCombos.Metamesh/Runtime/Extensions.cs
  15. 8
      Assets/UltraCombos.Metamesh/Runtime/Shader.meta
  16. 5875
      Assets/UltraCombos.Metamesh/Runtime/Shader/Shield.shadergraph
  17. 10
      Assets/UltraCombos.Metamesh/Runtime/Shader/Shield.shadergraph.meta
  18. 27
      Assets/UltraCombos.Metamesh/Runtime/Shader/Utility.hlsl
  19. 7
      Assets/UltraCombos.Metamesh/Runtime/Shader/Utility.hlsl.meta
  20. 1
      Packages/manifest.json
  21. 9
      Packages/packages-lock.json
  22. 15
      ProjectSettings/VFXManager.asset

@ -26,7 +26,7 @@ RenderSettings:
m_AmbientIntensity: 1 m_AmbientIntensity: 1
m_AmbientMode: 0 m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} m_SkyboxMaterial: {fileID: 2100000, guid: c32a369c4f0f8874e9d73cf16d086cad, type: 2}
m_HaloStrength: 0.5 m_HaloStrength: 0.5
m_FlareStrength: 1 m_FlareStrength: 1
m_FlareFadeSpeed: 3 m_FlareFadeSpeed: 3
@ -234,7 +234,7 @@ Transform:
m_GameObject: {fileID: 203844586} m_GameObject: {fileID: 203844586}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -289,7 +289,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &558107427 --- !u!4 &558107427
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -577,7 +577,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647 m_StaticEditorFlags: 2147483647
m_IsActive: 1 m_IsActive: 0
--- !u!64 &697948583 --- !u!64 &697948583
MeshCollider: MeshCollider:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -984,31 +984,31 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: -0.35572362 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: m_LocalRotation.x propertyPath: m_LocalRotation.x
value: 0.048700657 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: 0.93008095 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0.07770764 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
value: -10.323 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: m_LocalEulerAnglesHint.y propertyPath: m_LocalEulerAnglesHint.y
value: -138.326 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: -364223573239433514, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 1082.057 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2163061155770630284, guid: 666014e54879dc1479f1c29bea163dd4, type: 3} - target: {fileID: 2163061155770630284, guid: 666014e54879dc1479f1c29bea163dd4, type: 3}
propertyPath: 'm_Materials.Array.data[0]' propertyPath: 'm_Materials.Array.data[0]'
@ -1239,6 +1239,120 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1866269551} m_GameObject: {fileID: 1866269551}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &2072845789
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2072845792}
- component: {fileID: 2072845791}
- component: {fileID: 2072845790}
m_Layer: 0
m_Name: Visual Effect
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!73398921 &2072845790
VFXRenderer:
serializedVersion: 1
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2072845789}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!2083052967 &2072845791
VisualEffect:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2072845789}
m_Enabled: 1
m_Asset: {fileID: 8926484042661614526, guid: 4f35392b7c1a72e4f956e3e62a1935e4, type: 3}
m_InitialEventName: OnPlay
m_InitialEventNameOverriden: 0
m_StartSeed: 0
m_ResetSeedOnPlay: 1
m_AllowInstancing: 1
m_ResourceVersion: 1
m_PropertySheet:
m_Float:
m_Array: []
m_Vector2f:
m_Array: []
m_Vector3f:
m_Array: []
m_Vector4f:
m_Array: []
m_Uint:
m_Array: []
m_Int:
m_Array: []
m_Matrix4x4f:
m_Array: []
m_AnimationCurve:
m_Array: []
m_Gradient:
m_Array: []
m_NamedObject:
m_Array: []
m_Bool:
m_Array: []
--- !u!4 &2072845792
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2072845789}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2116198337 --- !u!1 &2116198337
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2365,3 +2479,4 @@ SceneRoots:
- {fileID: 604712594} - {fileID: 604712594}
- {fileID: 505702790} - {fileID: 505702790}
- {fileID: 1427021447} - {fileID: 1427021447}
- {fileID: 2072845792}

@ -106,7 +106,7 @@ Material:
- _Parallax: 0.005 - _Parallax: 0.005
- _QueueOffset: 0 - _QueueOffset: 0
- _ReceiveShadows: 1 - _ReceiveShadows: 1
- _Smoothness: 0.5 - _Smoothness: 0.1
- _SmoothnessTextureChannel: 0 - _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1 - _SpecularHighlights: 1
- _SrcBlend: 1 - _SrcBlend: 1
@ -115,8 +115,8 @@ Material:
- _WorkflowMode: 1 - _WorkflowMode: 1
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:
- _BaseColor: {r: 0.65099996, g: 0.65099996, b: 0.65099996, a: 1} - _BaseColor: {r: 0.0754717, g: 0.0751157, b: 0.0751157, a: 1}
- _Color: {r: 0.6509999, g: 0.6509999, b: 0.6509999, a: 1} - _Color: {r: 0.07547168, g: 0.07511567, b: 0.07511567, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []

@ -0,0 +1,150 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Skybox
m_Shader: {fileID: 108, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _MAPPING_LATITUDE_LONGITUDE_LAYOUT
- _SUNDISK_HIGH_QUALITY
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _AtmosphereThickness: 1
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _Exposure: 1.3
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _ImageType: 0
- _Layout: 0
- _Mapping: 1
- _Metallic: 0
- _MirrorOnBack: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Rotation: 0
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _SunDisk: 2
- _SunSize: 0.04
- _SunSizeConvergence: 5
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _GroundColor: {r: 0.36899996, g: 0.34899998, b: 0.34099993, a: 1}
- _SkyTint: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tint: {r: 0.1, g: 0.1, b: 0.1, a: 0.5}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &5365457245102889590
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 9

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c32a369c4f0f8874e9d73cf16d086cad
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -9,7 +9,7 @@ ScriptedImporter:
assetBundleVariant: assetBundleVariant:
script: {fileID: 11500000, guid: 80f1e0e8eacc4a945b07bba9e3065c99, type: 3} script: {fileID: 11500000, guid: 80f1e0e8eacc4a945b07bba9e3065c99, type: 3}
radius: 1 radius: 1
m: 14 m: 32
n: 1 n: 1
generateLightmapUVs: 0 generateLightmapUVs: 0
readWriteMeshes: 0 readWriteMeshes: 0

@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-1389300407495691569
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 9
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Material 1
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0.879
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.407
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f2da2eb3d9933114aacc2ae12696b826
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -21,7 +21,7 @@ Material:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: New Material m_Name: New Material
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} m_Shader: {fileID: -6465566751694194690, guid: f54a2122e01a57f43b78042b1bf343cb, type: 3}
m_Parent: {fileID: 0} m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0 m_ModifiedSerializedProperties: 0
m_ValidKeywords: [] m_ValidKeywords: []
@ -29,9 +29,8 @@ Material:
m_LightmapFlags: 4 m_LightmapFlags: 4
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1 m_DoubleSidedGI: 1
m_CustomRenderQueue: 2000 m_CustomRenderQueue: -1
stringTagMap: stringTagMap: {}
RenderType: Opaque
disabledShaderPasses: disabledShaderPasses:
- MOTIONVECTORS - MOTIONVECTORS
m_LockedProperties: m_LockedProperties:
@ -110,26 +109,37 @@ Material:
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
- _DstBlend: 0 - _DstBlend: 0
- _DstBlendAlpha: 0 - _DstBlendAlpha: 0
- _Edge1: 0.06
- _Edge2: 0.04
- _EnvironmentReflections: 1 - _EnvironmentReflections: 1
- _GlossMapScale: 0 - _GlossMapScale: 0
- _Glossiness: 0 - _Glossiness: 0
- _GlossyReflections: 0 - _GlossyReflections: 0
- _Metallic: 0.923 - _Metallic: 0
- _Noise_Strength: -0.13
- _Normal_Strength: 8
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _Parallax: 0.005 - _Parallax: 0.005
- _QueueControl: 0
- _QueueOffset: 0 - _QueueOffset: 0
- _Rate: 0.03
- _ReceiveShadows: 1 - _ReceiveShadows: 1
- _Roughness: 1
- _Smooth: 0.01
- _Smoothness: 0.862 - _Smoothness: 0.862
- _SmoothnessTextureChannel: 0 - _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1 - _SpecularHighlights: 1
- _SrcBlend: 1 - _SrcBlend: 1
- _SrcBlendAlpha: 1 - _SrcBlendAlpha: 1
- _Surface: 0 - _Surface: 0
- _Time_Speed: 0.1
- _UV_Scale: 2.21
- _WorkflowMode: 1 - _WorkflowMode: 1
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1} - _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 0.29803923}
- _Emission: {r: 0.37657946, g: 0.67080295, b: 0.7369461, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 4f35392b7c1a72e4f956e3e62a1935e4
VisualEffectImporter:
externalObjects: {}
serializedVersion: 1
template:
name:
category:
description:
icon: {instanceID: 0}
thumbnail: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -903,7 +903,6 @@ namespace Metamesh
public static GeodesicData BuildGeodesicData(PrimaryIsoTriangle primTri) public static GeodesicData BuildGeodesicData(PrimaryIsoTriangle primTri)
{ {
float PHI = (1 + Mathf.Sqrt(5f)) / 2;
var geodesicData = new GeodesicData( var geodesicData = new GeodesicData(
"Geodesic-m-n", "Geodesic-m-n",
"Geodesic", "Geodesic",

@ -26,6 +26,7 @@ namespace Metamesh
public List<int> indices; public List<int> indices;
public List<Vector3> normals; public List<Vector3> normals;
public List<Vector2> uvs; public List<Vector2> uvs;
public List<Vector4> barycentrics;
} }
private static VertexData CreateGoldbergVertexData(GoldbergVertexDataOption options, PolyhedronData goldbergData) private static VertexData CreateGoldbergVertexData(GoldbergVertexDataOption options, PolyhedronData goldbergData)
@ -39,6 +40,7 @@ namespace Metamesh
var indices = new List<int>(); var indices = new List<int>();
var normals = new List<Vector3>(); var normals = new List<Vector3>();
var uvs = new List<Vector2>(); var uvs = new List<Vector2>();
var barycentrics = new List<Vector4>();
var minX = float.MaxValue; var minX = float.MaxValue;
var maxX = float.MinValue; var maxX = float.MinValue;
@ -57,9 +59,9 @@ namespace Metamesh
for (var f = 0; f < goldbergData.face.Count; f++) for (var f = 0; f < goldbergData.face.Count; f++)
{ {
var verts = goldbergData.face[f]; var verts = goldbergData.face[f];
if (verts[0] >= goldbergData.vertex.Count || verts[1] >= goldbergData.vertex.Count || verts[2] >= goldbergData.vertex.Count) if (verts.Any(v => v >= goldbergData.vertex.Count))
{ {
Debug.LogWarning($"{verts[0]} | {verts[1]} | {verts[2]} > {goldbergData.vertex.Count}"); Debug.LogWarning($"Polygon#{f} has some index > {goldbergData.vertex.Count}");
continue; continue;
} }
var a = goldbergData.vertex[verts[0]]; var a = goldbergData.vertex[verts[0]];
@ -68,18 +70,32 @@ namespace Metamesh
var ba = b - a; var ba = b - a;
var ca = c - a; var ca = c - a;
var norm = Vector3.Cross(ca, ba).normalized; var norm = Vector3.Cross(ca, ba).normalized;
var x = verts.Average(v => goldbergData.vertex[v].x);
var y = verts.Average(v => goldbergData.vertex[v].y);
var z = verts.Average(v => goldbergData.vertex[v].z);
var centroid = new Vector3(x, y, z);
var rot = Quaternion.FromToRotation(norm, Vector3.up);
var mtx = Matrix4x4.TRS(Vector3.zero, rot, Vector3.one);
var right = mtx.MultiplyVector(a - centroid);
var angle = Vector2.SignedAngle(new Vector2(right.x, right.z), Vector2.right) * Mathf.Deg2Rad;
for (var v = 0; v < verts.Count; v++) for (var v = 0; v < verts.Count; v++)
{ {
normals.Add(norm); normals.Add(norm);
var pdata = goldbergData.vertex[verts[v]]; var pdata = goldbergData.vertex[verts[v]];
positions.Add(new Vector3(pdata[0] * sizeX, pdata[1] * sizeY, pdata[2] * sizeZ)); var pos = pdata;//new Vector3(pdata.x * sizeX, pdata.y * sizeY, pdata.z * sizeZ);
positions.Add(pos);
var vCoord = (pdata[1] * sizeY - minY) / (maxY - minY); var vCoord = (pdata[1] * sizeY - minY) / (maxY - minY);
uvs.Add(new Vector2((pdata[0] * sizeX - minX) / (maxX - minX), vCoord)); uvs.Add(new Vector3((pdata[0] * sizeX - minX) / (maxX - minX), vCoord, f));
var dir = mtx.MultiplyVector(pos - centroid);
var braycentric = new Vector2(dir.x, dir.z).Rotate(angle).normalized * 0.5f;
barycentrics.Add(new Vector4(braycentric.x, braycentric.y, verts.Count, f));
} }
for (var v = 0; v < verts.Count - 2; v++) for (var v = 0; v < verts.Count - 2; v++)
{ {
indices.AddRange(new int[] { index, index + v + 1, index + v + 2 }); indices.AddRange(new int[] { index, index + v + 1, index + v + 2 });
} }
index += verts.Count; index += verts.Count;
} }
@ -89,6 +105,7 @@ namespace Metamesh
indices = indices, indices = indices,
normals = normals, normals = normals,
uvs = uvs, uvs = uvs,
barycentrics = barycentrics,
}; };
} }

@ -10,7 +10,7 @@ namespace Metamesh
[ScriptedImporter(1, "gph")] [ScriptedImporter(1, "gph")]
public class GoldbergPolyhedronImporter : ScriptedImporter public class GoldbergPolyhedronImporter : ScriptedImporter
{ {
[SerializeField] float radius = 1; //[SerializeField] float radius = 1;
[SerializeField, Min(1)] int m = 1; [SerializeField, Min(1)] int m = 1;
[SerializeField, Min(0)] int n = 0; [SerializeField, Min(0)] int n = 0;
@ -49,7 +49,7 @@ namespace Metamesh
var options = new GoldbergBuilder.GoldbergCreationOption() var options = new GoldbergBuilder.GoldbergCreationOption()
{ {
size = radius, size = 1,
m = m, m = m,
n = n, n = n,
}; };
@ -57,11 +57,15 @@ namespace Metamesh
var vertices = data.vertices; var vertices = data.vertices;
var normals = data.normals; var normals = data.normals;
var indices = data.indices; var indices = data.indices;
var uvs = data.uvs;
var barycentrics = data.barycentrics;
if (vertices.Count > 65535) mesh.indexFormat = IndexFormat.UInt32; if (vertices.Count > 65535) mesh.indexFormat = IndexFormat.UInt32;
mesh.SetVertices(vertices); mesh.SetVertices(vertices);
mesh.SetNormals(normals); mesh.SetNormals(normals);
mesh.SetIndices(indices, MeshTopology.Triangles, 0); mesh.SetIndices(indices, MeshTopology.Triangles, 0);
mesh.SetUVs(0, uvs);
mesh.SetUVs(1, barycentrics);
mesh.RecalculateBounds(); mesh.RecalculateBounds();
//mesh.RecalculateNormals(); //mesh.RecalculateNormals();

@ -1,5 +1,19 @@
using UnityEngine; using UnityEngine;
public static class Vector2Extensions
{
public static Vector2 Rotate(this Vector2 vector, float angle)
{
float cosAngle = Mathf.Cos(angle);
float sinAngle = Mathf.Sin(angle);
float xNew = cosAngle * vector.x - sinAngle * vector.y;
float yNew = sinAngle * vector.x + cosAngle * vector.y;
return new Vector2(xNew, yNew);
}
}
public static class Vector2IntExtensions public static class Vector2IntExtensions
{ {
public static Vector2Int Rotate60About(this Vector2Int vector, Vector2Int other) public static Vector2Int Rotate60About(this Vector2Int vector, Vector2Int other)

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5124c4bb357d31b4e99a71b428e0d8a9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f54a2122e01a57f43b78042b1bf343cb
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

@ -0,0 +1,27 @@
void PolygonEdgeDistance_float(float2 P, float n, out float distance) {
float R = 0.5;
float TAU = 2.0 * 3.14159265359;
n = round(n);
float rP = length(P);
float thetaP = atan2(P.y, P.x);
thetaP = fmod(thetaP + TAU, TAU);
float angleStep = TAU / n;
int k = int(floor(thetaP / angleStep)) % int(n);
float theta_k = k * angleStep;
float2 p1 = R * float2(cos(theta_k), sin(theta_k));
float2 p2 = R * float2(cos(theta_k + angleStep), sin(theta_k + angleStep));
float2 edgeDir = p2 - p1;
float2 toP = P - p1;
float edgeLength = length(edgeDir);
float t = dot(toP, edgeDir) / (edgeLength * edgeLength);
t = saturate(t);
float2 closestPoint = p1 + t * edgeDir;
distance = length(P - closestPoint);
}

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 878855eba61f4744d86eef12c1fc8796
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -15,6 +15,7 @@
"com.unity.render-pipelines.universal": "17.0.3", "com.unity.render-pipelines.universal": "17.0.3",
"com.unity.timeline": "1.8.7", "com.unity.timeline": "1.8.7",
"com.unity.ugui": "2.0.0", "com.unity.ugui": "2.0.0",
"com.unity.visualeffectgraph": "17.0.3",
"jp.keijiro.metamesh": "1.2.0" "jp.keijiro.metamesh": "1.2.0"
} }
} }

@ -171,6 +171,15 @@
"com.unity.modules.imgui": "1.0.0" "com.unity.modules.imgui": "1.0.0"
} }
}, },
"com.unity.visualeffectgraph": {
"version": "17.0.3",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.shadergraph": "17.0.3",
"com.unity.render-pipelines.core": "17.0.3"
}
},
"jp.keijiro.metamesh": { "jp.keijiro.metamesh": {
"version": "1.2.0", "version": "1.2.0",
"depth": 0, "depth": 0,

@ -3,10 +3,17 @@
--- !u!937362698 &1 --- !u!937362698 &1
VFXManager: VFXManager:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_IndirectShader: {fileID: 0} m_IndirectShader: {fileID: 7200000, guid: 84a17cfa13e40ae4082ef42714f0a81c, type: 3}
m_CopyBufferShader: {fileID: 0} m_CopyBufferShader: {fileID: 7200000, guid: 23c51f21a3503f6428b527b01f8a2f4e, type: 3}
m_SortShader: {fileID: 0} m_SortShader: {fileID: 7200000, guid: ea257ca3cfb12a642a5025e612af6b2a, type: 3}
m_StripUpdateShader: {fileID: 0} m_StripUpdateShader: {fileID: 7200000, guid: 8fa6c4009fe2a4d4486c62736fc30ad8, type: 3}
m_EmptyShader: {fileID: 4800000, guid: 33a2079f6a2db4c4eb2e44b33f4ddf6b, type: 3}
m_RenderPipeSettingsPath: m_RenderPipeSettingsPath:
m_FixedTimeStep: 0.016666668 m_FixedTimeStep: 0.016666668
m_MaxDeltaTime: 0.05 m_MaxDeltaTime: 0.05
m_MaxScrubTime: 30
m_MaxCapacity: 100000000
m_CompiledVersion: 7
m_RuntimeVersion: 38
m_RuntimeResources: {fileID: 11400000, guid: bc10b42afe3813544bffd38ae2cd893d, type: 2}
m_BatchEmptyLifetime: 300