Pass RenderLayer into contraption structure context
This commit is contained in:
parent
0b25335f8e
commit
2856594cc8
3 changed files with 7 additions and 8 deletions
|
@ -43,20 +43,20 @@ public class FlwContraptionManager extends ContraptionRenderingWorld<FlwContrapt
|
||||||
GlStateTracker.State restoreState = GlStateTracker.getRestoreState();
|
GlStateTracker.State restoreState = GlStateTracker.getRestoreState();
|
||||||
GlTextureUnit active = GlTextureUnit.getActive();
|
GlTextureUnit active = GlTextureUnit.getActive();
|
||||||
|
|
||||||
RenderType layer = event.getType();
|
RenderType type = event.getType();
|
||||||
|
|
||||||
layer.setupRenderState();
|
type.setupRenderState();
|
||||||
|
|
||||||
Textures.bindActiveTextures();
|
Textures.bindActiveTextures();
|
||||||
|
|
||||||
ContraptionProgram structureShader = CreateContexts.STRUCTURE.getProgram(AllProgramSpecs.PASSTHRU, Formats.BLOCK);
|
ContraptionProgram structureShader = CreateContexts.STRUCTURE.getProgram(AllProgramSpecs.PASSTHRU, Formats.BLOCK, RenderLayer.CUTOUT);
|
||||||
|
|
||||||
structureShader.bind();
|
structureShader.bind();
|
||||||
structureShader.uploadViewProjection(event.viewProjection);
|
structureShader.uploadViewProjection(event.viewProjection);
|
||||||
structureShader.uploadCameraPos(event.camX, event.camY, event.camZ);
|
structureShader.uploadCameraPos(event.camX, event.camY, event.camZ);
|
||||||
|
|
||||||
for (FlwContraption flwContraption : visible) {
|
for (FlwContraption flwContraption : visible) {
|
||||||
flwContraption.renderStructureLayer(layer, structureShader);
|
flwContraption.renderStructureLayer(type, structureShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreState.restore();
|
restoreState.restore();
|
||||||
|
@ -76,7 +76,7 @@ public class FlwContraptionManager extends ContraptionRenderingWorld<FlwContrapt
|
||||||
GlTextureUnit.T4.makeActive();
|
GlTextureUnit.T4.makeActive();
|
||||||
glBindTexture(GL_TEXTURE_3D, 0);
|
glBindTexture(GL_TEXTURE_3D, 0);
|
||||||
|
|
||||||
layer.clearRenderState();
|
type.clearRenderState();
|
||||||
active.makeActive();
|
active.makeActive();
|
||||||
restoreState.restore();
|
restoreState.restore();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package com.simibubi.create.foundation.render;
|
package com.simibubi.create.foundation.render;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.core.shader.gamestate.IGameStateProvider;
|
import com.jozufozu.flywheel.core.shader.GameStateProvider;
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import com.simibubi.create.content.contraptions.KineticDebugger;
|
import com.simibubi.create.content.contraptions.KineticDebugger;
|
||||||
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
|
||||||
public class RainbowDebugStateProvider implements IGameStateProvider {
|
public class RainbowDebugStateProvider implements GameStateProvider {
|
||||||
|
|
||||||
public static final RainbowDebugStateProvider INSTANCE = new RainbowDebugStateProvider();
|
public static final RainbowDebugStateProvider INSTANCE = new RainbowDebugStateProvider();
|
||||||
public static final ResourceLocation NAME = Create.asResource("rainbow_debug");
|
public static final ResourceLocation NAME = Create.asResource("rainbow_debug");
|
||||||
|
|
|
@ -38,7 +38,6 @@ vec4 FLWVertex(inout Vertex v) {
|
||||||
#elif defined(FRAGMENT_SHADER)
|
#elif defined(FRAGMENT_SHADER)
|
||||||
#use "flywheel:core/lightutil.glsl"
|
#use "flywheel:core/lightutil.glsl"
|
||||||
|
|
||||||
#define ALPHA_DISCARD 0.1
|
|
||||||
// optimize discard usage
|
// optimize discard usage
|
||||||
#if defined(ALPHA_DISCARD)
|
#if defined(ALPHA_DISCARD)
|
||||||
#if defined(GL_ARB_conservative_depth)
|
#if defined(GL_ARB_conservative_depth)
|
||||||
|
|
Loading…
Reference in a new issue