Class PostProcessingManager
java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,CompositePostPipeline>>
foundry.veil.api.CodecReloadListener<CompositePostPipeline>
foundry.veil.api.client.render.post.PostProcessingManager
- All Implemented Interfaces:
AutoCloseable,net.minecraft.server.packs.resources.PreparableReloadListener,org.lwjgl.system.NativeResource
public class PostProcessingManager
extends CodecReloadListener<CompositePostPipeline>
implements org.lwjgl.system.NativeResource
Manages all post pipelines.
Post Pipelines are a single "effect" that can be applied.
For example, a vanilla Minecraft creeper effect can be added using add(int, ResourceLocation)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA single active profile.Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier -
Field Summary
Fields inherited from class foundry.veil.api.CodecReloadListener
codec, converter -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the post-processing manager. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int priority, net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline with the specified priority.booleanadd(net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline under the default priority of1000.protected voidapply(@NotNull Map<net.minecraft.resources.ResourceLocation, CompositePostPipeline> data, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) voidendFrame()voidfree()@Nullable PostPipelinegetPipeline(net.minecraft.resources.ResourceLocation pipeline) Retrieves a post pipeline by name.@NotNull Set<net.minecraft.resources.ResourceLocation> booleanisActive(net.minecraft.resources.ResourceLocation pipeline) Checks to see if the specified pipeline is active.protected @NotNull Map<net.minecraft.resources.ResourceLocation, CompositePostPipeline> prepare(@NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) booleanremove(net.minecraft.resources.ResourceLocation pipeline) Removes the specified pipeline from the active profiles.static voidresolvePost(@Nullable AdvancedFbo framebuffer) Resolves the post-processing framebuffer color buffer into the specified framebuffer.static voidresolvePost(@Nullable AdvancedFbo framebuffer, int mask) Resolves the post-processing framebuffer result into the specified framebuffer.voidvoidrunPipeline(PostPipeline pipeline) Applies only the specified pipeline.voidrunPipeline(PostPipeline pipeline, boolean resolvePost) Applies only the specified pipeline.Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lwjgl.system.NativeResource
closeMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Constructor Details
-
PostProcessingManager
public PostProcessingManager()Creates a new instance of the post-processing manager.
-
-
Method Details
-
isActive
public boolean isActive(net.minecraft.resources.ResourceLocation pipeline) Checks to see if the specified pipeline is active.- Parameters:
pipeline- The pipeline to check for- Returns:
- Whether that pipeline is active
-
add
public boolean add(net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline under the default priority of1000. A higher priority indicates the pipeline should be run earlier than lower priority pipelines.- Parameters:
pipeline- The pipeline to add- Returns:
- Whether the pipeline was added or had a priority change
-
add
public boolean add(int priority, net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline with the specified priority. A higher priority indicates the pipeline should be run earlier than lower priority pipelines.- Parameters:
priority- The priority to set the pipeline to. The default priority is1000pipeline- The pipeline to add- Returns:
- Whether the pipeline was added or had a priority change
-
remove
public boolean remove(net.minecraft.resources.ResourceLocation pipeline) Removes the specified pipeline from the active profiles.- Parameters:
pipeline- The pipeline to remove- Returns:
- If the pipeline was previously active
-
getPipeline
@Nullable public @Nullable PostPipeline getPipeline(net.minecraft.resources.ResourceLocation pipeline) Retrieves a post pipeline by name.- Parameters:
pipeline- The pipeline to get- Returns:
- The pipeline found or
nullif it doesn't exist
-
endFrame
@Internal public void endFrame() -
runDefaultPipeline
-
runPipeline
Applies only the specified pipeline. Copies the post framebuffer to the main framebuffer after running the pipeline.- Parameters:
pipeline- The pipeline to run
-
runPipeline
Applies only the specified pipeline.- Parameters:
pipeline- The pipeline to runresolvePost- Whether to copy the post framebuffer to the main framebuffer after running the pipeline
-
resolvePost
Resolves the post-processing framebuffer color buffer into the specified framebuffer.- Parameters:
framebuffer- The framebuffer to resolve to
-
resolvePost
Resolves the post-processing framebuffer result into the specified framebuffer.- Parameters:
framebuffer- The framebuffer to resolve tomask- The buffers to copy
-
prepare
@NotNull protected @NotNull Map<net.minecraft.resources.ResourceLocation,CompositePostPipeline> prepare(@NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) - Overrides:
preparein classCodecReloadListener<CompositePostPipeline>
-
apply
protected void apply(@NotNull @NotNull Map<net.minecraft.resources.ResourceLocation, CompositePostPipeline> data, @NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) - Specified by:
applyin classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,CompositePostPipeline>>
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-
getPostPipelineContext
- Returns:
- The default context for post-processing
-
getPipelines
- Returns:
- All available pipelines
-
getActivePipelines
- Returns:
- An immutable view of all active profiles and their priorities
-