Start prep for temporal
This commit is contained in:
@@ -27,7 +27,7 @@ public class VoxyConfig implements OptionStorage<VoxyConfig> {
|
||||
public boolean ingestEnabled = true;
|
||||
public int sectionRenderDistance = 16;
|
||||
public int serviceThreads = Math.max(Runtime.getRuntime().availableProcessors()/2, 1);
|
||||
public float subDivisionSize = 128;
|
||||
public float subDivisionSize = 64;
|
||||
public boolean renderVanillaFog = false;
|
||||
public boolean renderStatistics = false;
|
||||
|
||||
|
||||
@@ -112,6 +112,10 @@ public class MDICSectionRenderer extends AbstractSectionRenderer<MDICViewport, B
|
||||
}
|
||||
|
||||
|
||||
private void renderTemporalTerrain() {
|
||||
|
||||
}
|
||||
|
||||
private void renderTerrain() {
|
||||
//RenderLayer.getCutoutMipped().startDrawing();
|
||||
|
||||
@@ -142,6 +146,30 @@ public class MDICSectionRenderer extends AbstractSectionRenderer<MDICViewport, B
|
||||
this.renderTerrain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTranslucent(MDICViewport viewport) {
|
||||
if (this.geometryManager.getSectionCount() == 0) return;
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
glDisable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
this.terrainShader.bind();
|
||||
glBindVertexArray(RenderService.STATIC_VAO);//Needs to be before binding
|
||||
this.bindRenderingBuffers();
|
||||
|
||||
glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_SHORT, TRANSLUCENT_OFFSET*5*4, 4*4, Math.min(this.geometryManager.getSectionCount(), 100_000), 0);
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
glBindVertexArray(0);
|
||||
glBindSampler(0, 0);
|
||||
glBindTextureUnit(0, 0);
|
||||
glBindSampler(1, 0);
|
||||
glBindTextureUnit(1, 0);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDrawCallsAndRenderTemporal(MDICViewport viewport, GlBuffer sectionRenderList) {
|
||||
if (this.geometryManager.getSectionCount() == 0) return;
|
||||
@@ -203,6 +231,7 @@ public class MDICSectionRenderer extends AbstractSectionRenderer<MDICViewport, B
|
||||
glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, this.drawCountCallBuffer.id);
|
||||
glDispatchComputeIndirect(0);
|
||||
glMemoryBarrier(GL_COMMAND_BARRIER_BIT|GL_SHADER_STORAGE_BARRIER_BIT);
|
||||
|
||||
if (RenderStatistics.enabled) {
|
||||
DownloadStream.INSTANCE.download(this.statisticsBuffer, down->{
|
||||
for (int i = 0; i < 5; i++) {
|
||||
@@ -217,31 +246,6 @@ public class MDICSectionRenderer extends AbstractSectionRenderer<MDICViewport, B
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTranslucent(MDICViewport viewport) {
|
||||
if (this.geometryManager.getSectionCount() == 0) return;
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
glDisable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
this.terrainShader.bind();
|
||||
glBindVertexArray(RenderService.STATIC_VAO);//Needs to be before binding
|
||||
this.bindRenderingBuffers();
|
||||
|
||||
glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_SHORT, TRANSLUCENT_OFFSET*5*4, 4*4, Math.min(this.geometryManager.getSectionCount(), 100_000), 0);
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
glBindVertexArray(0);
|
||||
glBindSampler(0, 0);
|
||||
glBindTextureUnit(0, 0);
|
||||
glBindSampler(1, 0);
|
||||
glBindTextureUnit(1, 0);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDebug(List<String> lines) {
|
||||
super.addDebug(lines);
|
||||
|
||||
@@ -63,8 +63,8 @@ layout(binding = DRAW_COUNT_BUFFER_BINDING, std430) restrict buffer DrawCommandC
|
||||
|
||||
uint opaqueDrawCount;
|
||||
uint translucentDrawCount;
|
||||
uint temporalOpaqueDrawCount;
|
||||
|
||||
uint pad_A;
|
||||
DrawCommand cullDrawIndirectCommand;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -14,6 +14,7 @@ void main() {
|
||||
|
||||
opaqueDrawCount = 0;
|
||||
translucentDrawCount = 0;
|
||||
temporalOpaqueDrawCount = 0;
|
||||
|
||||
cullDrawIndirectCommand.count = 6*2*3;
|
||||
cullDrawIndirectCommand.instanceCount = sectionCount;
|
||||
|
||||
Reference in New Issue
Block a user