Gravity grid-lowering: the drawn height is one Gravity Field pass over the zone's wells; gravity brushes and brush inputs deleted
Zone.WellReference owns each body's reference zero (GetHeight uses it). Gravity.cginc mirrors GravityField.Potential; Brushes/Gravity Field draws depth = -h on layer 9 from a StructuredBuffer that GravityLowering.Lower fills from the zone each frame; GravityLowering.CreateField makes the one quad. GravityFieldParityVerify renders it and compares every texel with -Zone.GetHeight (max error 0.0059 u), the gradient with GetForce (0.03 degrees) and the wiring. Deleted: the Gravity Well children of Planet, Gas Giant, Sun and PlanetOutpost prefabs, Wormhole 1's three gravity children, their overrides in Main Menu and TestScene, five wormhole/wave materials and two brush shaders, Planet.GravityWellDepth/Radius, BodyData keys 6-7, PlanetSettings.GravityDepth/GravityRadius (and the Settings.asset keys). Surface Displacement culls layer 9 only. Headless build and tests not yet run at this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c4dfd905ff
commit
3a5b3b0bab
42 changed files with 504 additions and 1301 deletions
|
|
@ -81,87 +81,6 @@ MeshRenderer:
|
|||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &7783244517717541194
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7783244517717541195}
|
||||
- component: {fileID: 7783244517717541175}
|
||||
- component: {fileID: 7783244517717541174}
|
||||
m_Layer: 9
|
||||
m_Name: Gravity Well
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7783244517717541195
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7783244517717541194}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7783244518521719148}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &7783244517717541175
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7783244517717541194}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &7783244517717541174
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7783244517717541194}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 44a8bbb89acb4e34c9f41a9da5842bb4, type: 2}
|
||||
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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &7783244518317531027
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -289,7 +208,6 @@ Transform:
|
|||
m_Children:
|
||||
- {fileID: 589192530128514016}
|
||||
- {fileID: 7783244518317531036}
|
||||
- {fileID: 7783244517717541195}
|
||||
- {fileID: 7783244516809707565}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -307,7 +225,6 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Body: {fileID: 7783244518317531038}
|
||||
GravityWell: {fileID: 7783244517717541174}
|
||||
Icon: {fileID: 7783244516809707566}
|
||||
Generator: {fileID: 741236912059895623}
|
||||
--- !u!114 &741236912059895623
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ Material:
|
|||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Gravity Well
|
||||
m_Shader: {fileID: 4800000, guid: 268da230635cfb34ab4ed6ad39503fa0, type: 3}
|
||||
m_Name: Gravity Field
|
||||
m_Shader: {fileID: 4800000, guid: 08d8efa80af84065b54c9bfed784e435, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
|
|
@ -57,8 +57,6 @@ Material:
|
|||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 1
|
||||
- _Depth: 80
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
|
|
@ -68,7 +66,6 @@ Material:
|
|||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Power: 16
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Gravity Waves
|
||||
m_Shader: {fileID: 4800000, guid: 8a8e593b17063b54ea02f7ea5363b59d, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _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}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _Depth: 3.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _Frequency: 27.43
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Phase: 0
|
||||
- _Power: 8
|
||||
- _SinePower: 1.25
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 11fbaa87dcc7a3743a6bd3aa5c86e5ae
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Wormhole Gravity 1
|
||||
m_Shader: {fileID: 4800000, guid: 268da230635cfb34ab4ed6ad39503fa0, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _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}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 1
|
||||
- _Depth: 54
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Power: 4
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 244f3e4c0c030a24b8d7aa944895bdcf
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Wormhole Gravity 1
|
||||
m_Shader: {fileID: 4800000, guid: 268da230635cfb34ab4ed6ad39503fa0, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _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}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 1
|
||||
- _Depth: 54
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Power: 4
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0ec0689c58b99c64297b3e429e1d9112
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
%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: Wormhole Gravity
|
||||
m_Shader: {fileID: 4800000, guid: 268da230635cfb34ab4ed6ad39503fa0, type: 3}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _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}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.15
|
||||
- _Depth: 2000
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Power: 64
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a9ef17c902709ce41a837c54b809184b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Wormhole Waves
|
||||
m_Shader: {fileID: 4800000, guid: 8681ac064d59d15458d16cc9b884262c, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _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}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _Depth: 33.9
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _Frequency: 2
|
||||
- _FrequencyDist: 60
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Power: 2
|
||||
- _SinePower: 1.25
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _Speed: 15
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ef2f6090d5cc14a4e9ce38def3bed9ac
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -30,7 +30,6 @@ Transform:
|
|||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 3973935122748960680}
|
||||
- {fileID: 3973935121058605868}
|
||||
- {fileID: 3973935121358855036}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -48,93 +47,9 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Body: {fileID: 3973935122748960683}
|
||||
GravityWell: {fileID: 3973935121058605871}
|
||||
Icon: {fileID: 3973935121358855037}
|
||||
Generator: {fileID: 0}
|
||||
SunMaterial: {fileID: 3973935122748960685}
|
||||
--- !u!1 &3973935121058605867
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3973935121058605868}
|
||||
- component: {fileID: 3973935121058605856}
|
||||
- component: {fileID: 3973935121058605871}
|
||||
m_Layer: 9
|
||||
m_Name: Gravity Well
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3973935121058605868
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3973935121058605867}
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3973935120991099173}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &3973935121058605856
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3973935121058605867}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &3973935121058605871
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3973935121058605867}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 44a8bbb89acb4e34c9f41a9da5842bb4, type: 2}
|
||||
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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &3973935121358855035
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -83,89 +83,6 @@ MeshRenderer:
|
|||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &8859079004671924238
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8859079004671924239}
|
||||
- component: {fileID: 8859079004671924339}
|
||||
- component: {fileID: 8859079004671924338}
|
||||
m_Layer: 9
|
||||
m_Name: Gravity Well
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8859079004671924239
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8859079004671924238}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8859079004937162792}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &8859079004671924339
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8859079004671924238}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &8859079004671924338
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8859079004671924238}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 44a8bbb89acb4e34c9f41a9da5842bb4, type: 2}
|
||||
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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &8859079004937162791
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -197,7 +114,6 @@ Transform:
|
|||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8859079005270853336}
|
||||
- {fileID: 8859079004671924239}
|
||||
- {fileID: 8859079003226229097}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -215,7 +131,6 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Body: {fileID: 8859079005270853338}
|
||||
GravityWell: {fileID: 8859079004671924338}
|
||||
Icon: {fileID: 8859079003226229098}
|
||||
Generator: {fileID: -7153121627769399805}
|
||||
--- !u!114 &-7153121627769399805
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ Transform:
|
|||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 7852221720971737233}
|
||||
- {fileID: 7852221720969441490}
|
||||
- {fileID: 7852221720816817928}
|
||||
- {fileID: 7852221720964551245}
|
||||
m_Father: {fileID: 0}
|
||||
|
|
@ -49,7 +48,6 @@ MonoBehaviour:
|
|||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Body: {fileID: 7852221720971737229}
|
||||
GravityWell: {fileID: 7852221720969441484}
|
||||
Icon: {fileID: 7852221720964551246}
|
||||
Generator: {fileID: 0}
|
||||
SunMaterial: {fileID: 7852221720971737234}
|
||||
|
|
@ -221,89 +219,6 @@ MeshRenderer:
|
|||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &7852221720969441489
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7852221720969441490}
|
||||
- component: {fileID: 7852221720969441485}
|
||||
- component: {fileID: 7852221720969441484}
|
||||
m_Layer: 9
|
||||
m_Name: Gravity Well
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7852221720969441490
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7852221720969441489}
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7852221720480299767}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &7852221720969441485
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7852221720969441489}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &7852221720969441484
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7852221720969441489}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 44a8bbb89acb4e34c9f41a9da5842bb4, type: 2}
|
||||
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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &7852221720971737232
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -1,167 +1,5 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1826894967093516808
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1030590306481442051}
|
||||
- component: {fileID: 3216580199816124320}
|
||||
- component: {fileID: 3211969211988968959}
|
||||
m_Layer: 9
|
||||
m_Name: Gravity Well
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1030590306481442051
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1826894967093516808}
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1024, y: 1024, z: 1024}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 463084220523011477}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &3216580199816124320
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1826894967093516808}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &3211969211988968959
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1826894967093516808}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 244f3e4c0c030a24b8d7aa944895bdcf, type: 2}
|
||||
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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &3908760799087214860
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 581261949390603689}
|
||||
- component: {fileID: 987447324816385543}
|
||||
- component: {fileID: 3959510878930752720}
|
||||
m_Layer: 9
|
||||
m_Name: Gravity Waves
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &581261949390603689
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3908760799087214860}
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 512, y: 512, z: 512}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 463084220523011477}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &987447324816385543
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3908760799087214860}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &3959510878930752720
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3908760799087214860}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: ef2f6090d5cc14a4e9ce38def3bed9ac, type: 2}
|
||||
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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &4837153162502999620
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -189,9 +27,6 @@ Transform:
|
|||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8222188360457572195}
|
||||
- {fileID: 1030590306481442051}
|
||||
- {fileID: 581261949390603689}
|
||||
- {fileID: 8249320701965103923}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
|
|
@ -277,84 +112,3 @@ MeshRenderer:
|
|||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!1 &7647029665738834910
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8222188360457572195}
|
||||
- component: {fileID: 2468954688819198096}
|
||||
- component: {fileID: 8290522694236574882}
|
||||
m_Layer: 9
|
||||
m_Name: Gravity Pit
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8222188360457572195
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7647029665738834910}
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 512, y: 512, z: 512}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 463084220523011477}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &2468954688819198096
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7647029665738834910}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &8290522694236574882
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7647029665738834910}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a9ef17c902709ce41a837c54b809184b, type: 2}
|
||||
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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
|
|
|
|||
BIN
Assets/Resources/Settings.asset
(Stored with Git LFS)
BIN
Assets/Resources/Settings.asset
(Stored with Git LFS)
Binary file not shown.
|
|
@ -16416,6 +16416,7 @@ MonoBehaviour:
|
|||
MapGravityMaterials:
|
||||
- {fileID: 2100000, guid: 841e4091d19548347bd59115047b4e49, type: 2}
|
||||
- {fileID: 2100000, guid: a92fc6d958edb9f46b6e58134f609cc0, type: 2}
|
||||
GravityField: {fileID: 2100000, guid: 44a8bbb89acb4e34c9f41a9da5842bb4, type: 2}
|
||||
Tour: 0
|
||||
TourSwitchTime: 10
|
||||
TourFollowDistance: 100
|
||||
|
|
@ -23473,7 +23474,7 @@ Camera:
|
|||
m_Depth: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1536
|
||||
m_Bits: 512
|
||||
m_RenderingPath: 1
|
||||
m_TargetTexture: {fileID: 8400000, guid: 2fc21a9d3e9647948b56e384cd9378b3, type: 2}
|
||||
m_TargetDisplay: 0
|
||||
|
|
|
|||
|
|
@ -1076,16 +1076,6 @@ PrefabInstance:
|
|||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: b9f52544f98f47146b486fb6e27179bb, type: 2}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 512
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 512
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720971737233, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
|
|
|
|||
|
|
@ -911,16 +911,6 @@ PrefabInstance:
|
|||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720971737233, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
|
|
@ -1768,16 +1758,6 @@ PrefabInstance:
|
|||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720971737233, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
|
|
@ -5277,16 +5257,6 @@ PrefabInstance:
|
|||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720969441490, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7852221720971737233, guid: 046dde0f4600bce41ad33c476f99b309,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
|
|
|
|||
275
Assets/Scripts/Editor/GravityFieldParityVerify.cs
Normal file
275
Assets/Scripts/Editor/GravityFieldParityVerify.cs
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using GameCult.Caching;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using CultMath;
|
||||
|
||||
namespace Aetheria.EditorTools
|
||||
{
|
||||
/// <summary>
|
||||
/// Batchmode check for campaign aetheria-gravity, cut grid-lowering: what the Gravity Field pass draws is the sim's
|
||||
/// height. It builds a zone from Settings.asset's PlanetSettings with three bodies, runs the real lowering
|
||||
/// (GravityLowering.Lower and CreateField), renders the field through an orthographic camera that culls layer 9 into
|
||||
/// a float target, and compares every texel with -Zone.GetHeight at the texel centre's world position. It then checks
|
||||
/// that the texture's gradient points where Zone.GetForce does, and that ARPG.unity and the body prefabs are wired
|
||||
/// the way the cut leaves them (the gravity cameras cull layer 9 alone, nothing but the run-time field sits on it).
|
||||
///
|
||||
/// Renders, so it needs a graphics device: run WITHOUT -nographics (as FlowFieldParityVerify).
|
||||
/// Unity -batchmode -projectPath <repo> -executeMethod Aetheria.EditorTools.GravityFieldParityVerify.Run -logFile <path>
|
||||
/// Do not pass -quit: Run exits the Editor itself, 0 on success and 1 on any failure.
|
||||
/// </summary>
|
||||
public static class GravityFieldParityVerify
|
||||
{
|
||||
const string Tag = "[GravityFieldParityVerify]";
|
||||
const int Size = 256;
|
||||
// Measured on this tree (the "max error" line this run prints): the largest |texel + GetHeight| over the three
|
||||
// windows is 0.0059 u, in the planetoid's window (float32 on both sides, the GPU's log against the CPU's, the
|
||||
// quad's interpolated world position). The tolerance is 5x that. A 0.1% error in the tail constant (.5 -> .501)
|
||||
// moves the drawn height by 0.053 u where all three tails reach (the planetoid and zone windows), 1.8x the
|
||||
// tolerance; a reference of zero moves it by about 150 u.
|
||||
const float Tolerance = 0.03f;
|
||||
// The worst angle between the texture's central difference and GetForce (B28: 1.0 degrees median zone, 2.9 worst).
|
||||
const float GradientDegrees = 3f;
|
||||
static float _maxError, _maxAngle;
|
||||
static bool _ok = true;
|
||||
|
||||
static void OnLog(string message, string stack, LogType type)
|
||||
{
|
||||
if ((type == LogType.Error || type == LogType.Exception || type == LogType.Assert) && !message.StartsWith(Tag))
|
||||
Fail("logged-error", message.Split('\n')[0]);
|
||||
}
|
||||
|
||||
static void Fail(string check, string detail)
|
||||
{
|
||||
Debug.LogError($"{Tag} FAIL {check}: {detail}");
|
||||
_ok = false;
|
||||
}
|
||||
|
||||
public static void Run()
|
||||
{
|
||||
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null)
|
||||
{
|
||||
Debug.LogError($"{Tag} FAIL: no graphics device in this session; rerun batchmode without -nographics.");
|
||||
EditorApplication.Exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
Application.logMessageReceived += OnLog;
|
||||
var work = Path.Combine(Path.GetTempPath(), "gravity-parity-" + Guid.NewGuid().ToString("N"));
|
||||
Directory.CreateDirectory(work);
|
||||
ComputeBuffer wells = null;
|
||||
GameObject field = null;
|
||||
try
|
||||
{
|
||||
var settings = AssetDatabase.LoadAssetAtPath<GameSettings>("Assets/Resources/Settings.asset")
|
||||
?? throw new InvalidOperationException("No Settings.asset.");
|
||||
var material = AssetDatabase.LoadAssetAtPath<Material>("Assets/Materials/Brushes/Gravity Field.mat")
|
||||
?? throw new InvalidOperationException("No Gravity Field.mat.");
|
||||
|
||||
var zone = BuildZone(settings, work, out var bodies);
|
||||
GravityLowering.Lower(zone, ref wells);
|
||||
field = GravityLowering.CreateField(material);
|
||||
|
||||
var sun = Core(zone, 14152f);
|
||||
var planetoid = Core(zone, 29.2f);
|
||||
CheckTexels("planetoid", zone, bodies[2], 4f * planetoid);
|
||||
CheckTexels("sun", zone, bodies[0], 4f * sun);
|
||||
CheckTexels("zone", zone, new Vector2(0f, 0f), 1.05f * zone.Pack.Radius);
|
||||
CheckGradient(zone, bodies);
|
||||
Debug.Log($"{Tag} max error {_maxError:G4} u (tolerance {Tolerance:G4}); max gradient angle {_maxAngle:F2} degrees (limit {GradientDegrees:F0})");
|
||||
|
||||
CheckWiring(settings);
|
||||
Debug.Log(_ok ? $"{Tag} PASS" : $"{Tag} FAIL: see errors above");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"{Tag} FAIL exception: {e}");
|
||||
_ok = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Application.logMessageReceived -= OnLog;
|
||||
if (field != null) UnityEngine.Object.DestroyImmediate(field);
|
||||
wells?.Release();
|
||||
try { Directory.Delete(work, true); } catch { }
|
||||
}
|
||||
EditorApplication.Exit(_ok ? 0 : 1);
|
||||
}
|
||||
|
||||
static float Core(Zone zone, float mass) => zone.Settings.CoreRadius.Evaluate(mass);
|
||||
|
||||
// A sun (14152 at the origin), a planet (273.9 at 610) and a planetoid (29.2 at 670): parentless, fixed, so the
|
||||
// zone's wells sit where the verify says before any Update.
|
||||
static Zone BuildZone(GameSettings settings, string work, out Vector2[] positions)
|
||||
{
|
||||
var cache = AetheriaStores.Open(Path.Combine(work, "catalog.cc"), Path.Combine(work, "run.cc"), catalogWritable: true);
|
||||
cache.Upsert(new VerseGrammar { Revision = 1 });
|
||||
cache.FlushAsync().Wait();
|
||||
var items = new ItemManager(cache, new ProvenanceLedger(), settings.GameplaySettings, _ => { });
|
||||
positions = new[] { new Vector2(0f, 0f), new Vector2(610f, 0f), new Vector2(670f, 0f) };
|
||||
var masses = new[] { 14152f, 273.9f, 29.2f };
|
||||
var pack = new ZonePack { Radius = 4182f };
|
||||
for (var i = 0; i < positions.Length; i++)
|
||||
{
|
||||
var orbit = cache.Upsert(new OrbitData { FixedPosition = new float2(positions[i].x, positions[i].y) }).Key;
|
||||
var body = cache.Upsert(new PlanetData
|
||||
{ Name = "Body " + i, Orbit = new CultRecordRef<OrbitData>(orbit), Mass = masses[i] }).Key;
|
||||
pack.Orbits.Add(new CultRecordRef<OrbitData>(orbit));
|
||||
pack.Planets.Add(new CultRecordRef<BodyData>(body));
|
||||
}
|
||||
return new Zone(items, settings.PlanetSettings, pack, new GalaxyZone { Name = "Gravity Parity", Owner = null }, null);
|
||||
}
|
||||
|
||||
// Renders the field through a downward orthographic camera that culls layer 9 only, centred on `centre` with
|
||||
// half-size `half`, and returns the depth of every texel with the world xz of the texel's centre, which is asked
|
||||
// of the camera rather than assumed.
|
||||
static void Render(Vector2 centre, float half, out float[] depth, out Vector2[] world)
|
||||
{
|
||||
var rt = new RenderTexture(Size, Size, 0, RenderTextureFormat.RFloat) { filterMode = FilterMode.Point };
|
||||
var cameraObject = new GameObject("Gravity Parity Camera");
|
||||
var read = new Texture2D(Size, Size, TextureFormat.RFloat, false);
|
||||
var previous = RenderTexture.active;
|
||||
try
|
||||
{
|
||||
var camera = cameraObject.AddComponent<Camera>();
|
||||
camera.orthographic = true;
|
||||
camera.orthographicSize = half;
|
||||
camera.aspect = 1f;
|
||||
camera.nearClipPlane = .3f;
|
||||
camera.farClipPlane = 1000f;
|
||||
camera.cullingMask = 1 << GravityLowering.FieldLayer;
|
||||
camera.clearFlags = CameraClearFlags.SolidColor;
|
||||
camera.backgroundColor = Color.black;
|
||||
camera.allowHDR = false;
|
||||
camera.allowMSAA = false;
|
||||
camera.targetTexture = rt;
|
||||
cameraObject.transform.SetPositionAndRotation(new Vector3(centre.x, 100f, centre.y), Quaternion.Euler(90f, 0f, 0f));
|
||||
camera.Render();
|
||||
|
||||
RenderTexture.active = rt;
|
||||
read.ReadPixels(new Rect(0, 0, Size, Size), 0, 0);
|
||||
read.Apply();
|
||||
depth = read.GetPixelData<float>(0).ToArray();
|
||||
world = new Vector2[Size * Size];
|
||||
for (var y = 0; y < Size; y++)
|
||||
for (var x = 0; x < Size; x++)
|
||||
{
|
||||
var p = camera.ViewportToWorldPoint(new Vector3((x + .5f) / Size, (y + .5f) / Size, 100f));
|
||||
world[y * Size + x] = new Vector2(p.x, p.z);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
RenderTexture.active = previous;
|
||||
UnityEngine.Object.DestroyImmediate(cameraObject);
|
||||
UnityEngine.Object.DestroyImmediate(read);
|
||||
rt.Release();
|
||||
UnityEngine.Object.DestroyImmediate(rt);
|
||||
}
|
||||
}
|
||||
|
||||
static void CheckTexels(string window, Zone zone, Vector2 centre, float half)
|
||||
{
|
||||
Render(centre, half, out var depth, out var world);
|
||||
var worst = 0f;
|
||||
var live = 0;
|
||||
for (var i = 0; i < depth.Length; i++)
|
||||
{
|
||||
var expected = -zone.GetHeight(new float2(world[i].x, world[i].y));
|
||||
if (float.IsNaN(depth[i])) { Fail($"{window}-texels", $"texel {i}: NaN"); return; }
|
||||
var error = Math.Abs(depth[i] - expected);
|
||||
worst = Math.Max(worst, error);
|
||||
if (Math.Abs(expected) > 1f) live++;
|
||||
if (error > Tolerance)
|
||||
{
|
||||
Fail($"{window}-texels", $"texel {i} at ({world[i].x:F2}, {world[i].y:F2}): expected {expected:G6}, drawn {depth[i]:G6}, error {error:G4} > {Tolerance:G4}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
_maxError = Math.Max(_maxError, worst);
|
||||
// A window that draws nothing agrees with a zone that is flat: the check must be live.
|
||||
if (live < depth.Length / 2) Fail($"{window}-texels", $"only {live} of {depth.Length} texels are deeper than 1 u; the check is vacuous");
|
||||
Debug.Log($"{Tag} {window}: {depth.Length} texels, max error {worst:G4} u");
|
||||
}
|
||||
|
||||
// The texture's central difference (over two 4 u texels, mid-zone) points where GetForce does: depth = -h, so its
|
||||
// gradient is the force over the exaggeration. This is what the slope readers (the shader's slopeFlow, the nebula
|
||||
// surface normal, the drawn grid) take from the texture.
|
||||
static void CheckGradient(Zone zone, Vector2[] bodies)
|
||||
{
|
||||
Render(new Vector2(1500f, 0f), 512f, out var depth, out var world);
|
||||
var compared = 0;
|
||||
for (var y = 1; y < Size - 1; y++)
|
||||
for (var x = 1; x < Size - 1; x++)
|
||||
{
|
||||
var here = world[y * Size + x];
|
||||
if (bodies.Any(b => (b - here).magnitude < 16f)) continue;
|
||||
// The world step of each texel axis is read from the camera, so a flipped or rotated target is still measured.
|
||||
var au = world[y * Size + x + 1] - world[y * Size + x - 1];
|
||||
var av = world[(y + 1) * Size + x] - world[(y - 1) * Size + x];
|
||||
var du = depth[y * Size + x + 1] - depth[y * Size + x - 1];
|
||||
var dv = depth[(y + 1) * Size + x] - depth[(y - 1) * Size + x];
|
||||
var det = au.x * av.y - au.y * av.x;
|
||||
var g = new Vector2((du * av.y - dv * au.y) / det, (dv * au.x - du * av.x) / det);
|
||||
var f = zone.GetForce(new float2(here.x, here.y));
|
||||
var angle = Vector2.Angle(g, new Vector2(f.x, f.y));
|
||||
if (float.IsNaN(angle) || angle > GradientDegrees)
|
||||
{
|
||||
Fail("gradient", $"at ({here.x:F1}, {here.y:F1}) the drawn slope points {angle:F2} degrees from the force (limit {GradientDegrees:F0})");
|
||||
return;
|
||||
}
|
||||
_maxAngle = Math.Max(_maxAngle, angle);
|
||||
compared++;
|
||||
}
|
||||
if (compared < Size * Size / 2) Fail("gradient", $"only {compared} texels were compared");
|
||||
}
|
||||
|
||||
static void CheckWiring(GameSettings settings)
|
||||
{
|
||||
var scene = EditorSceneManager.OpenScene("Assets/Scenes/ARPG.unity", OpenSceneMode.Single);
|
||||
try
|
||||
{
|
||||
var gravityTargets = new[] { "Fog Surface Displacement", "Slime Gravity", "MinimapGravity" };
|
||||
var seen = 0;
|
||||
foreach (var camera in UnityEngine.Object.FindObjectsByType<Camera>(FindObjectsInactive.Include, FindObjectsSortMode.None))
|
||||
{
|
||||
if (camera.targetTexture == null || !gravityTargets.Contains(camera.targetTexture.name)) continue;
|
||||
seen++;
|
||||
if (camera.cullingMask != 1 << GravityLowering.FieldLayer)
|
||||
Fail("wiring", $"camera {camera.name} (target {camera.targetTexture.name}) culls mask {camera.cullingMask}, not layer {GravityLowering.FieldLayer} alone");
|
||||
}
|
||||
if (seen < gravityTargets.Length) Fail("wiring", $"only {seen} gravity cameras found in ARPG.unity");
|
||||
|
||||
var renderer = UnityEngine.Object.FindFirstObjectByType<ZoneRenderer>(FindObjectsInactive.Include);
|
||||
if (renderer == null) Fail("wiring", "no ZoneRenderer in ARPG.unity");
|
||||
else if (renderer.GravityField == null || renderer.GravityField.shader.name != "Brushes/Gravity Field")
|
||||
Fail("wiring", "ZoneRenderer.GravityField is not a Brushes/Gravity Field material");
|
||||
|
||||
foreach (var r in UnityEngine.Object.FindObjectsByType<Renderer>(FindObjectsInactive.Include, FindObjectsSortMode.None))
|
||||
if (r.gameObject.layer == GravityLowering.FieldLayer)
|
||||
Fail("wiring", $"renderer {r.name} in ARPG.unity sits on layer {GravityLowering.FieldLayer}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
|
||||
}
|
||||
|
||||
foreach (var path in new[]
|
||||
{
|
||||
"Assets/Prefabs/RPG/Planets/Planet.prefab", "Assets/Prefabs/RPG/Planets/Gas Giant.prefab",
|
||||
"Assets/Prefabs/RPG/Planets/Sun.prefab", "Assets/Prefabs/RPG/Wormhole 1.prefab"
|
||||
})
|
||||
{
|
||||
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(path);
|
||||
if (prefab == null) { Fail("wiring", $"no prefab at {path}"); continue; }
|
||||
foreach (var r in prefab.GetComponentsInChildren<Renderer>(true))
|
||||
if (r.gameObject.layer == GravityLowering.FieldLayer)
|
||||
Fail("wiring", $"renderer {r.name} in {path} sits on layer {GravityLowering.FieldLayer}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Editor/GravityFieldParityVerify.cs.meta
Normal file
11
Assets/Scripts/Editor/GravityFieldParityVerify.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1ceb2bdab0804463b1998471d47e82fa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -13,8 +13,6 @@ using static CultMath.math;
|
|||
[Serializable, MessagePackObject(keyAsPropertyName:true), JsonObject]
|
||||
public class PlanetSettings
|
||||
{
|
||||
public ExponentialCurve GravityDepth;
|
||||
public ExponentialCurve GravityRadius;
|
||||
public ExponentialCurve LightRadius;
|
||||
public ExponentialCurve BodyRadius;
|
||||
|
||||
|
|
|
|||
|
|
@ -612,14 +612,17 @@ public class Zone
|
|||
return security;
|
||||
}
|
||||
|
||||
// The potential of a body's well at the zone's edge, subtracted so every well is zero there: the one owner of the
|
||||
// reference. GetHeight sums with it and the renderer's lowering (GravityLowering) hands it to the shader unchanged.
|
||||
public float WellReference(Planet body) => GravityField.Potential(body.WellStrength, body.CoreRadius, Pack.Radius);
|
||||
|
||||
public float GetHeight(float2 position)
|
||||
{
|
||||
var result = 0f;
|
||||
foreach (var body in PlanetInstances.Values)
|
||||
{
|
||||
var offset = position - body.Orbit.Position;
|
||||
result += GravityField.Potential(body.WellStrength, body.CoreRadius, length(offset))
|
||||
- GravityField.Potential(body.WellStrength, body.CoreRadius, Pack.Radius);
|
||||
result += GravityField.Potential(body.WellStrength, body.CoreRadius, length(offset)) - WellReference(body);
|
||||
}
|
||||
|
||||
return result / Settings.HeightExaggeration;
|
||||
|
|
@ -685,9 +688,6 @@ public class Planet
|
|||
public Orbit Orbit;
|
||||
protected readonly PlanetSettings Settings;
|
||||
public BodyData BodyData;
|
||||
// Brush inputs only (ZoneRenderer's Gravity Well brushes and planet icon); no sim reader. grid-lowering deletes them.
|
||||
public float GravityWellDepth;
|
||||
public float GravityWellRadius;
|
||||
public float BodyRadius;
|
||||
|
||||
// The well (GravityField): strength c and softened core radius R by mass, and the Roche limit, the closest a child
|
||||
|
|
@ -707,8 +707,6 @@ public class Planet
|
|||
public void CalculateProperties()
|
||||
{
|
||||
BodyRadius = Settings.BodyRadius.Evaluate(BodyData.Mass) * BodyData.BodyRadiusMultiplier;
|
||||
GravityWellRadius = Settings.GravityRadius.Evaluate(BodyData.Mass) * BodyData.GravityRadiusMultiplier;
|
||||
GravityWellDepth = Settings.GravityDepth.Evaluate(BodyData.Mass) * BodyData.GravityDepthMultiplier;
|
||||
WellStrength = Settings.WellStrength.Evaluate(BodyData.Mass);
|
||||
CoreRadius = Settings.CoreRadius.Evaluate(BodyData.Mass);
|
||||
RocheLimit = Settings.RocheLimit.Evaluate(BodyData.Mass);
|
||||
|
|
|
|||
|
|
@ -86,12 +86,6 @@ public abstract class BodyData
|
|||
|
||||
[JsonProperty("bodyRadiusMul")] [Key(5)]
|
||||
public float BodyRadiusMultiplier = 1;
|
||||
|
||||
[JsonProperty("gravRadiusMul")] [Key(6)]
|
||||
public float GravityRadiusMultiplier = 1;
|
||||
|
||||
[JsonProperty("depthMul")] [Key(7)]
|
||||
public float GravityDepthMultiplier = 1;
|
||||
}
|
||||
|
||||
[CultDocument("aetheria.planetdata", "1"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
|
|
|
|||
78
Assets/Scripts/Zone Display/GravityLowering.cs
Normal file
78
Assets/Scripts/Zone Display/GravityLowering.cs
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// The renderer's lowering of the zone's potential (aetheria-gravity, cut grid-lowering). Zone.GetHeight owns the drawn
|
||||
/// height: this hands its inputs (each well's position, strength, core radius and reference, and the exaggeration) to
|
||||
/// Assets/Shaders/Gravity.cginc, which sums them per texel, and makes the one quad that carries the sum into every
|
||||
/// camera that culls layer 9. Nothing here decides a height.
|
||||
/// </summary>
|
||||
public static class GravityLowering
|
||||
{
|
||||
/// <summary>The layer the gravity cameras cull; nothing but the run-time field sits on it.</summary>
|
||||
public const int FieldLayer = 9;
|
||||
/// <summary>The quad's side in u: larger than any zone (10000) plus any view (4096); texels outside a camera cost nothing.</summary>
|
||||
public const float FieldExtent = 100000f;
|
||||
|
||||
// Mirrors Gravity.cginc's GravityWell: float2 position, strength, coreRadius, reference.
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct WellRecord
|
||||
{
|
||||
public Vector2 Position;
|
||||
public float Strength;
|
||||
public float CoreRadius;
|
||||
public float Reference;
|
||||
}
|
||||
|
||||
static readonly int Stride = Marshal.SizeOf<WellRecord>();
|
||||
static readonly int WellsId = Shader.PropertyToID("_GravityWells");
|
||||
static readonly int CountId = Shader.PropertyToID("_GravityWellCount");
|
||||
static readonly int ExaggerationId = Shader.PropertyToID("_HeightExaggeration");
|
||||
static WellRecord[] _records = new WellRecord[0];
|
||||
|
||||
/// <summary>
|
||||
/// Fills one record per body of the zone (a null zone has none) and sets the shader globals. The buffer is the
|
||||
/// caller's, (re)allocated to the body count (at least one, so the global is always bound).
|
||||
/// </summary>
|
||||
public static void Lower(Zone zone, ref ComputeBuffer wells)
|
||||
{
|
||||
var count = zone?.PlanetInstances.Count ?? 0;
|
||||
var capacity = Mathf.Max(count, 1);
|
||||
if (wells == null || wells.count != capacity)
|
||||
{
|
||||
wells?.Release();
|
||||
wells = new ComputeBuffer(capacity, Stride);
|
||||
}
|
||||
|
||||
if (_records.Length != capacity) _records = new WellRecord[capacity];
|
||||
var i = 0;
|
||||
if (zone != null)
|
||||
foreach (var body in zone.PlanetInstances.Values)
|
||||
_records[i++] = new WellRecord
|
||||
{
|
||||
Position = new Vector2(body.Orbit.Position.x, body.Orbit.Position.y),
|
||||
Strength = body.WellStrength,
|
||||
CoreRadius = body.CoreRadius,
|
||||
Reference = zone.WellReference(body)
|
||||
};
|
||||
wells.SetData(_records);
|
||||
|
||||
Shader.SetGlobalBuffer(WellsId, wells);
|
||||
Shader.SetGlobalInt(CountId, count);
|
||||
Shader.SetGlobalFloat(ExaggerationId, zone?.Settings.HeightExaggeration ?? 1f);
|
||||
}
|
||||
|
||||
/// <summary>The one quad of the field: flat in xz at y 0 on layer 9, drawn with the Gravity Field material.</summary>
|
||||
public static GameObject CreateField(Material material)
|
||||
{
|
||||
var field = new GameObject("Gravity Field") { layer = FieldLayer };
|
||||
field.transform.rotation = Quaternion.Euler(90f, 0f, 0f);
|
||||
field.transform.localScale = FieldExtent * Vector3.one;
|
||||
field.AddComponent<MeshFilter>().sharedMesh = Resources.GetBuiltinResource<Mesh>("Quad.fbx");
|
||||
var renderer = field.AddComponent<MeshRenderer>();
|
||||
renderer.sharedMaterial = material;
|
||||
renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
||||
renderer.receiveShadows = false;
|
||||
return field;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Zone Display/GravityLowering.cs.meta
Normal file
11
Assets/Scripts/Zone Display/GravityLowering.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1a5e08474b514e509ed1477b3ac06e94
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -9,7 +9,6 @@ using UnityEngine;
|
|||
public class PlanetObject : MonoBehaviour
|
||||
{
|
||||
public MeshRenderer Body;
|
||||
public MeshRenderer GravityWell;
|
||||
public MeshRenderer Icon;
|
||||
public CelestialBodyGenerator Generator;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ public class ZoneRenderer : MonoBehaviour
|
|||
public MineInstance MinePrefab;
|
||||
public VapourCloudInstance CloudPrefab;
|
||||
public Material[] MapGravityMaterials;
|
||||
// The gravity field's material (Brushes/Gravity Field): GravityLowering makes the one quad that draws it.
|
||||
public Material GravityField;
|
||||
|
||||
[Header("Tour")] public bool Tour;
|
||||
public float TourSwitchTime = 5f;
|
||||
|
|
@ -77,7 +79,8 @@ public class ZoneRenderer : MonoBehaviour
|
|||
// is stored on AsteroidBelt any more.
|
||||
private Dictionary<CultRecordKey, float4[]> _beltTransforms = new Dictionary<CultRecordKey, float4[]>();
|
||||
private float _viewDistance;
|
||||
//private float _maxDepth;
|
||||
private GameObject _gravityField;
|
||||
private ComputeBuffer _gravityWells;
|
||||
private float _minimapDistance;
|
||||
|
||||
private int _tourIndex = -1;
|
||||
|
|
@ -195,6 +198,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
SectorBrushes.localScale = zone.Pack.Radius * 2 * Vector3.one;
|
||||
SlimeGravityCamera.orthographicSize = zone.Pack.Radius;
|
||||
SlimeRenderer.ZoneRadius = zone.Pack.Radius;
|
||||
if (_gravityField == null) _gravityField = GravityLowering.CreateField(GravityField);
|
||||
foreach (var p in zone.Planets)
|
||||
LoadPlanet(p.Key, p.Value);
|
||||
|
||||
|
|
@ -321,9 +325,17 @@ public class ZoneRenderer : MonoBehaviour
|
|||
WormholeInstances.Add(wormhole, (instance.gameObject, icon));
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
_gravityWells?.Release();
|
||||
_gravityWells = null;
|
||||
}
|
||||
|
||||
public void ClearZone()
|
||||
{
|
||||
if (Zone == null) return;
|
||||
_gravityWells?.Release();
|
||||
_gravityWells = null;
|
||||
foreach (var wormhole in WormholeInstances.Values)
|
||||
{
|
||||
Destroy(wormhole.gravity);
|
||||
|
|
@ -491,11 +503,6 @@ public class ZoneRenderer : MonoBehaviour
|
|||
|
||||
var planetInstance = Zone.PlanetInstances[key];
|
||||
planet.Body.transform.localScale = planetInstance.BodyRadius * Vector3.one;
|
||||
planet.GravityWell.transform.localScale = planetInstance.GravityWellRadius * Vector3.one;
|
||||
// var depth = planetInstance.GravityWellDepth;
|
||||
// if (depth > _maxDepth) _maxDepth = depth;
|
||||
planet.GravityWell.material.SetFloat("_Depth", planetInstance.GravityWellDepth);
|
||||
planet.Icon.transform.position = new Vector3(0, -planetInstance.GravityWellDepth, 0);
|
||||
planet.Icon.transform.localScale = Settings.IconSize.Evaluate(planetInstance.BodyData.Mass) * Vector3.one;
|
||||
|
||||
|
||||
|
|
@ -513,6 +520,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
void Update()
|
||||
{
|
||||
var maxDepth = 0f;
|
||||
GravityLowering.Lower(Zone, ref _gravityWells);
|
||||
foreach (var loot in _floatingItems.Values)
|
||||
{
|
||||
loot.ViewOrigin = PerspectiveEntity.Position;
|
||||
|
|
@ -576,6 +584,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
if (-height > maxDepth) maxDepth = -height;
|
||||
planet.Value.transform.position = new Vector3(p.x, 0, p.y);
|
||||
planet.Value.Body.transform.localPosition = new Vector3(0, height + planetInstance.BodyRadius * 2, 0);
|
||||
planet.Value.Icon.transform.localPosition = new Vector3(0, height, 0);
|
||||
if (planet.Value is GasGiantObject gasGiantObject)
|
||||
{
|
||||
if (!(planet.Value is SunObject))
|
||||
|
|
|
|||
47
Assets/Shaders/Brushes/GravityField.shader
Normal file
47
Assets/Shaders/Brushes/GravityField.shader
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// Draws the zone's gravity: depth = -Zone.GetHeight at the world xz of every texel, into whichever gravity camera culls
|
||||
// layer 9 (Surface Displacement, Patch Displacement, Slime Gravity, both Map Gravity). One quad covers the zone; the
|
||||
// law lives in Gravity.cginc, which mirrors ServerShared's GravityField.
|
||||
Shader "Brushes/Gravity Field" {
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||||
Blend One One
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 4.5
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "../Gravity.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 world : TEXCOORD0;
|
||||
};
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.world = mul(unity_ObjectToWorld, v.vertex).xz;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : SV_Target
|
||||
{
|
||||
return (-gravityHeight(i.world)).xxxx;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8a8e593b17063b54ea02f7ea5363b59d
|
||||
guid: 08d8efa80af84065b54c9bfed784e435
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
Shader "Brushes/Radial Wave Brush" {
|
||||
Properties {
|
||||
_Depth ("Depth", Float) = 0.5
|
||||
_Power("Envelope Power", Float) = 1.25
|
||||
_Frequency("Frequency", Float) = 6.2832
|
||||
_Phase("Phase", Float) = 0
|
||||
_SinePower("Sine Power", Float) = 1.25
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||||
Blend One One
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float _Depth;
|
||||
float _Power;
|
||||
float _Frequency;
|
||||
float _Phase;
|
||||
float _SinePower;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.color = v.color;
|
||||
o.texcoord = v.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
float almostIdentity(float x, float m, float n)
|
||||
{
|
||||
if (x>m) return x;
|
||||
|
||||
const float a = 2.0f*n - m;
|
||||
const float b = 2.0f*m - 3.0f*n;
|
||||
const float t = x / m;
|
||||
|
||||
return (a*t + b)*t*t + n;
|
||||
}
|
||||
|
||||
float powerPulse( float x, float power )
|
||||
{
|
||||
x = saturate(abs(x));
|
||||
return pow((x + 1.0f) * (1.0f - x), power);
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
float dist = length(i.texcoord - float2(.5,.5)) * 2;
|
||||
return _Depth * powerPulse(dist,_Power) * cos(pow(dist, _SinePower)*_Frequency+_Phase);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
Shader "Brushes/Wormhole Brush" {
|
||||
Properties {
|
||||
_Depth ("Depth", Float) = 0.5
|
||||
_Power("Envelope Power", Float) = 1.25
|
||||
_Frequency("Frequency", Float) = 6.2832
|
||||
_FrequencyDist("Distance Frequency", Float) = 6.2832
|
||||
_Speed("Speed", Float) = 0
|
||||
_SinePower("Sine Power", Float) = 1.25
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||||
Blend One One
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float _Depth;
|
||||
float _Power;
|
||||
float _Frequency;
|
||||
float _FrequencyDist;
|
||||
float _Speed;
|
||||
float _SinePower;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.color = v.color;
|
||||
o.texcoord = v.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
float almostIdentity(float x, float m, float n)
|
||||
{
|
||||
if (x>m) return x;
|
||||
|
||||
const float a = 2.0f*n - m;
|
||||
const float b = 2.0f*m - 3.0f*n;
|
||||
const float t = x / m;
|
||||
|
||||
return (a*t + b)*t*t + n;
|
||||
}
|
||||
|
||||
float powerPulse( float x, float power )
|
||||
{
|
||||
x = saturate(abs(x));
|
||||
return pow((x + 1.0f) * (1.0f - x), power);
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
float2 uv2 = i.texcoord - float2(.5,.5);
|
||||
float dist = length(uv2);
|
||||
float ang = atan2(uv2.y,uv2.x);
|
||||
return _Depth * powerPulse(dist * 2,_Power) * (cos(ang*_Frequency+pow(dist, _SinePower)*_FrequencyDist+_Time.x*_Speed)+1);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Assets/Shaders/Gravity.cginc
Normal file
42
Assets/Shaders/Gravity.cginc
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#ifndef AETHERIA_GRAVITY_INCLUDED
|
||||
#define AETHERIA_GRAVITY_INCLUDED
|
||||
|
||||
// The lowering of the zone's potential (aetheria-gravity, cut grid-lowering). The law is ServerShared's GravityField
|
||||
// and the height is Zone.GetHeight; this file mirrors them and decides nothing. GravityLowering.Lower fills the
|
||||
// buffer and the globals from the zone (positions from Orbit.Position, reference from Zone.WellReference) each frame.
|
||||
// GravityFieldParityVerify renders it and compares every texel with -Zone.GetHeight.
|
||||
|
||||
struct GravityWell
|
||||
{
|
||||
float2 position;
|
||||
float strength;
|
||||
float coreRadius;
|
||||
float reference;
|
||||
};
|
||||
|
||||
StructuredBuffer<GravityWell> _GravityWells;
|
||||
int _GravityWellCount;
|
||||
float _HeightExaggeration;
|
||||
|
||||
// GravityField.Potential, line for line: c is the well's strength, R its core radius, r the distance.
|
||||
float gravityPotential(float c, float R, float r)
|
||||
{
|
||||
return c == 0 ? 0 :
|
||||
r < R
|
||||
? c * r * r / (2 * R * R)
|
||||
: c * (log(r / R) + .5);
|
||||
}
|
||||
|
||||
// Zone.GetHeight at world xz: each well's potential minus its own reference, summed, divided by the exaggeration.
|
||||
float gravityHeight(float2 p)
|
||||
{
|
||||
float result = 0;
|
||||
for (int i = 0; i < _GravityWellCount; i++)
|
||||
{
|
||||
GravityWell well = _GravityWells[i];
|
||||
result += gravityPotential(well.strength, well.coreRadius, length(p - well.position)) - well.reference;
|
||||
}
|
||||
return result / _HeightExaggeration;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8681ac064d59d15458d16cc9b884262c
|
||||
guid: b8f69df89fde433c8263115c25267a10
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -46,8 +46,6 @@ public sealed class GravitySubtractTests : IDisposable
|
|||
CoreRadius = new ExponentialCurve { Exponent = .25f, Multiplier = 3f },
|
||||
RocheLimit = new ExponentialCurve { Exponent = .25f, Multiplier = 7.32f },
|
||||
BodyRadius = new ExponentialCurve { Exponent = .25f, Multiplier = 3f },
|
||||
GravityRadius = new ExponentialCurve { Exponent = .25f, Multiplier = 500f },
|
||||
GravityDepth = new ExponentialCurve { Exponent = .175f, Multiplier = 30f },
|
||||
LightRadius = new ExponentialCurve { Exponent = .25f, Multiplier = 300f },
|
||||
OrbitPeriod = new ExponentialCurve()
|
||||
};
|
||||
|
|
@ -81,8 +79,6 @@ public sealed class GravitySubtractTests : IDisposable
|
|||
var orbit = _cache.Upsert(new OrbitData { FixedPosition = float2.zero }).Key;
|
||||
data.Orbit = new CultRecordRef<OrbitData>(orbit);
|
||||
data.Mass = 100f;
|
||||
data.GravityRadiusMultiplier = 1.5f;
|
||||
data.GravityDepthMultiplier = .7f;
|
||||
var body = _cache.Upsert(data).Key;
|
||||
var pack = new ZonePack { Radius = PackRadius };
|
||||
pack.Orbits.Add(new CultRecordRef<OrbitData>(orbit));
|
||||
|
|
@ -133,9 +129,9 @@ public sealed class GravitySubtractTests : IDisposable
|
|||
private float _clock;
|
||||
private const float PackRadius = 1000f;
|
||||
|
||||
// CultCache has no primitive for reserving a removed MessagePack key. Key 8 of a body record (its former well
|
||||
// exponent) and the wave keys of the gas giants (14-17) must not come back with a different meaning, because
|
||||
// stored records may still carry them. Every record type that is a BodyData is checked, bases walked, so a giant
|
||||
// CultCache has no primitive for reserving a removed MessagePack key. Keys 6 and 7 of a body record (its former
|
||||
// brush multipliers), key 8 (its former well exponent) and the wave keys of the gas giants (14-17) must not come back
|
||||
// with a different meaning, because stored records may still carry them. Every record type that is a BodyData is checked, bases walked, so a giant
|
||||
// kind added later (the sun is one) cannot take them.
|
||||
[Fact]
|
||||
public void ABodyRecordNeverReusesRetiredKeys()
|
||||
|
|
@ -157,7 +153,7 @@ public sealed class GravitySubtractTests : IDisposable
|
|||
{
|
||||
var keys = KeysOf(type);
|
||||
Assert.NotEmpty(keys);
|
||||
Assert.DoesNotContain(8, keys);
|
||||
foreach (var retired in new[] { 6, 7, 8 }) Assert.DoesNotContain(retired, keys);
|
||||
if (typeof(GasGiantData).IsAssignableFrom(type))
|
||||
foreach (var retired in new[] { 14, 15, 16, 17 }) Assert.DoesNotContain(retired, keys);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,8 @@ public sealed class MiningCut2Tests : IDisposable
|
|||
AsteroidSize = new ExponentialLerp { Minimum = 2f, Maximum = 9f, Exponent = 1.7f },
|
||||
AsteroidHitpoints = new ExponentialLerp { Minimum = 20f, Maximum = 220f, Exponent = 1.6f },
|
||||
AsteroidRespawnTime = new ExponentialLerp { Minimum = 8f, Maximum = 96f, Exponent = 1.2f },
|
||||
// The zone builds a Planet for the fixture's non-belt body; its constructor reads these three.
|
||||
BodyRadius = new ExponentialCurve(),
|
||||
GravityRadius = new ExponentialCurve(),
|
||||
GravityDepth = new ExponentialCurve()
|
||||
// The zone builds a Planet for the fixture's non-belt body; its constructor reads this.
|
||||
BodyRadius = new ExponentialCurve()
|
||||
};
|
||||
|
||||
private sealed class Fixture
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ public sealed partial class MiningCut3Tests : IDisposable
|
|||
AsteroidHitpoints = new ExponentialLerp { Minimum = 20f, Maximum = 220f, Exponent = 1.6f },
|
||||
AsteroidRespawnTime = new ExponentialLerp { Minimum = 8f, Maximum = 96f, Exponent = 1.2f },
|
||||
BodyRadius = new ExponentialCurve(),
|
||||
GravityRadius = new ExponentialCurve(),
|
||||
GravityDepth = new ExponentialCurve(),
|
||||
LightRadius = new ExponentialCurve { Constant = lightRadius }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public sealed class PotentialOwnerTests : IDisposable
|
|||
CoreRadius = new ExponentialCurve { Exponent = .25f, Multiplier = 3f },
|
||||
RocheLimit = new ExponentialCurve { Exponent = .25f, Multiplier = 7.32f },
|
||||
BodyRadius = new ExponentialCurve { Exponent = .25f, Multiplier = 2f },
|
||||
GravityRadius = new ExponentialCurve(), GravityDepth = new ExponentialCurve(),
|
||||
LightRadius = new ExponentialCurve(), OrbitPeriod = new ExponentialCurve(),
|
||||
HeightExaggeration = exaggeration
|
||||
};
|
||||
|
|
@ -84,7 +83,7 @@ public sealed class PotentialOwnerTests : IDisposable
|
|||
{
|
||||
var planets = new PlanetSettings
|
||||
{
|
||||
BodyRadius = new ExponentialCurve(), GravityRadius = new ExponentialCurve(), GravityDepth = new ExponentialCurve(),
|
||||
BodyRadius = new ExponentialCurve(),
|
||||
LightRadius = new ExponentialCurve(), OrbitPeriod = new ExponentialCurve()
|
||||
};
|
||||
var zone = ZoneOf(planets, (100f, float2.zero), (5000f, new float2(200f, 0f)));
|
||||
|
|
@ -139,7 +138,6 @@ public sealed class PotentialOwnerTests : IDisposable
|
|||
CoreRadius = new ExponentialCurve { Constant = core },
|
||||
RocheLimit = new ExponentialCurve { Constant = roche },
|
||||
BodyRadius = new ExponentialCurve { Constant = 10f },
|
||||
GravityRadius = new ExponentialCurve(), GravityDepth = new ExponentialCurve(),
|
||||
LightRadius = new ExponentialCurve(), OrbitPeriod = new ExponentialCurve()
|
||||
};
|
||||
Assert.Throws<InvalidOperationException>(() => ZoneOf(Constants(60f, 50f), (100f, float2.zero)));
|
||||
|
|
@ -161,7 +159,6 @@ public sealed class PotentialOwnerTests : IDisposable
|
|||
CoreRadius = new ExponentialCurve { Multiplier = coreMultiplier, Exponent = coreExponent },
|
||||
RocheLimit = new ExponentialCurve { Multiplier = rocheMultiplier, Exponent = rocheExponent },
|
||||
BodyRadius = new ExponentialCurve { Constant = 1f },
|
||||
GravityRadius = new ExponentialCurve(), GravityDepth = new ExponentialCurve(),
|
||||
LightRadius = new ExponentialCurve(), OrbitPeriod = new ExponentialCurve()
|
||||
};
|
||||
var threw = 0;
|
||||
|
|
@ -212,12 +209,12 @@ public sealed class PotentialOwnerTests : IDisposable
|
|||
}
|
||||
|
||||
// The well is authored once, by curves of mass (target: no per-body authoring of a core or Roche limit): a body whose
|
||||
// record carries other radius, gravity-radius or gravity-depth multipliers has the same strength, core and Roche limit,
|
||||
// and pulls and digs exactly as its plain twin. The multipliers are brush inputs for the renderer, nothing else.
|
||||
// record carries another radius multiplier has the same strength, core and Roche limit, and pulls and digs exactly as
|
||||
// its plain twin.
|
||||
[Theory]
|
||||
[InlineData(2.5f, 3f, .4f)]
|
||||
[InlineData(.5f, .5f, 3f)]
|
||||
public void PerBodyMultipliersDoNotMoveTheWell(float bodyRadius, float gravityRadius, float gravityDepth)
|
||||
[InlineData(2.5f)]
|
||||
[InlineData(.5f)]
|
||||
public void PerBodyMultipliersDoNotMoveTheWell(float bodyRadius)
|
||||
{
|
||||
var planets = Curves();
|
||||
foreach (var mass in new[] { 29.2f, 14152.4f })
|
||||
|
|
@ -226,8 +223,6 @@ public sealed class PotentialOwnerTests : IDisposable
|
|||
var scaled = ZoneOf(planets, data =>
|
||||
{
|
||||
data.BodyRadiusMultiplier = bodyRadius;
|
||||
data.GravityRadiusMultiplier = gravityRadius;
|
||||
data.GravityDepthMultiplier = gravityDepth;
|
||||
}, (mass, float2.zero));
|
||||
var a = plain.PlanetInstances.Values.Single();
|
||||
var b = scaled.PlanetInstances.Values.Single();
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ internal static class WellFixture
|
|||
public static void Dig(CultCache cache, ZonePack pack, PlanetSettings settings, float strength, float coreRadius, float2 at = default)
|
||||
{
|
||||
settings.BodyRadius = new ExponentialCurve();
|
||||
settings.GravityRadius = new ExponentialCurve(); // brush inputs, read by Planet until grid-lowering deletes them
|
||||
settings.GravityDepth = new ExponentialCurve();
|
||||
settings.OrbitPeriod = new ExponentialCurve();
|
||||
settings.WellStrength = new ExponentialCurve { Constant = strength };
|
||||
settings.CoreRadius = new ExponentialCurve { Constant = coreRadius };
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ public sealed class ZonePlacedAtBuildTests : IDisposable
|
|||
{
|
||||
OrbitPeriod = Flat(Period),
|
||||
BodyRadius = Flat(20f),
|
||||
GravityRadius = Flat(0f), // brush inputs, read by Planet until grid-lowering deletes them
|
||||
GravityDepth = Flat(0f),
|
||||
WellStrength = Flat(100f),
|
||||
CoreRadius = Flat(20f),
|
||||
RocheLimit = Flat(30f),
|
||||
|
|
|
|||
Loading…
Reference in a new issue