Am unsure if fix thing, hate this meshing code
This commit is contained in:
@@ -1027,23 +1027,11 @@ public class RenderDataFactory45 {
|
|||||||
if ((msk & 1) != 0) {//-x
|
if ((msk & 1) != 0) {//-x
|
||||||
long neighborId = this.neighboringFaces[i];
|
long neighborId = this.neighboringFaces[i];
|
||||||
boolean oki = true;
|
boolean oki = true;
|
||||||
if (Mapper.getBlockId(neighborId) != 0) {//Not air
|
|
||||||
long meta = this.modelMan.getModelMetadataFromClientId(this.modelMan.getModelId(Mapper.getBlockId(neighborId)));
|
|
||||||
if (ModelQueries.isFullyOpaque(meta)) {
|
|
||||||
oki = false;
|
|
||||||
}
|
|
||||||
//TODO: check neibor face
|
|
||||||
//else if (ModelQueries.faceOccludes(meta, (axis << 1) | (1 - side))) {
|
|
||||||
// oki = false;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
if (oki) {
|
|
||||||
ma.skip(skipA); skipA = 0;
|
|
||||||
int sidx = (i<<5) * 2;
|
int sidx = (i<<5) * 2;
|
||||||
long A = this.sectionData[sidx];
|
long A = this.sectionData[sidx];
|
||||||
long Am = this.sectionData[sidx + 1];
|
long Am = this.sectionData[sidx + 1];
|
||||||
|
|
||||||
//TODO: check if must cull against next entries face
|
|
||||||
if (ModelQueries.containsFluid(Am)) {
|
if (ModelQueries.containsFluid(Am)) {
|
||||||
int modelId = (int) ((A>>26)&0xFFFF);
|
int modelId = (int) ((A>>26)&0xFFFF);
|
||||||
A &= ~(0xFFFFL<<26);
|
A &= ~(0xFFFFL<<26);
|
||||||
@@ -1052,6 +1040,36 @@ public class RenderDataFactory45 {
|
|||||||
Am = this.modelMan.getModelMetadataFromClientId(fluidId);
|
Am = this.modelMan.getModelMetadataFromClientId(fluidId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (Mapper.getBlockId(neighborId) != 0) {//Not air
|
||||||
|
|
||||||
|
int modelId = this.modelMan.getModelId(Mapper.getBlockId(neighborId));
|
||||||
|
long meta = this.modelMan.getModelMetadataFromClientId(modelId);
|
||||||
|
if (ModelQueries.isFullyOpaque(meta)) {
|
||||||
|
oki = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
//TODO: check neibor face
|
||||||
|
if (ModelQueries.faceOccludes(meta, (axis<<1)|(1-side))) {
|
||||||
|
oki = false;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (ModelQueries.containsFluid(meta)) {
|
||||||
|
modelId = this.modelMan.getFluidClientStateId(modelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ModelQueries.cullsSame(Am)) {
|
||||||
|
if (modelId == ((A>>26)&0xFFFF)) {
|
||||||
|
oki = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oki) {
|
||||||
|
ma.skip(skipA); skipA = 0;
|
||||||
|
|
||||||
long lightData = ((neighborId&(0xFFL<<56))>>1);//A;
|
long lightData = ((neighborId&(0xFFL<<56))>>1);//A;
|
||||||
//if (!ModelQueries.faceUsesSelfLighting(Am, facingForward|(axis*2))) {//TODO: check this is right
|
//if (!ModelQueries.faceUsesSelfLighting(Am, facingForward|(axis*2))) {//TODO: check this is right
|
||||||
// lighter = this.sectionData[bi];
|
// lighter = this.sectionData[bi];
|
||||||
@@ -1067,20 +1085,9 @@ public class RenderDataFactory45 {
|
|||||||
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];
|
||||||
boolean oki = true;
|
boolean oki = true;
|
||||||
if (Mapper.getBlockId(neighborId) != 0) {//Not air
|
|
||||||
long meta = this.modelMan.getModelMetadataFromClientId(this.modelMan.getModelId(Mapper.getBlockId(neighborId)));
|
|
||||||
if (ModelQueries.isFullyOpaque(meta)) {
|
|
||||||
oki = false;
|
|
||||||
}
|
|
||||||
//TODO: check neibor face
|
|
||||||
//else if (ModelQueries.faceOccludes(meta, (axis << 1) | (1 - side))) {
|
|
||||||
// oki = false;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
if (oki) {
|
|
||||||
mb.skip(skipB); skipB = 0;
|
|
||||||
int sidx = (i*32+31) * 2;
|
|
||||||
|
|
||||||
|
|
||||||
|
int sidx = (i*32+31) * 2;
|
||||||
long A = this.sectionData[sidx];
|
long A = this.sectionData[sidx];
|
||||||
long Am = this.sectionData[sidx + 1];
|
long Am = this.sectionData[sidx + 1];
|
||||||
|
|
||||||
@@ -1093,6 +1100,36 @@ public class RenderDataFactory45 {
|
|||||||
Am = this.modelMan.getModelMetadataFromClientId(fluidId);
|
Am = this.modelMan.getModelMetadataFromClientId(fluidId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (Mapper.getBlockId(neighborId) != 0) {//Not air
|
||||||
|
int modelId = this.modelMan.getModelId(Mapper.getBlockId(neighborId));
|
||||||
|
long meta = this.modelMan.getModelMetadataFromClientId(modelId);
|
||||||
|
if (ModelQueries.isFullyOpaque(meta)) {
|
||||||
|
oki = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
//TODO: check neibor face
|
||||||
|
if (ModelQueries.faceOccludes(meta, (axis<<1)|(1-side))) {
|
||||||
|
oki = false;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (ModelQueries.containsFluid(meta)) {
|
||||||
|
modelId = this.modelMan.getFluidClientStateId(modelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ModelQueries.cullsSame(Am)) {
|
||||||
|
if (modelId == ((A>>26)&0xFFFF)) {
|
||||||
|
oki = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oki) {
|
||||||
|
mb.skip(skipB); skipB = 0;
|
||||||
|
|
||||||
long lightData = ((neighborId&(0xFFL<<56))>>1);//A;
|
long lightData = ((neighborId&(0xFFL<<56))>>1);//A;
|
||||||
//if (!ModelQueries.faceUsesSelfLighting(Am, facingForward|(axis*2))) {//TODO: check this is right
|
//if (!ModelQueries.faceUsesSelfLighting(Am, facingForward|(axis*2))) {//TODO: check this is right
|
||||||
// lighter = this.sectionData[bi];
|
// lighter = this.sectionData[bi];
|
||||||
|
|||||||
Reference in New Issue
Block a user