Skip to content

Commit

Permalink
Add support for advanced shaders (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas authored Aug 21, 2023
1 parent 3f5bff8 commit 3e68367
Show file tree
Hide file tree
Showing 22 changed files with 9,456 additions and 780 deletions.
1,404 changes: 701 additions & 703 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 @@ -253,15 +253,15 @@ Material:
- _Brush: 0
- _BrushPainting: 0
- _BrushSize: 0
- _BrushUvX: 0.43784037
- _BrushUvY: 0.3308369
- _BrushUvX: 0.21144567
- _BrushUvY: 0.079572834
- _BuildGrid: 0
- _DeepLevel: 1.675625
- _DepthLevel: 1.5
- _GeneratingNormal: 0
- _Grid: 0
- _GridCamDist: 0.049673967
- _GridScale: 51.2
- _GridScale: 102.4
- _GridType: 0
- _HideSplat0: 0
- _HideSplat1: 0
Expand All @@ -274,31 +274,31 @@ Material:
- _HideSplat8: 0
- _HideTerrainType: 1
- _LightingMultiplier: 1.27
- _LowerScale: 34.133335
- _LowerScaleNormal: 32
- _LowerScale: 256
- _LowerScaleNormal: 117.02857
- _Shininess: 0.03
- _Slope: 0
- _Splat0Scale: 32
- _Splat0ScaleNormal: 32
- _Splat1Scale: 16
- _Splat1ScaleNormal: 16
- _Splat2Scale: 32
- _Splat2ScaleNormal: 32
- _Splat3Scale: 128
- _Splat3ScaleNormal: 128
- _Splat4Scale: 128
- _Splat4ScaleNormal: 128
- _Splat5Scale: 128
- _Splat5ScaleNormal: 128
- _Splat6Scale: 128
- _Splat6ScaleNormal: 128
- _Splat7Scale: 128
- _Splat7ScaleNormal: 128
- _Splat0Scale: 256
- _Splat0ScaleNormal: 256
- _Splat1Scale: 256
- _Splat1ScaleNormal: 256
- _Splat2Scale: 256
- _Splat2ScaleNormal: 256
- _Splat3Scale: 256
- _Splat3ScaleNormal: 256
- _Splat4Scale: 256
- _Splat4ScaleNormal: 256
- _Splat5Scale: 256
- _Splat5ScaleNormal: 256
- _Splat6Scale: 256
- _Splat6ScaleNormal: 256
- _Splat7Scale: 256
- _Splat7ScaleNormal: 256
- _TTerrainXP: 0
- _TerrainTypeCapacity: 0.228
- _TerrainTypeCoof: 0.228
- _UpperScale: 4
- _UpperScaleNormal: 128
- _UpperScale: 8
- _UpperScaleNormal: 256
- _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: 51.2
- _GridScale: 102.4
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
Expand Down
112 changes: 71 additions & 41 deletions Assets/MapEditor.unity
Original file line number Diff line number Diff line change
Expand Up @@ -36416,11 +36416,45 @@ PrefabInstance:
propertyPath: m_Name
value: Background
objectReference: {fileID: 0}
- target: {fileID: 114411632476451918, guid: 0ff6c6aab7f2d344db85e67f50ac652a,
type: 3}
propertyPath: url
value: https://github.com/Garanas/FAForeverMapEditor/releases/latest
objectReference: {fileID: 0}
- target: {fileID: 114411632476451918, guid: 0ff6c6aab7f2d344db85e67f50ac652a,
type: 3}
propertyPath: SearchForNew
value: 1
objectReference: {fileID: 0}
- target: {fileID: 114935369762562360, guid: 0ff6c6aab7f2d344db85e67f50ac652a,
type: 3}
propertyPath: m_Text
value: 'Contributors:

Zkov

CookieNoob

axel12

Balthazar

Sheikah

Jip

'
objectReference: {fileID: 0}
- target: {fileID: 224328943235204592, guid: 0ff6c6aab7f2d344db85e67f50ac652a,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -2.1015625
objectReference: {fileID: 0}
- target: {fileID: 224807458839257706, guid: 0ff6c6aab7f2d344db85e67f50ac652a,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 147
objectReference: {fileID: 0}
- target: {fileID: 224877751352426200, guid: 0ff6c6aab7f2d344db85e67f50ac652a,
type: 3}
propertyPath: m_Pivot.x
Expand Down Expand Up @@ -46475,7 +46509,7 @@ Camera:
serializedVersion: 2
m_Bits: 2560
m_RenderingPath: 1
m_TargetTexture: {fileID: 1315184174}
m_TargetTexture: {fileID: 1029820456}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
Expand Down Expand Up @@ -50031,7 +50065,7 @@ PrefabInstance:
- target: {fileID: 114487296845569024, guid: dcfeadd71d056b146820dc139825d829,
type: 3}
propertyPath: m_MaxValue
value: 256
value: 8193
objectReference: {fileID: 0}
- target: {fileID: 114642351234033714, guid: dcfeadd71d056b146820dc139825d829,
type: 3}
Expand Down Expand Up @@ -71675,8 +71709,6 @@ MonoBehaviour:
m_Image: {fileID: 0}
- m_Text: 40 km (2048px)
m_Image: {fileID: 0}
- m_Text: 80 km (4096px)
m_Image: {fileID: 0}
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
Expand Down Expand Up @@ -89112,6 +89144,41 @@ MonoBehaviour:
m_StringArgument: Hydro
m_BoolArgument: 0
m_CallState: 2
--- !u!84 &1029820456
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 1
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
--- !u!1 &1029902827
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -113260,41 +113327,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1314836769}
m_CullTransparentMesh: 0
--- !u!84 &1315184174
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthFormat: 1
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
--- !u!1 &1315528963
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -123630,8 +123662,6 @@ MonoBehaviour:
m_Image: {fileID: 0}
- m_Text: 40 km (2048px)
m_Image: {fileID: 0}
- m_Text: 80 km (4096px)
m_Image: {fileID: 0}
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
Expand Down
9 changes: 6 additions & 3 deletions Assets/Scripts/Common/EditorVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class EditorVersion : MonoBehaviour
{

public const string EditorBuildVersion = "v0.704-Alpha";
public const string EditorBuildVersion = "v0.707";

#if PRERELEASE
// Prerelease
Expand All @@ -24,7 +24,7 @@ public class EditorVersion : MonoBehaviour

public static string LatestTag = "";
public static string FoundUrl;
public bool SearchForNew = false;
public bool SearchForNew = true;

string TagString
{
Expand All @@ -39,12 +39,13 @@ string TagString

void Start()
{
Debug.Log("Start!");
GetComponent<Text>().text = EditorBuildVersion + TagString;
if(SearchForNew)
StartCoroutine(FindLatest());
}

public string url = "https://github.com/ozonexo3/FAForeverMapEditor/releases/latest";
public string url = "https://github.com/Garanas/FAForeverMapEditor/releases/latest";
IEnumerator FindLatest()
{

Expand All @@ -64,9 +65,11 @@ IEnumerator FindLatest()
}*/
string[] Tags = www.url.Replace("\\", "/").Split("/".ToCharArray());


if (Tags.Length > 0)
{
LatestTag = Tags[Tags.Length - 1];
Debug.Log(LatestTag);
FoundUrl = www.url;

double Latest = System.Math.Round(BuildFloat(LatestTag), 3);
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/GFX/Waves/WavesRenderer.Patterns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void LoadWavePatterns()

if (!Directory.Exists(Path.GetDirectoryName(path)))
{
Debug.LogError("Cant find Waves folder");
Debug.LogError("Cant find Waves folder at: " + path);
return;
}
if (!File.Exists(path))
Expand Down
19 changes: 14 additions & 5 deletions Assets/Scripts/HazardX SCMAP Code/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,26 @@ public Map(int _Width, int _Height, int InitialHeight, bool _Water, int WaterLev
Width = _Width;
Height = _Height;

PreviewTex = new Texture2D(256, 256, TextureFormat.RGBA32, false);
TexturemapTex = new Texture2D(Width, Height, TextureFormat.RGBA32, false);
TexturemapTex2 = new Texture2D(Width, Height, TextureFormat.RGBA32, false);
int multiplier = 8;
if (Width >= 1024 || Height >= 1024) {
multiplier = 4;
}

if (Width >= 2048 || Height >= 2048) {
multiplier = 2;
}

PreviewTex = new Texture2D(512, 512, TextureFormat.RGBA32, false);
TexturemapTex = new Texture2D(multiplier * Width, multiplier * Height, TextureFormat.RGBA32, false);
TexturemapTex2 = new Texture2D(multiplier * Width, multiplier * Height, TextureFormat.RGBA32, false);
NormalmapTex = new Texture2D(Width, Height, TextureFormat.DXT5, false);
WatermapTex = new Texture2D(Width, Height, TextureFormat.DXT5, false);
UncompressedWatermapTex = new Texture2D(WatermapTex.width, WatermapTex.height, TextureFormat.RGBA32, false);
UncompressedNormalmapTex = new Texture2D(NormalmapTex.width, NormalmapTex.height, TextureFormat.RGBA32, false);
WaterDataTexture = new Texture2D(Width, Height, TextureFormat.RGB24, false);

Color SplatTextureColor = new Color(0, 0, 0, 0);
Color[] Pixels = new Color[Width * Height];
Color[] Pixels = new Color[multiplier * multiplier * Width * Height];
for (int i = 0; i < Pixels.Length; i++)
Pixels[i] = SplatTextureColor;

Expand All @@ -195,7 +204,7 @@ public Map(int _Width, int _Height, int InitialHeight, bool _Water, int WaterLev
TexturemapTex.Apply();
TexturemapTex2.Apply();


Pixels = new Color[Width * Height];
Color Bump = new Color(0, 0, 1, 1);
for (int i = 0; i < Pixels.Length; i++)
Pixels[i] = Bump;
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/UI/Tools/Stratum/StratumInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ public void UpdateStratumMenu(bool Slider = false)
BrushMini.SetValue(Min);
BrushMax.SetValue(Max);


if (TargetValue.value < 0)
TargetValue.SetValue(0);
else if (TargetValue.value > 1)
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/UI/Tools/TerrainInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void LoadBrushes()

if (!Directory.Exists(StructurePath))
{
Debug.LogError("Cant find brush folder");
Debug.LogError("Cant find brush folder at: " + StructurePath);
return;
}

Expand Down
Loading

0 comments on commit 3e68367

Please sign in to comment.