update deps, fix unlikely race in import manager, clamp fog, fix some some incorrect meshing
This commit is contained in:
@@ -127,7 +127,7 @@ dependencies {
|
|||||||
modCompileOnly("maven.modrinth:sodium-extra:mc1.21.11-0.8.0+fabric")
|
modCompileOnly("maven.modrinth:sodium-extra:mc1.21.11-0.8.0+fabric")
|
||||||
modRuntimeOnlyMsk("maven.modrinth:sodium-extra:mc1.21.11-0.8.0+fabric")
|
modRuntimeOnlyMsk("maven.modrinth:sodium-extra:mc1.21.11-0.8.0+fabric")
|
||||||
|
|
||||||
modCompileOnly("maven.modrinth:chunky:1.4.40-fabric")
|
modCompileOnly("maven.modrinth:chunky:1.4.54-fabric")
|
||||||
//modRuntimeOnlyMsk("maven.modrinth:chunky:1.4.40-fabric")
|
//modRuntimeOnlyMsk("maven.modrinth:chunky:1.4.40-fabric")
|
||||||
|
|
||||||
modRuntimeOnlyMsk("maven.modrinth:spark:1.10.152-fabric")
|
modRuntimeOnlyMsk("maven.modrinth:spark:1.10.152-fabric")
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class NormalRenderPipeline extends AbstractRenderPipeline {
|
|||||||
float invEndFogDelta = 1f / (end - start);
|
float invEndFogDelta = 1f / (end - start);
|
||||||
float endDistance = Minecraft.getInstance().gameRenderer.getRenderDistance()*(float)Math.sqrt(3);
|
float endDistance = Minecraft.getInstance().gameRenderer.getRenderDistance()*(float)Math.sqrt(3);
|
||||||
float startDelta = -start * invEndFogDelta;
|
float startDelta = -start * invEndFogDelta;
|
||||||
glUniform4f(4, invEndFogDelta, startDelta, endDistance*invEndFogDelta+startDelta,0);//
|
glUniform4f(4, invEndFogDelta, startDelta, Math.clamp(endDistance*invEndFogDelta+startDelta, 0, 1),0);//
|
||||||
glUniform4f(5, viewport.fogParameters.red(), viewport.fogParameters.green(), viewport.fogParameters.blue(), viewport.fogParameters.alpha());
|
glUniform4f(5, viewport.fogParameters.red(), viewport.fogParameters.green(), viewport.fogParameters.blue(), viewport.fogParameters.alpha());
|
||||||
} else {
|
} else {
|
||||||
glUniform4f(4, 0, 0, 0, 0);
|
glUniform4f(4, 0, 0, 0, 0);
|
||||||
|
|||||||
@@ -763,10 +763,12 @@ public class RenderDataFactory {
|
|||||||
//Check and test if can cull W.R.T neighbor
|
//Check and test if can cull W.R.T neighbor
|
||||||
if (Mapper.getBlockId(neighborId) != 0) {//Not air
|
if (Mapper.getBlockId(neighborId) != 0) {//Not air
|
||||||
int modelId = this.modelMan.getModelId(Mapper.getBlockId(neighborId));
|
int modelId = this.modelMan.getModelId(Mapper.getBlockId(neighborId));
|
||||||
|
/*
|
||||||
if (modelId == ((A>>26)&0xFFFF)) {//TODO: FIXME, this technically isnt correct as need to check self occulsion, thinks?
|
if (modelId == ((A>>26)&0xFFFF)) {//TODO: FIXME, this technically isnt correct as need to check self occulsion, thinks?
|
||||||
//TODO: check self occlsuion in the if statment
|
//TODO: check self occlsuion in the if statment
|
||||||
fail = true;
|
fail = true;
|
||||||
} else {
|
} else */
|
||||||
|
{
|
||||||
long meta = this.modelMan.getModelMetadataFromClientId(modelId);
|
long meta = this.modelMan.getModelMetadataFromClientId(modelId);
|
||||||
|
|
||||||
if (ModelQueries.faceOccludes(meta, (axis << 1) | (1 - side))) {
|
if (ModelQueries.faceOccludes(meta, (axis << 1) | (1 - side))) {
|
||||||
@@ -778,10 +780,16 @@ public class RenderDataFactory {
|
|||||||
long nA = this.sectionData[(idx+skipAmount) * 2];
|
long nA = this.sectionData[(idx+skipAmount) * 2];
|
||||||
long nB = this.sectionData[(idx+skipAmount) * 2 + 1];
|
long nB = this.sectionData[(idx+skipAmount) * 2 + 1];
|
||||||
boolean failB = false;
|
boolean failB = false;
|
||||||
|
//TODO: check self occlusion
|
||||||
|
|
||||||
|
/*
|
||||||
if ((nA&(0xFFFFL<<26)) == (A&(0xFFFFL<<26))) {//TODO: FIXME, this technically isnt correct as need to check self occulsion, thinks?
|
if ((nA&(0xFFFFL<<26)) == (A&(0xFFFFL<<26))) {//TODO: FIXME, this technically isnt correct as need to check self occulsion, thinks?
|
||||||
//TODO: check self occlsuion in the if statment
|
//TODO: check self occlsuion in the if statment
|
||||||
failB = true;
|
failB = true;
|
||||||
} else {
|
} else
|
||||||
|
*/
|
||||||
|
|
||||||
|
{
|
||||||
if (ModelQueries.faceOccludes(nB, (axis << 1) | (side))) {
|
if (ModelQueries.faceOccludes(nB, (axis << 1) | (side))) {
|
||||||
failB = true;
|
failB = true;
|
||||||
}
|
}
|
||||||
@@ -1485,9 +1493,10 @@ public class RenderDataFactory {
|
|||||||
int skipB = 0;
|
int skipB = 0;
|
||||||
for (int z = 0; z < 32; z++) {
|
for (int z = 0; z < 32; z++) {
|
||||||
int i = y*32+z;
|
int i = y*32+z;
|
||||||
int msk = this.nonOpaqueMasks[i];
|
int msk = this.opaqueMasks[i];
|
||||||
if ((msk & 1) != 0) {//-x
|
if ((msk & 1)== 0) {//-x
|
||||||
long neighborId = this.neighboringFaces[i];
|
long neighborId = this.neighboringFaces[i];
|
||||||
|
//TODO also check self occlusion
|
||||||
|
|
||||||
int sidx = (i<<5) * 2;
|
int sidx = (i<<5) * 2;
|
||||||
long A = this.sectionData[sidx];
|
long A = this.sectionData[sidx];
|
||||||
@@ -1506,8 +1515,10 @@ public class RenderDataFactory {
|
|||||||
dualMeshNonOpaqueOuterX(0, A, Am, modelId, Mapper.getLightId(neighborId), nM, this.sectionData[sidx+2], this.sectionData[sidx+3], nnx, npx);
|
dualMeshNonOpaqueOuterX(0, A, Am, modelId, Mapper.getLightId(neighborId), nM, this.sectionData[sidx+2], this.sectionData[sidx+3], nnx, npx);
|
||||||
} else {skipA++;}
|
} else {skipA++;}
|
||||||
|
|
||||||
if ((msk & (1<<31)) != 0) {//+x
|
if ((msk & (1<<31)) == 0) {//+x
|
||||||
long neighborId = this.neighboringFaces[i+32*32];
|
long neighborId = this.neighboringFaces[i+32*32];
|
||||||
|
//TODO also check self occlusion
|
||||||
|
|
||||||
|
|
||||||
int sidx = (i*32+31) * 2;
|
int sidx = (i*32+31) * 2;
|
||||||
long A = this.sectionData[sidx];
|
long A = this.sectionData[sidx];
|
||||||
|
|||||||
@@ -83,12 +83,17 @@ public class ImportManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean makeAndRunIfNone(WorldEngine engine, Supplier<IDataImporter> factory) {
|
public boolean makeAndRunIfNone(WorldEngine engine, Supplier<IDataImporter> factory) {
|
||||||
synchronized (this) {
|
try {
|
||||||
if (this.activeImporters.containsKey(engine)) {
|
engine.acquireRef();
|
||||||
return false;
|
synchronized (this) {
|
||||||
|
if (this.activeImporters.containsKey(engine)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return this.tryRunImport(factory.get());
|
||||||
|
} finally {
|
||||||
|
engine.releaseRef();
|
||||||
}
|
}
|
||||||
return this.tryRunImport(factory.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean cancelImport(WorldEngine engine) {
|
public boolean cancelImport(WorldEngine engine) {
|
||||||
|
|||||||
Reference in New Issue
Block a user