Fixes
This commit is contained in:
@@ -4,6 +4,8 @@ import me.cortex.voxy.client.core.VoxelCore;
|
|||||||
import me.cortex.voxy.client.saver.ContextSelectionSystem;
|
import me.cortex.voxy.client.saver.ContextSelectionSystem;
|
||||||
import me.cortex.voxy.client.terrain.WorldImportCommand;
|
import me.cortex.voxy.client.terrain.WorldImportCommand;
|
||||||
import me.cortex.voxy.common.config.Serialization;
|
import me.cortex.voxy.common.config.Serialization;
|
||||||
|
import me.cortex.voxy.common.storage.compressors.ZSTDCompressor;
|
||||||
|
import me.cortex.voxy.common.storage.config.StorageConfig;
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
|
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
@@ -16,7 +18,6 @@ public class Voxy implements ClientModInitializer {
|
|||||||
static {
|
static {
|
||||||
ModContainer mod = (ModContainer) FabricLoader.getInstance().getModContainer("voxy").orElseThrow(NullPointerException::new);
|
ModContainer mod = (ModContainer) FabricLoader.getInstance().getModContainer("voxy").orElseThrow(NullPointerException::new);
|
||||||
VERSION = mod.getMetadata().getVersion().getFriendlyString();
|
VERSION = mod.getMetadata().getVersion().getFriendlyString();
|
||||||
|
|
||||||
Serialization.init();
|
Serialization.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,13 +14,16 @@ import net.minecraft.text.Text;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class VoxyConfigScreenFactory implements ModMenuApi {
|
public class VoxyConfigScreenFactory implements ModMenuApi {
|
||||||
private static final VoxyConfig DEFAULT = new VoxyConfig();
|
private static VoxyConfig DEFAULT;
|
||||||
@Override
|
@Override
|
||||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||||
return parent -> buildConfigScreen(parent, VoxyConfig.CONFIG);
|
return parent -> buildConfigScreen(parent, VoxyConfig.CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Screen buildConfigScreen(Screen parent, VoxyConfig config) {
|
private static Screen buildConfigScreen(Screen parent, VoxyConfig config) {
|
||||||
|
if (DEFAULT == null) {
|
||||||
|
DEFAULT = new VoxyConfig();
|
||||||
|
}
|
||||||
ConfigBuilder builder = ConfigBuilder.create()
|
ConfigBuilder builder = ConfigBuilder.create()
|
||||||
.setParentScreen(parent)
|
.setParentScreen(parent)
|
||||||
.setTitle(Text.translatable("voxy.config.title"));
|
.setTitle(Text.translatable("voxy.config.title"));
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.stream.Stream;
|
|||||||
|
|
||||||
public class Serialization {
|
public class Serialization {
|
||||||
public static final Set<Class<?>> CONFIG_TYPES = new HashSet<>();
|
public static final Set<Class<?>> CONFIG_TYPES = new HashSet<>();
|
||||||
public static final Gson GSON;
|
public static Gson GSON;
|
||||||
|
|
||||||
private static final class GsonConfigSerialization <T> implements TypeAdapterFactory {
|
private static final class GsonConfigSerialization <T> implements TypeAdapterFactory {
|
||||||
private final String typeField = "TYPE";
|
private final String typeField = "TYPE";
|
||||||
@@ -90,14 +90,7 @@ public class Serialization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
public static void init() {
|
||||||
try {
|
|
||||||
Class.forName(CompressorConfig.class.getName());
|
|
||||||
Class.forName(StorageConfig.class.getName());
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
String BASE_SEARCH_PACKAGE = "me.cortex.voxy";
|
String BASE_SEARCH_PACKAGE = "me.cortex.voxy";
|
||||||
|
|
||||||
Map<Class<?>, GsonConfigSerialization<?>> serializers = new HashMap<>();
|
Map<Class<?>, GsonConfigSerialization<?>> serializers = new HashMap<>();
|
||||||
@@ -205,6 +198,4 @@ public class Serialization {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init() {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
struct Frustum {
|
||||||
|
vec4 planes[6];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout(binding = 0, std140) uniform SceneUniform {
|
||||||
|
mat4 MVP;
|
||||||
|
ivec3 baseSectionPos;
|
||||||
|
int sectionCount;
|
||||||
|
Frustum frustum;
|
||||||
|
vec3 cameraSubPos;
|
||||||
|
uint frameId;
|
||||||
|
};
|
||||||
|
|
||||||
struct BlockModel {
|
struct BlockModel {
|
||||||
uint faceData[6];
|
uint faceData[6];
|
||||||
uint flagsA;
|
uint flagsA;
|
||||||
@@ -30,8 +43,8 @@ layout(binding = 0) uniform sampler2D blockModelAtlas;
|
|||||||
#ifndef Quad
|
#ifndef Quad
|
||||||
#define Quad ivec2
|
#define Quad ivec2
|
||||||
#endif
|
#endif
|
||||||
layout(binding = 1, std430) readonly restrict buffer QuadBuffer {
|
layout(binding = 1, std430) readonly restrict buffer GeometryBuffer {
|
||||||
Quad quadData[];
|
Quad geometryPool[];
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(binding = 2, std430) restrict buffer DrawBuffer {
|
layout(binding = 2, std430) restrict buffer DrawBuffer {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#version 450
|
#version 450
|
||||||
|
#extension GL_ARB_gpu_shader_int64 : enable
|
||||||
|
|
||||||
#define MESHLET_ACCESS writeonly
|
#define MESHLET_ACCESS writeonly
|
||||||
#import <voxy:lod/quad_format.glsl>
|
#import <voxy:lod/quad_format.glsl>
|
||||||
#import <voxy:lod/gl46mesh/bindings.glsl>
|
#import <voxy:lod/gl46mesh/bindings.glsl>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#version 450
|
#version 450
|
||||||
|
#extension GL_ARB_gpu_shader_int64 : enable
|
||||||
|
|
||||||
#define MESHLET_ACCESS readonly
|
#define MESHLET_ACCESS readonly
|
||||||
#define QUADS_PER_MESHLET 126
|
#define QUADS_PER_MESHLET 126
|
||||||
//There are 16 bytes of metadata at the start of the meshlet
|
//There are 16 bytes of metadata at the start of the meshlet
|
||||||
@@ -6,8 +8,9 @@
|
|||||||
#import <voxy:lod/quad_format.glsl>
|
#import <voxy:lod/quad_format.glsl>
|
||||||
#import <voxy:lod/gl46mesh/bindings.glsl>
|
#import <voxy:lod/gl46mesh/bindings.glsl>
|
||||||
#import <voxy:lod/section.glsl>
|
#import <voxy:lod/section.glsl>
|
||||||
|
#define GEOMETRY_FMT Quad
|
||||||
|
|
||||||
uvec2 meshletPosition;
|
GEOMETRY_FMT meshletPosition;
|
||||||
Quad quad;
|
Quad quad;
|
||||||
bool setupMeshlet() {
|
bool setupMeshlet() {
|
||||||
gl_CullDistance[0] = 1;
|
gl_CullDistance[0] = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user