Package foundry.veil.render.post
Class PostPipelineContext
java.lang.Object
foundry.veil.render.post.PostPipelineContext
- All Implemented Interfaces:
PostPipeline.Context,ShaderTextureSource.Context,AutoCloseable,org.lwjgl.system.NativeResource
@Internal
public class PostPipelineContext
extends Object
implements PostPipeline.Context, org.lwjgl.system.NativeResource
Default implementation of
PostPipeline.Context.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplySamplers(ShaderProgram shader) Applies each sampler to the specified shader.voidbegin()Marks the start of a new post run.voidDraws a quad onto the full screen usingDefaultVertexFormat.POSITION.voidend()Ends the running pass and cleans up resources.voidfree()@Nullable AdvancedFbogetFramebuffer(net.minecraft.resources.ResourceLocation name) Retrieves a framebuffer by id.voidsetFramebuffer(net.minecraft.resources.ResourceLocation name, AdvancedFbo framebuffer) Sets a framebuffer to a name.voidsetSampler(CharSequence name, int id) Binds a named sampler id.Methods 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 foundry.veil.render.post.PostPipeline.Context
getFramebufferOrDraw, getTexture
-
Constructor Details
-
PostPipelineContext
public PostPipelineContext()Creates a new context to fit the specified window.
-
-
Method Details
-
begin
public void begin()Marks the start of a new post run. -
end
public void end()Ends the running pass and cleans up resources. -
drawScreenQuad
public void drawScreenQuad()Description copied from interface:PostPipeline.ContextDraws a quad onto the full screen usingDefaultVertexFormat.POSITION.- Specified by:
drawScreenQuadin interfacePostPipeline.Context
-
setSampler
Description copied from interface:PostPipeline.ContextBinds a named sampler id. All samplers can be applied withPostPipeline.Context.applySamplers(ShaderProgram)for adding them to shaders.- Specified by:
setSamplerin interfacePostPipeline.Context- Parameters:
name- The name of the samplerid- The id of the texture to bind
-
setFramebuffer
Description copied from interface:PostPipeline.ContextSets a framebuffer to a name. This allows post stages to create new framebuffers that can be accessed later on.- Specified by:
setFramebufferin interfacePostPipeline.Context- Parameters:
name- The name of the framebufferframebuffer- The framebuffer to set
-
applySamplers
Description copied from interface:PostPipeline.ContextApplies each sampler to the specified shader.- Specified by:
applySamplersin interfacePostPipeline.Context- Parameters:
shader- The shader to apply the samplers to
-
getFramebuffer
@Nullable public @Nullable AdvancedFbo getFramebuffer(net.minecraft.resources.ResourceLocation name) Description copied from interface:ShaderTextureSource.ContextRetrieves a framebuffer by id.- Specified by:
getFramebufferin interfaceShaderTextureSource.Context- Parameters:
name- The name of the framebuffer to retrieve- Returns:
- The framebuffer with that id or
nullif it was not found
-
getDrawFramebuffer
- Specified by:
getDrawFramebufferin interfacePostPipeline.Context- Returns:
- The main framebuffer to draw into. This is later copied onto the main framebuffer
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-