Skip to content

Commit

Permalink
Optimize imports and fix javadoc in pre-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhcode committed Jan 1, 2025
1 parent d86fe93 commit 8967248
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package org.ladysnake.effective.core.render.transformer;

import foundry.veil.api.client.render.shader.processor.ShaderPreProcessor;
import foundry.veil.api.glsl.GlslSyntaxException;
import foundry.veil.api.glsl.node.GlslNode;
import foundry.veil.api.glsl.node.GlslNodeList;
import foundry.veil.api.glsl.node.GlslTree;
import foundry.veil.api.glsl.node.branch.GlslSelectionNode;
import foundry.veil.api.glsl.node.expression.GlslCompareNode;
import foundry.veil.api.glsl.node.primary.GlslFloatConstantNode;
import foundry.veil.lib.anarres.cpp.LexerException;
import net.minecraft.util.Identifier;

import java.io.IOException;

/**
* A pre-processor intended to verify the Minecraft particle transparency check isn't active.
* <p>
Expand All @@ -28,8 +24,11 @@
* if (color.a < 0.0000001) {
* discard;
* }
* }
*
* Inside of any fragment shader named <code>particle</code>.
*
* @author RyanHCode
*/
public class EffectiveTransparencyFixPreProcessor implements ShaderPreProcessor {

Expand All @@ -47,9 +46,7 @@ public void modify(final Context ctx, final GlslTree tree) {
assert mainFunctionBody != null : "Main function body is null";

for (final GlslNode node : mainFunctionBody) {

if (node instanceof GlslSelectionNode selectionNode && selectionNode.getExpression() instanceof GlslCompareNode compareNode) {

// We know there's an if statement (selectionNode) with a comparison inside it
// If the second part of the comparison is 0.1, and the comparison type is "less than", we can assume it's the transparency check

Expand Down

0 comments on commit 8967248

Please sign in to comment.