Skip to content

Commit

Permalink
v0.607 WIP2
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonexo3 committed Oct 23, 2020
1 parent c159693 commit ca3b7b9
Show file tree
Hide file tree
Showing 10 changed files with 271 additions and 225 deletions.
374 changes: 187 additions & 187 deletions Assembly-CSharp-Editor-firstpass.csproj

Large diffs are not rendered by default.

Binary file modified Assets/GFX/Terrain/ScmapTerrain.asset
Binary file not shown.
46 changes: 23 additions & 23 deletions Assets/GFX/Terrain/TerrainShader.mat
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Material:
- _AreaY: 76.8
- _Brush: 0
- _BrushPainting: 0
- _BrushSize: 10
- _BrushSize: 0
- _BrushUvX: 0.45309243
- _BrushUvY: 0.54620504
- _BuildGrid: 0
Expand All @@ -261,7 +261,7 @@ Material:
- _GeneratingNormal: 0
- _Grid: 0
- _GridCamDist: 0.049673967
- _GridScale: 102.4
- _GridScale: 12.8
- _GridType: 0
- _HideSplat0: 0
- _HideSplat1: 0
Expand All @@ -274,31 +274,31 @@ Material:
- _HideSplat8: 0
- _HideTerrainType: 1
- _LightingMultiplier: 1.27
- _LowerScale: 256
- _LowerScaleNormal: 117.02857
- _LowerScale: 32
- _LowerScaleNormal: 14.6285715
- _Shininess: 0.03
- _Slope: 0
- _Splat0Scale: 256
- _Splat0ScaleNormal: 256
- _Splat1Scale: 292.57144
- _Splat1ScaleNormal: 89.04348
- _Splat2Scale: 60.952385
- _Splat2ScaleNormal: 512
- _Splat3Scale: 170.66667
- _Splat3ScaleNormal: 256
- _Splat4Scale: 256
- _Splat4ScaleNormal: 256
- _Splat5Scale: 256
- _Splat5ScaleNormal: 256
- _Splat6Scale: 256
- _Splat6ScaleNormal: 256
- _Splat7Scale: 256
- _Splat7ScaleNormal: 256
- _Slope: 1
- _Splat0Scale: 32
- _Splat0ScaleNormal: 32
- _Splat1Scale: 32
- _Splat1ScaleNormal: 32
- _Splat2Scale: 32
- _Splat2ScaleNormal: 32
- _Splat3Scale: 32
- _Splat3ScaleNormal: 32
- _Splat4Scale: 32
- _Splat4ScaleNormal: 32
- _Splat5Scale: 32
- _Splat5ScaleNormal: 32
- _Splat6Scale: 32
- _Splat6ScaleNormal: 32
- _Splat7Scale: 32
- _Splat7ScaleNormal: 32
- _TTerrainXP: 0
- _TerrainTypeCapacity: 0.228
- _TerrainTypeCoof: 0.228
- _UpperScale: 8
- _UpperScaleNormal: 256
- _UpperScale: 1
- _UpperScaleNormal: 32
- _UseSlopeTex: 1
- _Water: 0
- _WaterLevel: 1.75
Expand Down
2 changes: 1 addition & 1 deletion Assets/GFX/Terrain/WaterShader.mat
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Material:
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _GridScale: 102.4
- _GridScale: 12.8
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
Expand Down
4 changes: 3 additions & 1 deletion Assets/Prefabs/UI/Background.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 17, y: 93}
m_AnchoredPosition: {x: 17, y: 109}
m_SizeDelta: {x: 181, y: 28}
m_Pivot: {x: 0, y: 0}
--- !u!222 &222779216518235826
Expand Down Expand Up @@ -709,6 +709,8 @@ MonoBehaviour:
axel12
Balthazar
'
--- !u!1 &1707490231246482
GameObject:
Expand Down
10 changes: 5 additions & 5 deletions Assets/Scripts/Common/EditorVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
public class EditorVersion : MonoBehaviour
{

public const string EditorBuildVersion = "v0.606-Alpha";
public const string EditorBuildVersion = "v0.607-Alpha";

//Release
public const string EditorBuildTag = "";
//public const string EditorBuildTag = "";
//public const string EditorBuildTag = "HF1"; // Hotfix
public const float VersionOffset = 0f; // Release
//public const float VersionOffset = 0f; // Release

// Prerelease
//public const string EditorBuildTag = "WIP10";
//public const double VersionOffset = -0.001f; // Prerelease
public const string EditorBuildTag = "WIP1";
public const double VersionOffset = -0.001f; // Prerelease

public static string LatestTag = "";
public static string FoundUrl;
Expand Down
47 changes: 42 additions & 5 deletions Assets/Scripts/Ozone SCMAP Code/Texture/GenerateControlTex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public IEnumerator GeneratingNormal()
Normal = ScmapEditor.Current.Data.GetInterpolatedNormal((x + 0.5f) / (Width), 1f - (y + 0.5f) / (Height));
AllColors[i] = new Color(0, 1f - (Normal.z * 0.5f + 0.5f), 0, Normal.x * 0.5f + 0.5f);

if(Time.realtimeSinceStartup - Realtime > MaxAllowedOverhead)
if (Time.realtimeSinceStartup - Realtime > MaxAllowedOverhead)
{
yield return null;
Realtime = Time.realtimeSinceStartup;
Expand Down Expand Up @@ -292,7 +292,9 @@ static bool GeneratingSlopeTex
IEnumerator GeneratingSlope()
{
//ScmapEditor.Current.TerrainMaterial.SetFloat("_UseSlopeTex", 0);
SlopeHeightmapPixels = ScmapEditor.Current.Teren.terrainData.GetHeights(0, 0, ScmapEditor.Current.Teren.terrainData.heightmapResolution, ScmapEditor.Current.Teren.terrainData.heightmapResolution);


//SlopeHeightmapPixels = ScmapEditor.Current.Teren.terrainData.GetHeights(0, 0, ScmapEditor.Current.Teren.terrainData.heightmapResolution, ScmapEditor.Current.Teren.terrainData.heightmapResolution);
Task task;
this.StartCoroutineAsync(GeneratingSlopeTask(), out task);
yield return StartCoroutine(task.Wait());
Expand All @@ -306,10 +308,19 @@ IEnumerator GeneratingSlope()
}
}

/* Old FAF way
const float FlatHeight = 0.995f;
const float NonFlatHeight = 0.88f;
const float AlmostUnpassableHeight = 0.74f;
const float UnpassableHeight = 0.541f;
*/

//SupComSlope
const float FlatHeight = 0.002f;
const float NonFlatHeight = 0.30f;
const float AlmostUnpassableHeight = 0.75f;
const float UnpassableHeight = 0.75f;
const float ScaleHeight = 256;

public Color Flat;
public Color LowAngle;
Expand All @@ -321,6 +332,7 @@ IEnumerator GeneratingSlope()
IEnumerator GeneratingSlopeTask()
{
Color[] Pixels = new Color[ScmapEditor.Current.map.Width * ScmapEditor.Current.map.Height];

int x = 0;
int y = 0;
int i = 0;
Expand All @@ -347,6 +359,7 @@ IEnumerator GeneratingSlopeTask()
Vert2.z = y + 1;
Vert3.z = y + 1;

/* Old FAF way
Vert0.y = SlopeHeightmapPixels[x, y] * 512f;
Vert1.y = SlopeHeightmapPixels[x + 1, y] * 512f;
Vert2.y = SlopeHeightmapPixels[x, y + 1] * 512f;
Expand All @@ -361,17 +374,36 @@ IEnumerator GeneratingSlopeTask()
//if (Dot > 0.5f)
Dot = Mathf.Min(Dot, Vector3.Dot(GetTriangleVector(Vert3, Vert1, Vert2), Vector3.up));

if(Dot > FlatHeight)
if (Dot > FlatHeight)
Pixels[i] = Flat;
else if(Dot > NonFlatHeight)
else if (Dot > NonFlatHeight)
Pixels[i] = LowAngle;
else if (Dot > AlmostUnpassableHeight)
Pixels[i] = HighAngle;
else if (Dot > UnpassableHeight)
Pixels[i] = AlmostUnpassable;
else
Pixels[i] = Unpassable;
*/


Vert0.y = ScmapEditor.GetHeight(x, y) * ScaleHeight;
Vert1.y = ScmapEditor.GetHeight(x + 1, y) * ScaleHeight;
Vert2.y = ScmapEditor.GetHeight(x + 1, y + 1) * ScaleHeight;
Vert3.y = ScmapEditor.GetHeight(x, y + 1) * ScaleHeight;

float Dot = getSupComSlope(Vert0.y, Vert1.y, Vert2.y, Vert3.y);

if (Dot <= FlatHeight)
Pixels[i] = Flat;
else if (Dot <= NonFlatHeight)
Pixels[i] = LowAngle;
else if (Dot <= AlmostUnpassableHeight)
Pixels[i] = HighAngle;
else if (Dot <= UnpassableHeight)
Pixels[i] = AlmostUnpassable;
else
Pixels[i] = Unpassable;

/*
float Min = Mathf.Min(Slope0, Slope1, Slope2, Slope3);
Expand Down Expand Up @@ -408,4 +440,9 @@ static Vector3 GetTriangleVector(Vector3 Vert0, Vector3 Vert1, Vector3 Vert2)
return Vector3.Cross(Vert1 - Vert0, Vert2 - Vert0).normalized;
}

static float getSupComSlope(float a, float b, float c, float d)
{
return Mathf.Max(Mathf.Abs(a - b), Mathf.Abs(b - c), Mathf.Abs(c - d), Mathf.Abs(d - a));
}

}
3 changes: 2 additions & 1 deletion Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0"
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.modules.ai": {
Expand Down
6 changes: 6 additions & 0 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ PlayerSettings:
switchNVNShaderPoolsGranularity: 33554432
switchNVNDefaultPoolsGranularity: 16777216
switchNVNOtherPoolsGranularity: 16777216
switchNVNMaxPublicTextureIDCount: 0
switchNVNMaxPublicSamplerIDCount: 0
stadiaPresentMode: 0
stadiaTargetFramerate: 0
vulkanNumSwapchainBuffers: 3
vulkanEnableSetSRGBWrite: 0
vulkanEnableLateAcquireNextImage: 0
m_SupportedAspectRatios:
4:3: 1
5:4: 1
Expand Down Expand Up @@ -596,6 +599,7 @@ PlayerSettings:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4ExtraSceSysFile:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
Expand Down Expand Up @@ -638,6 +642,8 @@ PlayerSettings:
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4CompatibilityPS5: 0
ps4GPU800MHz: 1
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules:
- libc.prx
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2019.4.8f1
m_EditorVersionWithRevision: 2019.4.8f1 (60781d942082)
m_EditorVersion: 2019.4.11f1
m_EditorVersionWithRevision: 2019.4.11f1 (2d9804dddde7)

0 comments on commit ca3b7b9

Please sign in to comment.