-
Notifications
You must be signed in to change notification settings - Fork 56
Post Shaders
Toggle vanilla style post processing shaders, with several mods able to stack them without fighting.
Vanilla only lets one post effect be active, whatever set it last wins. PostShadersHelper puts
each effect in a group with an order, so contact lenses and a fisheye binocular effect can both
be on and always apply in the same sequence.
Declare a group per effect kind, with a priority. Lower applies first:
private static final PostShadersHelper.Group LENSES = new PostShadersHelper.Group(MyMod.res("contact_lenses"), 0);
private static final PostShadersHelper.Group BINOCULAR = new PostShadersHelper.Group(MyMod.res("binocular_effect"), 10);
private static final ResourceLocation LENS_POST = MyMod.res("shaders/post/colored_contact.json");Then toggle from a client tick. Passing null clears that group:
PostShadersHelper.toggleEffect(hasLenses ? LENS_POST : null, LENSES);The shader json is a normal vanilla post chain file, so anything that works in
assets/minecraft/shaders/post/ works here.
Example: PostShadersExample
CoreShaderContainer holds a core shader registered with ClientHelper.addShaderRegistration, so
you can use it in a RenderType without worrying about load order.
Iris is handled: Moonlight detects it and keeps the effects working with shaderpacks where possible.
Basics Platform Helpers Registration Networking Events Configs Config Screen
Resources Runtime Resource Packs Texture Manipulation Resource Helpers Block Set API
Client Custom Models Item Rendering Rendered Textures Post Shaders GUI Toolkit Colors
World Block and Item Interfaces Additional Item Placements Improved Entities Fake Levels World Data Dispenser Behaviors
Utilities Codec Utilities Misc Helpers Commands
Datapacks Villagers Soft Fluids Map Markers Spawn Boxes Global Datapack Folder