Skip to content

Commit

Permalink
upgrading to Unity 2020.3 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
mimetaur committed Apr 16, 2021
1 parent e1f0035 commit f7aa63e
Show file tree
Hide file tree
Showing 61 changed files with 1,649 additions and 333 deletions.
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ Temporary Items
.apdisk

.autosave/
[Bb]ackup/
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Bb]ackup/
[Ll]ogs/
[Uu]ser[Ss]ettings/
Assets/AssetStoreTools*

# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
[Mm]emoryCaptures/

# Visual Studio cache directory
/.vs/

Expand All @@ -55,12 +61,14 @@ ExportedObj/
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

# Builds
*.apk
*.aab
*.unitypackage
*.zip

Expand All @@ -77,3 +85,6 @@ substance_cache/

# paid assets
Assets/Mega-Fiers/

# Packed Addressables
[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
469 changes: 468 additions & 1 deletion Assets/Allegorithmic/Plugins/EULA.txt

Large diffs are not rendered by default.

59 changes: 44 additions & 15 deletions Assets/Allegorithmic/Plugins/Substance.EditorHelper/Scripter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,67 @@ public static void Hello()
#endif
}

// NOTE: The following functions will be re-assessed when adding URP context...

public static bool IsInstallingHDRP()
public static class UnityPipeline
{
// The active project context is in the 'Edit->Project Settings->Graphics->Scriptable Render Pipeline Settings' field.
public static bool IsHDRP()
{
#if UNITY_2019_3_OR_NEWER
bool bInstalled = false;
bool bActive = false;

UnityEngine.Rendering.RenderPipelineAsset asset;
asset = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;

if ((asset != null) &&
(asset.GetType().ToString().EndsWith(".HDRenderPipelineAsset")))
{
bInstalled = true;
bActive = true;
}

return bInstalled;
return bActive;
#else
return false;
return false;
#endif
}

public static bool IsHDRP()
{
bool bHDRP = false;
}

public static bool IsURP()
{
#if UNITY_2019_3_OR_NEWER
if (IsInstallingHDRP())
bHDRP = true;
bool bActive = false;

UnityEngine.Rendering.RenderPipelineAsset asset;
asset = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;

if ((asset != null) &&
(asset.GetType().ToString().EndsWith("UniversalRenderPipelineAsset")))
{
bActive = true;
}

return bActive;
#else
return false;
#endif
}

// Keep the following for PackageManager investigation:
/*
public static UnityEditor.PackageManager.PackageInfo GetPackageInfo(string pName)
{
#if UNITY_2019_3_OR_NEWER
Debug.Log("New stuff...");
return bHDRP;
UnityEditor.PackageManager.PackageInfo info;
info = UnityEditor.PackageManager.PackageInfo.FindForAssetPath(pName);
return info;
#else
Debug.Log("Old stuff...");
return null;
#endif
}
*/
}
}
}
Binary file not shown.
4 changes: 2 additions & 2 deletions Assets/Allegorithmic/Plugins/Substance.Engine.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Assets/Allegorithmic/Plugins/Substance.Game.dll
Git LFS file not shown
58 changes: 13 additions & 45 deletions Assets/Allegorithmic/Plugins/Substance.Platform/NativeFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,23 @@ internal static void LoadDLL(string dataPath)
if (IsWindows())
{
LibDestination = Path.Combine(dataPath, "Plugins/Substance.Engine.dll");

DllHandle = LoadLibrary(LibDestination);

if (DllHandle == IntPtr.Zero)
{
// Unity added the subfolder 'x86_64' in Unity2019.3.9f1 & later versions...
LibDestination = Path.Combine(dataPath, "Plugins/x86_64/Substance.Engine.dll");
DllHandle = LoadLibrary(LibDestination);
}
}
else if (IsMac())
{
LibDestination = Path.Combine(dataPath, "Plugins/Substance.Engine.bundle/Contents/MacOS/Substance.Engine");

DllHandle = dlopen(LibDestination, 3);
}
else if (IsLinux())
{
LibDestination = Path.Combine(dataPath, "Plugins/libSubstance.Engine.so");

DllHandle = dlopen(LibDestination, 3);
}

Expand Down Expand Up @@ -267,9 +271,9 @@ private static bool IsLinux()
}
#endif // IMPORT_DYNAMIC

// ======================================================================
// ======================================================================
#if IMPORT_DYNAMIC
public delegate IntPtr cppHelloDelegate();
public delegate IntPtr cppHelloDelegate();
public static IntPtr cppHello()
{
string myName = System.Reflection.MethodBase.GetCurrentMethod().Name;
Expand Down Expand Up @@ -341,24 +345,6 @@ public static bool cppIsValidGraphHandle(IntPtr pGraphHandle)
public static extern bool cppIsValidGraphHandle(IntPtr pGraphHandle);
#endif

#if IMPORT_DYNAMIC // not used!
public delegate bool cppCheckDimensionsDelegate(IntPtr pGraphHandle);
public static bool cppCheckDimensions(IntPtr pGraphHandle)
{
string myName = System.Reflection.MethodBase.GetCurrentMethod().Name;

if (DLLHelpers.DllHandle == IntPtr.Zero)
return false;

cppCheckDimensionsDelegate function = DLLHelpers.GetFunction(
myName, typeof(cppCheckDimensionsDelegate)) as cppCheckDimensionsDelegate;
return function.Invoke(pGraphHandle);
}
#else
[DllImport(attributeValue)]
public static extern bool cppCheckDimensions(IntPtr pGraphHandle);
#endif

#if IMPORT_DYNAMIC
public delegate void cppApplyPresetDelegate(IntPtr graphHandle, string presetStr);
public static void cppApplyPreset(IntPtr graphHandle, string presetStr)
Expand Down Expand Up @@ -431,24 +417,6 @@ public static int cppGetNumOutputs(IntPtr graphHandle)
public static extern int cppGetNumOutputs(IntPtr graphHandle);
#endif

#if IMPORT_DYNAMIC
public delegate int cppGetNumMainTexturesDelegate(IntPtr graphHandle);
public static int cppGetNumMainTextures(IntPtr graphHandle)
{
string myName = System.Reflection.MethodBase.GetCurrentMethod().Name;

if (DLLHelpers.DllHandle == IntPtr.Zero)
return 0;

cppGetNumMainTexturesDelegate function = DLLHelpers.GetFunction(
myName, typeof(cppGetNumMainTexturesDelegate)) as cppGetNumMainTexturesDelegate;
return (int)function.Invoke(graphHandle);
}
#else
[DllImport(attributeValue)]
public static extern int cppGetNumMainTextures(IntPtr graphHandle);
#endif

#if IMPORT_DYNAMIC
public delegate IntPtr cppGetColorSpaceListDelegate(IntPtr graphHandle, int numOutputs);
public static IntPtr cppGetColorSpaceList(IntPtr graphHandle, int numOutputs)
Expand Down Expand Up @@ -602,11 +570,11 @@ public delegate int cppLoadSubstanceDelegate(string pAssetPath, IntPtr array, In
IntPtr assetCtx, IntPtr substanceObject,
UInt32[] graphIndices, string[] graphPrototypeNames, string[] graphLabels,
int[] graphFormats, int[] normalFormats, UInt32 numGraphIndices,
int rawOverride, int projectContext);
int rawOverride, int pPipeline);
public static int cppLoadSubstance(string pAssetPath, IntPtr array, Int32 size, IntPtr assetCtx, IntPtr substanceObject,
UInt32[] graphIndices, string[] graphPrototypeNames, string[] graphLabels,
int[] graphFormats, int[] normalFormats, UInt32 numGraphIndices,
int rawOverride, int projectContext)
int rawOverride, int pPipeline)
{
string myName = System.Reflection.MethodBase.GetCurrentMethod().Name;

Expand All @@ -618,13 +586,13 @@ public static int cppLoadSubstance(string pAssetPath, IntPtr array, Int32 size,
return (int)function.Invoke(pAssetPath, array, size, assetCtx, substanceObject,
graphIndices, graphPrototypeNames, graphLabels,
graphFormats, normalFormats, numGraphIndices,
rawOverride, projectContext);
rawOverride, pPipeline);
}
#else
[DllImport(attributeValue)]
public static extern int cppLoadSubstance(string pAssetPath, IntPtr array, Int32 size, IntPtr assetCtx,
IntPtr substanceObject, UInt32[] graphIndices, string[] graphPrototypeNames, string[] graphLabels,
int[] graphFormats, int[] normalFormats, UInt32 numGraphIndices, int rawOverride, int projectContext);
int[] graphFormats, int[] normalFormats, UInt32 numGraphIndices, int rawOverride, int pPipeline);
#endif

#if IMPORT_DYNAMIC
Expand Down
Binary file not shown.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
2 changes: 1 addition & 1 deletion Assets/Allegorithmic/Plugins/Substance/Arm64/libtinyxml.a
Git LFS file not shown
Binary file not shown.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
2 changes: 1 addition & 1 deletion Assets/Allegorithmic/Plugins/Substance/Armv7/libtinyxml.a
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Binary file not shown.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
2 changes: 1 addition & 1 deletion Assets/Allegorithmic/Plugins/Substance/iOS/libtinyxml.a
Git LFS file not shown
4 changes: 2 additions & 2 deletions Assets/Allegorithmic/Plugins/engine_build_info.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Build Number: 118
Commit Hash: 2b1f4be3a8d28d44dc5ce59eff39c91144368d60
Plugin Commit: 9022
Plugin Build: A48
Plugin Commit: 24eb4364a04f2cf81f76a384c02085ea3afcfeb5
Plugin Build: A4
Binary file modified Assets/Allegorithmic/Plugins/libSubstance.Engine.so
Binary file not shown.
Binary file modified Assets/Allegorithmic/Plugins/libsubstance_sse2_blend.bundle
Binary file not shown.
Binary file modified Assets/Allegorithmic/Plugins/libsubstance_sse2_blend.so
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Allegorithmic/Plugins/substance_sse2_blend.dll
Git LFS file not shown
8 changes: 8 additions & 0 deletions Assets/Materials.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f7aa63e

Please sign in to comment.