forked from Kittycraft/Psychedelicraft
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
184 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 8 additions & 14 deletions
22
src/main/java/ivorius/psychedelicraft/client/render/shader/PSShaders.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
package ivorius.psychedelicraft.client.render.shader; | ||
|
||
import java.util.concurrent.atomic.AtomicReference; | ||
import java.util.function.Supplier; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import ivorius.psychedelicraft.Psychedelicraft; | ||
import net.minecraft.client.gl.ShaderProgram; | ||
import net.minecraft.client.gl.Defines; | ||
import net.minecraft.client.gl.ShaderProgramKey; | ||
import net.minecraft.client.gl.ShaderProgramKeys; | ||
import net.minecraft.client.render.VertexFormat; | ||
import net.minecraft.client.render.VertexFormats; | ||
|
||
public interface PSShaders { | ||
@Nullable | ||
Supplier<ShaderProgram> ZERO_MATTER = register("rendertype_zero_matter", VertexFormats.POSITION_COLOR); | ||
ShaderProgramKey ZERO_MATTER = register("rendertype_zero_matter", VertexFormats.POSITION_COLOR); | ||
|
||
static void bootstrap() {} | ||
|
||
private static Supplier<ShaderProgram> register(String name, VertexFormat format) { | ||
AtomicReference<ShaderProgram> program = new AtomicReference<>(null); | ||
CoreShaderRegistrationCallback.EVENT.register(context -> { | ||
context.register(Psychedelicraft.id(name), format, program::set); | ||
}); | ||
return program::get; | ||
private static ShaderProgramKey register(String name, VertexFormat format) { | ||
ShaderProgramKey key = new ShaderProgramKey(Psychedelicraft.id("core/" + name), format, Defines.EMPTY); | ||
ShaderProgramKeys.getAll().add(key); | ||
return key; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/ivorius/psychedelicraft/client/render/shader/PostEffectPassSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ivorius.psychedelicraft.client.render.shader; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.client.gl.PostEffectPass; | ||
|
||
public interface PostEffectPassSupplier { | ||
List<PostEffectPass> getPasses(); | ||
|
||
void setPasses(List<PostEffectPass> passes); | ||
|
||
interface Pass { | ||
String getId(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.