Aaa
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package me.cortex.voxy.client.core.rendering;
|
package me.cortex.voxy.client.core.rendering;
|
||||||
|
|
||||||
|
import io.netty.util.internal.MathUtil;
|
||||||
|
import me.cortex.voxy.client.core.gl.Capabilities;
|
||||||
import me.cortex.voxy.client.core.model.ModelBakerySubsystem;
|
import me.cortex.voxy.client.core.model.ModelBakerySubsystem;
|
||||||
import me.cortex.voxy.client.core.model.ModelStore;
|
import me.cortex.voxy.client.core.model.ModelStore;
|
||||||
import me.cortex.voxy.client.core.rendering.building.BuiltSection;
|
import me.cortex.voxy.client.core.rendering.building.BuiltSection;
|
||||||
@@ -52,7 +54,7 @@ public class RenderService<T extends AbstractSectionRenderer<J, ?>, J extends Vi
|
|||||||
|
|
||||||
//Max sections: ~500k
|
//Max sections: ~500k
|
||||||
//Max geometry: 1 gb
|
//Max geometry: 1 gb
|
||||||
this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<20, (1L<<31)-1024);
|
this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<20, Math.min((1L<<(64-Long.numberOfLeadingZeros(Capabilities.INSTANCE.ssboMaxSize-1)))<<1, 1L<<32)-1024/*(1L<<32)-1024*/);
|
||||||
Logger.info("Using renderer: " + this.sectionRenderer.getClass().getSimpleName());
|
Logger.info("Using renderer: " + this.sectionRenderer.getClass().getSimpleName());
|
||||||
|
|
||||||
//Do something incredibly hacky, we dont need to keep the reference to this around, so just connect and discard
|
//Do something incredibly hacky, we dont need to keep the reference to this around, so just connect and discard
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ public class RenderDataFactory45 {
|
|||||||
|
|
||||||
|
|
||||||
private final Mesher blockMesher = new Mesher();
|
private final Mesher blockMesher = new Mesher();
|
||||||
|
private final Mesher seondaryblockMesher = new Mesher();//Used for dual non-opaque geometry
|
||||||
|
|
||||||
public RenderDataFactory45(WorldEngine world, ModelFactory modelManager, boolean emitMeshlets) {
|
public RenderDataFactory45(WorldEngine world, ModelFactory modelManager, boolean emitMeshlets) {
|
||||||
this.world = world;
|
this.world = world;
|
||||||
@@ -406,26 +407,36 @@ public class RenderDataFactory45 {
|
|||||||
|
|
||||||
private void generateYZNonOpaqueInnerGeometry(int axis) {
|
private void generateYZNonOpaqueInnerGeometry(int axis) {
|
||||||
//Note: think is ok to just reuse.. blockMesher
|
//Note: think is ok to just reuse.. blockMesher
|
||||||
|
this.seondaryblockMesher.doAuxiliaryFaceOffset = false;
|
||||||
this.blockMesher.axis = axis;
|
this.blockMesher.axis = axis;
|
||||||
for (int layer = 0; layer < 32; layer++) {
|
this.seondaryblockMesher.axis = axis;
|
||||||
|
for (int layer = 0; layer < 32; layer++) {//(should be 1->31, then have outer face mesher)
|
||||||
this.blockMesher.auxiliaryPosition = layer;
|
this.blockMesher.auxiliaryPosition = layer;
|
||||||
|
this.seondaryblockMesher.auxiliaryPosition = layer;
|
||||||
|
int cSkip = 0;
|
||||||
for (int other = 0; other < 32; other++) {//TODO: need to do the faces that border sections
|
for (int other = 0; other < 32; other++) {//TODO: need to do the faces that border sections
|
||||||
int pidx = axis == 0 ? (layer * 32 + other) : (other * 32 + layer);
|
int pidx = axis == 0 ? (layer * 32 + other) : (other * 32 + layer);
|
||||||
|
|
||||||
int msk = this.nonOpaqueMasks[pidx];
|
int msk = this.nonOpaqueMasks[pidx];
|
||||||
|
|
||||||
if (msk == 0) {
|
if (msk == 0) {
|
||||||
this.blockMesher.skip(32);
|
cSkip += 32;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.blockMesher.skip(cSkip);
|
||||||
|
this.seondaryblockMesher.skip(cSkip);
|
||||||
|
cSkip = 0;
|
||||||
|
|
||||||
int cIdx = -1;
|
int cIdx = -1;
|
||||||
while (msk != 0) {
|
while (msk != 0) {
|
||||||
int index = Integer.numberOfTrailingZeros(msk);//Is also the x-axis index
|
int index = Integer.numberOfTrailingZeros(msk);//Is also the x-axis index
|
||||||
int delta = index - cIdx - 1;
|
int delta = index - cIdx - 1;
|
||||||
cIdx = index; //index--;
|
cIdx = index; //index--;
|
||||||
if (delta != 0) this.blockMesher.skip(delta);
|
if (delta != 0) {
|
||||||
|
this.blockMesher.skip(delta);
|
||||||
|
this.seondaryblockMesher.skip(delta);
|
||||||
|
}
|
||||||
msk &= ~Integer.lowestOneBit(msk);
|
msk &= ~Integer.lowestOneBit(msk);
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -436,19 +447,28 @@ public class RenderDataFactory45 {
|
|||||||
long B = this.sectionData[idx * 2+1];
|
long B = this.sectionData[idx * 2+1];
|
||||||
if (ModelQueries.isTranslucent(B)) {
|
if (ModelQueries.isTranslucent(B)) {
|
||||||
this.blockMesher.putNext(0);
|
this.blockMesher.putNext(0);
|
||||||
|
this.seondaryblockMesher.putNext(0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Example thing thats just wrong but as example
|
//Example thing thats just wrong but as example
|
||||||
this.blockMesher.putNext((long) (false ? 0L : 1L) |
|
this.blockMesher.putNext((long) (false ? 0L : 1L) |
|
||||||
((A & 0xFFFFL) << 26) |
|
((A & 0xFFFFL) << 26) |
|
||||||
(((0xFFL) & 0xFF) << 55) |
|
(((0xFFL) & 0xFF) << 55) |
|
||||||
((A&(0x1FFL<<24))<<(46-24))
|
((A&(0x1FFL<<24))<<(46-24))
|
||||||
);
|
);
|
||||||
|
this.seondaryblockMesher.putNext((long) (true ? 0L : 1L) |
|
||||||
|
((A & 0xFFFFL) << 26) |
|
||||||
|
(((0xFFL) & 0xFF) << 55) |
|
||||||
|
((A&(0x1FFL<<24))<<(46-24))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.blockMesher.endRow();
|
this.blockMesher.endRow();
|
||||||
|
this.seondaryblockMesher.endRow();
|
||||||
}
|
}
|
||||||
this.blockMesher.finish();
|
this.blockMesher.finish();
|
||||||
|
this.seondaryblockMesher.finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -654,6 +674,11 @@ public class RenderDataFactory45 {
|
|||||||
mb.doAuxiliaryFaceOffset = true;
|
mb.doAuxiliaryFaceOffset = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void generateXNonOpaqueInnerGeometry() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void generateXFaces() {
|
private void generateXFaces() {
|
||||||
this.generateXOpaqueInnerGeometry();
|
this.generateXOpaqueInnerGeometry();
|
||||||
this.generateXOuterOpaqueGeometry();
|
this.generateXOuterOpaqueGeometry();
|
||||||
@@ -689,6 +714,8 @@ public class RenderDataFactory45 {
|
|||||||
{//Reset all the block meshes
|
{//Reset all the block meshes
|
||||||
this.blockMesher.reset();
|
this.blockMesher.reset();
|
||||||
this.blockMesher.doAuxiliaryFaceOffset = true;
|
this.blockMesher.doAuxiliaryFaceOffset = true;
|
||||||
|
this.seondaryblockMesher.reset();
|
||||||
|
this.seondaryblockMesher.doAuxiliaryFaceOffset = true;
|
||||||
for (var mesher : this.xAxisMeshers) {
|
for (var mesher : this.xAxisMeshers) {
|
||||||
mesher.reset();
|
mesher.reset();
|
||||||
mesher.doAuxiliaryFaceOffset = true;
|
mesher.doAuxiliaryFaceOffset = true;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class VoxyCommon implements ModInitializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//This is hardcoded like this because people do not understand what they are doing
|
//This is hardcoded like this because people do not understand what they are doing
|
||||||
private static final boolean GlobalVerificationDisableOverride = false;//System.getProperty("voxy.verificationDisableOverride", "false").equals("true");
|
private static final boolean GlobalVerificationDisableOverride = true;//System.getProperty("voxy.verificationDisableOverride", "false").equals("true");
|
||||||
public static boolean isVerificationFlagOn(String name) {
|
public static boolean isVerificationFlagOn(String name) {
|
||||||
return (!GlobalVerificationDisableOverride) && System.getProperty("voxy."+name, "true").equals("true");
|
return (!GlobalVerificationDisableOverride) && System.getProperty("voxy."+name, "true").equals("true");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user