Skip to content

Commit

Permalink
Merge branch 'master' into 25w07a
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Feb 17, 2025
2 parents bc53215 + ea8073d commit af3f4a3
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 118 deletions.
34 changes: 34 additions & 0 deletions src/main/java/net/wurstclient/WurstRenderLayers.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,38 @@ public enum WurstRenderLayers
.lineWidth(new RenderPhase.LineWidth(OptionalDouble.of(2)))
.layering(RenderLayer.VIEW_OFFSET_Z_LAYERING)
.target(RenderLayer.ITEM_ENTITY_TARGET).build(false));

/**
* Similar to {@link RenderLayer#getLineStrip()}, but with line width 2 and
* no depth test.
*
* @apiNote As of 25w07a (1.21.5), turning off depth test still has to be
* done manually, by calling
* {@code RenderSystem.depthFunc(GlConst.GL_ALWAYS);} before
* drawing the ESP lines. Without this code, ESP lines will be
* drawn with depth test set to LEQUALS (only visible if not
* obstructed).
*/
public static final RenderLayer.MultiPhase ESP_LINE_STRIP =
RenderLayer.of("wurst:esp_line_strip", 1536, false, true,
WurstShaderLayers.ESP_LINE_STRIP,
RenderLayer.MultiPhaseParameters.builder()
.lineWidth(new RenderPhase.LineWidth(OptionalDouble.of(2)))
.layering(RenderLayer.VIEW_OFFSET_Z_LAYERING)
.target(RenderLayer.ITEM_ENTITY_TARGET).build(false));

/**
* Similar to {@link RenderLayer#getDebugQuads()}, but with culling enabled
* and no depth test.
*
* @apiNote As of 25w07a (1.21.5), turning off depth test still has to be
* done manually, by calling
* {@code RenderSystem.depthFunc(GlConst.GL_ALWAYS);} before
* drawing the ESP quads. Without this code, ESP quads will be
* drawn with depth test set to LEQUALS (only visible if not
* obstructed).
*/
public static final RenderLayer.MultiPhase ESP_QUADS = RenderLayer.of(
"wurst:esp_quads", 1536, false, true, WurstShaderLayers.ESP_QUADS,
RenderLayer.MultiPhaseParameters.builder().build(false));
}
21 changes: 21 additions & 0 deletions src/main/java/net/wurstclient/WurstShaderLayers.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.client.gl.ShaderProgramLayers;
import net.minecraft.client.render.DepthTestState;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormat.DrawMode;
import net.minecraft.client.render.VertexFormats;

public enum WurstShaderLayers
Expand Down Expand Up @@ -54,4 +55,24 @@ public enum WurstShaderLayers
ShaderProgramLayer.create(ShaderProgramLayers.RENDERTYPE_LINES)
.setName("pipeline/wurst_esp_lines")
.AddDepthProgram(DepthTestState.NO_DEPTH_TEST).create());

/**
* Similar to the LINE_STRIP ShaderProgramLayer, but with no depth test.
*/
public static final ShaderProgramLayer ESP_LINE_STRIP =
ShaderProgramLayers.addProgram(
ShaderProgramLayer.create(ShaderProgramLayers.RENDERTYPE_LINES)
.setName("pipeline/wurst_esp_line_strip")
.addFormat(VertexFormats.LINES, DrawMode.LINE_STRIP)
.AddDepthProgram(DepthTestState.NO_DEPTH_TEST).create());

/**
* Similar to the DEBUG_QUADS ShaderProgramLayer, but with culling enabled
* and no depth test.
*/
public static final ShaderProgramLayer ESP_QUADS =
ShaderProgramLayers.addProgram(
ShaderProgramLayer.create(ShaderProgramLayers.POSITION_COLOR)
.setName("pipeline/wurst_esp_quads")
.AddDepthProgram(DepthTestState.NO_DEPTH_TEST).create());
}
Loading

0 comments on commit af3f4a3

Please sign in to comment.