Package net.minecraft.client.gl
Class ShaderEffect
java.lang.Object
net.minecraft.client.gl.ShaderEffect
- All Implemented Interfaces:
AutoCloseable
@Environment(CLIENT) public class ShaderEffect extends Object implements AutoCloseable
-
Field Summary
Fields Modifier and Type Field Description private List<Framebuffer>defaultSizedTargetsprivate intheightprivate floatlastTickDeltaprivate FramebuffermainTargetprivate Stringnameprivate List<PostProcessShader>passesprivate Matrix4fprojectionMatrixprivate ResourceManagerresourceManagerprivate Map<String,Framebuffer>targetsByNameprivate floattimeprivate intwidth -
Constructor Summary
Constructors Constructor Description ShaderEffect(TextureManager textureManager, ResourceManager resourceManager, Framebuffer framebuffer, Identifier location) -
Method Summary
Modifier and Type Method Description PostProcessShaderaddPass(String programName, Framebuffer source, Framebuffer dest)voidaddTarget(String name, int width, int height)voidclose()StringgetName()FramebuffergetSecondaryTarget(String name)private FramebuffergetTarget(String name)private voidparseEffect(TextureManager textureManager, Identifier location)private voidparsePass(TextureManager textureManager, JsonElement jsonPass)private voidparseTarget(JsonElement jsonTarget)private voidparseUniform(JsonElement jsonUniform)voidrender(float tickDelta)voidsetupDimensions(int targetsWidth, int targetsHeight)private voidsetupProjectionMatrix()
-
Field Details
-
mainTarget
-
resourceManager
-
name
-
passes
-
targetsByName
-
defaultSizedTargets
-
projectionMatrix
-
width
private int width -
height
private int height -
time
private float time -
lastTickDelta
private float lastTickDelta
-
-
Constructor Details
-
ShaderEffect
public ShaderEffect(TextureManager textureManager, ResourceManager resourceManager, Framebuffer framebuffer, Identifier location) throws IOException, JsonSyntaxException- Throws:
IOExceptionJsonSyntaxException
-
-
Method Details
-
parseEffect
private void parseEffect(TextureManager textureManager, Identifier location) throws IOException, JsonSyntaxException- Throws:
IOExceptionJsonSyntaxException
-
parseTarget
- Throws:
ShaderParseException
-
parsePass
- Throws:
IOException
-
parseUniform
- Throws:
ShaderParseException
-
getSecondaryTarget
-
addTarget
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
addPass
public PostProcessShader addPass(String programName, Framebuffer source, Framebuffer dest) throws IOException- Throws:
IOException
-
setupProjectionMatrix
private void setupProjectionMatrix() -
setupDimensions
public void setupDimensions(int targetsWidth, int targetsHeight) -
render
public void render(float tickDelta) -
getName
-
getTarget
-