Fix missing shader in build

This commit is contained in:
Nikita Dugin
2026-04-07 17:30:17 +03:00
parent 1a466a5fc6
commit 11ab636608
6 changed files with 130 additions and 50 deletions
@@ -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)