Fix missing shader in build
This commit is contained in:
@@ -41,7 +41,7 @@ namespace InfiniteWorld.VoxelWorld
|
||||
internal sealed class VoxelWorldAtlas : IDisposable
|
||||
{
|
||||
private const int FallbackTileSize = 32;
|
||||
private const string ShaderName = "Infinite World/VoxelWorld/TextureArrayUnlit";
|
||||
// private const string ShaderName = "Infinite World/VoxelWorld/TextureArrayUnlit";
|
||||
|
||||
private static readonly VoxelSurfaceType[] SurfaceOrder =
|
||||
{
|
||||
@@ -76,7 +76,7 @@ namespace InfiniteWorld.VoxelWorld
|
||||
return layerLookup[0][surfaceType];
|
||||
}
|
||||
|
||||
public static VoxelWorldAtlas CreateRuntimeAtlas(IReadOnlyList<VoxelBiomeProfile> biomeProfiles)
|
||||
public static VoxelWorldAtlas CreateRuntimeAtlas(IReadOnlyList<VoxelBiomeProfile> biomeProfiles, Shader terrainShader)
|
||||
{
|
||||
List<VoxelBiomeProfile> sourceBiomes = new List<VoxelBiomeProfile>();
|
||||
if (biomeProfiles != null)
|
||||
@@ -134,11 +134,11 @@ namespace InfiniteWorld.VoxelWorld
|
||||
|
||||
textureArray.Apply(false, false);
|
||||
|
||||
Shader shader = Shader.Find(ShaderName);
|
||||
Shader shader = terrainShader;
|
||||
if (shader == null)
|
||||
{
|
||||
shader = Shader.Find("Universal Render Pipeline/Unlit") ?? Shader.Find("Standard");
|
||||
Debug.LogError($"Shader '{ShaderName}' was not found. Falling back to '{shader?.name ?? "<missing>"}', but voxel texture array sampling will not work until the shader asset is imported correctly.");
|
||||
Debug.LogError($"Shader was not found. Falling back to '{shader?.name ?? "<missing>"}', but voxel texture array sampling will not work until the shader asset is imported correctly.");
|
||||
}
|
||||
|
||||
Material material = new Material(shader)
|
||||
|
||||
Reference in New Issue
Block a user