Delete the in-tree cache, JsonKnownTypes and vendored MessagePack
Cut 8b, deletes first. The old authorities are removed, not demoted: - ServerShared/CultCache: CultCache.cs, DatabaseEntry.cs (root [Union], DatabaseLink, INamedEntry), RegisterResolver.cs, TypeFormatterResolver.cs, JsonConverters.cs, JsonKnownTypes/**. - Assets/Plugins/MessagePack/** and System.Runtime.CompilerServices.Unsafe.dll (org.gamecult.cultlib ships both). - GalaxyMapLayerData, PlayerData, GlobalSettingsAttribute. - The inspector attributes CultLib already carries or nothing reads. Kept and moved: MathFormatters.cs and MathResolver.cs to ServerShared/Serialization; GetAllChildClasses, SplitCamelCase, FormatTypeName, MaxBy and MinBy to Extensions.cs; Inspectable, PreferredInspectorAttribute and the five Aetheria drawer attributes to ServerShared/Attributes.cs. Aetheria.Shared.csproj drops the vendored MessagePack include and the Unsafe package; the asmdef drops MessagePack. Does not build: the data model moves onto CultLib in the next commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
d3db1730ad
commit
b4c06b50cb
266 changed files with 67 additions and 33150 deletions
|
|
@ -11,73 +11,6 @@ using CultMath;
|
|||
using static CultMath.math;
|
||||
using static NoiseFbm;
|
||||
|
||||
[Inspectable, Serializable, DatabaseCategory("Galaxy"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class GalaxyMapLayerData : DatabaseEntry, INamedEntry
|
||||
{
|
||||
[Inspectable, JsonProperty("coreBoost"), Key(1)]
|
||||
public float CoreBoost = 1.05f;
|
||||
|
||||
[Inspectable, JsonProperty("coreBoostOffset"), Key(2)]
|
||||
public float CoreBoostOffset = .1f;
|
||||
|
||||
[Inspectable, JsonProperty("coreBoostPower"), Key(3)]
|
||||
public float CoreBoostPower = 2.25f;
|
||||
|
||||
[Inspectable, JsonProperty("spokeScale"), Key(4)]
|
||||
public float SpokeScale = 1;
|
||||
|
||||
[Inspectable, JsonProperty("spokeOffset"), Key(5)]
|
||||
public float SpokeOffset = 0;
|
||||
|
||||
[Inspectable, JsonProperty("edgeReduction"), Key(6)]
|
||||
public float EdgeReduction = 3;
|
||||
|
||||
[Inspectable, JsonProperty("noiseOffset"), Key(7)]
|
||||
public float NoiseOffset = 0;
|
||||
|
||||
[Inspectable, JsonProperty("noiseAmplitude"), Key(8)]
|
||||
public float NoiseAmplitude = 1.5f;
|
||||
|
||||
[Inspectable, JsonProperty("noiseGain"), Key(9)]
|
||||
public float NoiseGain = .7f;
|
||||
|
||||
[Inspectable, JsonProperty("noiseLacunarity"), Key(10)]
|
||||
public float NoiseLacunarity = 2;
|
||||
|
||||
[Inspectable, JsonProperty("noiseOctaves"), Key(11)]
|
||||
public int NoiseOctaves = 7;
|
||||
|
||||
[Inspectable, JsonProperty("noiseFrequency"), Key(12)]
|
||||
public float NoiseFrequency = 1;
|
||||
|
||||
[Inspectable, JsonProperty("noisePosition"), Key(13)]
|
||||
public float NoisePosition = 1337;
|
||||
|
||||
[Inspectable, JsonProperty("name"), Key(14)]
|
||||
public string Name;
|
||||
|
||||
public float Evaluate(float2 uv, GalaxyShapeSettings settings)
|
||||
{
|
||||
float2 offset = -float2(.5f, .5f)+uv;
|
||||
float circle = (.5f-length(offset))*2;
|
||||
float angle = pow(length(offset)*2,settings.TwistExponent) * settings.Twist;
|
||||
float2 t = float2(offset.x*cos(angle) - offset.y*sin(angle), offset.x*sin(angle) + offset.y*cos(angle));
|
||||
float atan = atan2(t.y,t.x);
|
||||
float spokes = (sin(atan*settings.Arms) + SpokeOffset) * SpokeScale;
|
||||
float noise = fBm(uv + float2(NoisePosition), NoiseOctaves, NoiseFrequency, NoiseOffset, NoiseAmplitude, NoiseLacunarity, NoiseGain);
|
||||
float shape = lerp(spokes - EdgeReduction * length(offset), 1, pow(circle, CoreBoostPower) * CoreBoost) + CoreBoostOffset;
|
||||
float gal = max(shape - noise * saturate(circle), 0);
|
||||
|
||||
return gal;
|
||||
}
|
||||
|
||||
[IgnoreMember] public string EntryName
|
||||
{
|
||||
get => Name;
|
||||
set => Name = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static class NoiseFbm
|
||||
{
|
||||
public static float3 fBm3(float2 p, int octaves, float frequency, float offset, float amplitude, float lacunarity, float gain)
|
||||
|
|
|
|||
Loading…
Reference in a new issue