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")
|
||||
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:spark:1.10.152-fabric")
|
||||
|
||||
@@ -111,7 +111,7 @@ public class NormalRenderPipeline extends AbstractRenderPipeline {
|
||||
float invEndFogDelta = 1f / (end - start);
|
||||
float endDistance = Minecraft.getInstance().gameRenderer.getRenderDistance()*(float)Math.sqrt(3);
|
||||
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());
|
||||
} else {
|
||||
glUniform4f(4, 0, 0, 0, 0);
|
||||
|
||||
@@ -763,10 +763,12 @@ public class RenderDataFactory {
|
||||
//Check and test if can cull W.R.T neighbor
|
||||
if (Mapper.getBlockId(neighborId) != 0) {//Not air
|
||||
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?
|
||||
//TODO: check self occlsuion in the if statment
|
||||
fail = true;
|
||||
} else {
|
||||
} else */
|
||||
{
|
||||
long meta = this.modelMan.getModelMetadataFromClientId(modelId);
|
||||
|
||||
if (ModelQueries.faceOccludes(meta, (axis << 1) | (1 - side))) {
|
||||
@@ -778,10 +780,16 @@ public class RenderDataFactory {
|
||||
long nA = this.sectionData[(idx+skipAmount) * 2];
|
||||
long nB = this.sectionData[(idx+skipAmount) * 2 + 1];
|
||||
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?
|
||||
//TODO: check self occlsuion in the if statment
|
||||
failB = true;
|
||||
} else {
|
||||
} else
|
||||
*/
|
||||
|
||||
{
|
||||
if (ModelQueries.faceOccludes(nB, (axis << 1) | (side))) {
|
||||
failB = true;
|
||||
}
|
||||
@@ -1485,9 +1493,10 @@ public class RenderDataFactory {
|
||||
int skipB = 0;
|
||||
for (int z = 0; z < 32; z++) {
|
||||
int i = y*32+z;
|
||||
int msk = this.nonOpaqueMasks[i];
|
||||
if ((msk & 1) != 0) {//-x
|
||||
int msk = this.opaqueMasks[i];
|
||||
if ((msk & 1)== 0) {//-x
|
||||
long neighborId = this.neighboringFaces[i];
|
||||
//TODO also check self occlusion
|
||||
|
||||
int sidx = (i<<5) * 2;
|
||||
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);
|
||||
} else {skipA++;}
|
||||
|
||||
if ((msk & (1<<31)) != 0) {//+x
|
||||
if ((msk & (1<<31)) == 0) {//+x
|
||||
long neighborId = this.neighboringFaces[i+32*32];
|
||||
//TODO also check self occlusion
|
||||
|
||||
|
||||
int sidx = (i*32+31) * 2;
|
||||
long A = this.sectionData[sidx];
|
||||
|
||||
@@ -83,12 +83,17 @@ public class ImportManager {
|
||||
}
|
||||
|
||||
public boolean makeAndRunIfNone(WorldEngine engine, Supplier<IDataImporter> factory) {
|
||||
synchronized (this) {
|
||||
if (this.activeImporters.containsKey(engine)) {
|
||||
return false;
|
||||
try {
|
||||
engine.acquireRef();
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user