Skip to content

Commit de915c3

Browse files
committed
Basic fixes to run on MacOS
1 parent 962351b commit de915c3

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

Assets/Environment/Desert/M_BarrenSky.shader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Shader "VoidWorld/BarrenSky" {
5353
#define UNITY_PASS_FORWARDBASE
5454
#include "UnityCG.cginc"
5555
#pragma multi_compile_fwdbase
56-
#pragma only_renderers d3d9 d3d11 glcore gles
56+
#pragma only_renderers d3d9 d3d11 glcore gles metal
5757
#pragma target 3.0
5858
uniform float4 _TimeEditor;
5959
uniform float4 _SkyColor;

Assets/Rendering/Depth_ESM.shader

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ Shader "Mogwai/Shadow/Depth_ESM"
6868

6969

7070
// Stores both linear and exponential depth in the shadow texture
71-
float2 fragLinear (VertexOutput fragment) : SV_Target
71+
float4 fragLinear (VertexOutput fragment) : SV_Target
7272
{
7373
float depth = (length(fragment.worldPosition.xyz - _WorldSpaceCameraPos.xyz))*_ShadowInfo.x;
7474
/// ESM, higher values increase quality, at the price of stability
7575
float depth2 = INV_E_40 * exp(40*min(depth - 0.002, 1.0));
76-
return float2(depth, depth2);
76+
return float4(depth, depth2, 0, 0);
7777
}
7878
ENDCG
7979
}
@@ -123,13 +123,13 @@ Shader "Mogwai/Shadow/Depth_ESM"
123123
}
124124

125125
// Stores both linear and exponential depth in the shadow texture
126-
float2 fragLinear (VertexOutput fragment) : SV_Target
126+
float4 fragLinear (VertexOutput fragment) : SV_Target
127127
{
128128

129129
float depth = (length(fragment.worldPosition.xyz - _WorldSpaceCameraPos.xyz))*_ShadowInfo.x;
130130
/// ESM, higher values increase quality, at the price of stability
131131
float depth2 = INV_E_40 * exp(40*min(depth - 0.002, 1.0));
132-
return float2(depth, depth2);
132+
return float4(depth, depth2, 0, 0);
133133
}
134134
ENDCG
135135
}

Assets/Scripts/model/util/NativeSpatial.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,14 @@ public NativeSpatial()
8282
{
8383
// We call this to ensure that the callback that allows debug statements from native is set up.
8484
FbxExporter.Setup();
85-
spatialPartitionId = NativeSpatialFunction.AllocSpatialPartitioner(Vector3.up, Vector3.back);
85+
try
86+
{
87+
spatialPartitionId = NativeSpatialFunction.AllocSpatialPartitioner(Vector3.up, Vector3.back);
88+
}
89+
catch (Exception e)
90+
{
91+
Debug.LogError("Failed to allocate spatial partitioner: " + e.Message);
92+
}
8693
}
8794

8895
/// <summary>

ProjectSettings/ProjectSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ PlayerSettings:
235235
iOSBackgroundModes: 0
236236
iOSMetalForceHardShadows: 0
237237
metalEditorSupport: 1
238-
metalAPIValidation: 1
238+
metalAPIValidation: 0
239239
iOSRenderExtraFrameOnPause: 1
240240
iosCopyPluginsCodeInsteadOfSymlink: 0
241241
appleDeveloperTeamID:

0 commit comments

Comments
 (0)