todo and fixes

This commit is contained in:
mcrcortex
2025-08-23 23:45:55 +10:00
parent aa185f11d7
commit 2fd686a5e6
5 changed files with 26 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ public class VoxyConfig implements OptionStorage<VoxyConfig> {
public boolean useEnvironmentalFog = false;
public boolean renderStatistics = false;
public static VoxyConfig loadOrCreate() {
private static VoxyConfig loadOrCreate() {
if (VoxyCommon.isAvailable()) {
var path = getConfigPath();
if (Files.exists(path)) {

View File

@@ -214,6 +214,21 @@ public class IrisShaderPatch {
PatchGson patchData = null;
try {
//TODO: basicly find any "commented out" quotation marks and escape them (if the line, when stripped starts with a // or /* then escape all quotation marks in that line)
{
StringBuilder builder = new StringBuilder(voxyPatchData.length());
//Rebuild the patch, replacing commented out " with \"
for (var line : voxyPatchData.split("\n")) {
int idx = line.indexOf("//");
if (idx != -1) {
builder.append(line, 0, idx);
builder.append(line.substring(idx).replace("\"","\\\""));
} else {
builder.append(line);
}
builder.append("\n");
}
voxyPatchData = builder.toString();
}
patchData = GSON.fromJson(voxyPatchData, PatchGson.class);
if (patchData != null && !patchData.checkValid()) {
throw new IllegalStateException("voxy json patch not valid: " + voxyPatchData);

View File

@@ -386,7 +386,13 @@ public class IrisVoxyRenderPipelineData {
int i = 0;
for (var entry : samplerSet) {
samplers[i]=entry;
builder.append("layout(binding=(BASE_SAMPLER_BINDING_INDEX+").append(i).append(")) uniform sampler2D ").append(entry.name).append(";\n");
String samplerType = "sampler2D";
if (entry.name.startsWith("shadowtex")) {
samplerType = "sampler2DShadow";
}
builder.append("layout(binding=(BASE_SAMPLER_BINDING_INDEX+").append(i).append(")) uniform ").append(samplerType).append(" ").append(entry.name).append(";\n");
i++;
}

View File

@@ -37,7 +37,7 @@ public class VoxyUniforms {
public static void addUniforms(UniformHolder uniforms) {
uniforms
.uniform1i(PER_FRAME, "vxRenderDistance", ()-> VoxyConfig.loadOrCreate().sectionRenderDistance*32)//In chunks
.uniform1i(PER_FRAME, "vxRenderDistance", ()-> VoxyConfig.CONFIG.sectionRenderDistance*32)//In chunks
.uniformMatrix(PER_FRAME, "vxViewProj", VoxyUniforms::getViewProjection)
.uniformMatrix(PER_FRAME, "vxViewProjInv", new Inverted(VoxyUniforms::getViewProjection))
.uniformMatrix(PER_FRAME, "vxViewProjPrev", new PreviousMat(VoxyUniforms::getViewProjection))
@@ -50,7 +50,7 @@ public class VoxyUniforms {
.uniform1f(PER_FRAME, "dhNearPlane", ()->16)//Presently hardcoded in voxy
.uniform1f(PER_FRAME, "dhFarPlane", ()->16*3000)//Presently hardcoded in voxy
.uniform1i(PER_FRAME, "dhRenderDistance", ()-> VoxyConfig.loadOrCreate().sectionRenderDistance*32)//In chunks
.uniform1i(PER_FRAME, "dhRenderDistance", ()-> VoxyConfig.CONFIG.sectionRenderDistance*32)//In chunks
.uniformMatrix(PER_FRAME, "dhProjection", VoxyUniforms::getProjection)
.uniformMatrix(PER_FRAME, "dhProjectionInverse", new Inverted(VoxyUniforms::getProjection))
.uniformMatrix(PER_FRAME, "dhPreviousProjection", new PreviousMat(VoxyUniforms::getProjection));

View File

@@ -81,6 +81,7 @@ void main() {
positionBuffer[drawId] = extractRawPos(meta);
uvec4 counts = meta.b;
//TODO implicit command merging
uint msk = 0;
msk |= uint(((counts.y &0xFFFFu)!=0) && (relative.y>-1))<<0;
msk |= uint((((counts.y>>16)&0xFFFFu)!=0) && (relative.y<1 ))<<1;