@Environment(value=CLIENT) public class ShaderEffect extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
private List<Framebuffer> |
defaultSizedTargets |
private int |
height |
private float |
lastTickDelta |
private Framebuffer |
mainTarget |
private String |
name |
private List<PostProcessShader> |
passes |
private Matrix4f |
projectionMatrix |
private ResourceManager |
resourceManager |
private Map<String,Framebuffer> |
targetsByName |
private float |
time |
private int |
width |
Constructor and Description |
---|
ShaderEffect(TextureManager textureManager,
ResourceManager resourceManager,
Framebuffer framebuffer,
Identifier location) |
Modifier and Type | Method and Description |
---|---|
PostProcessShader |
addPass(String programName,
Framebuffer source,
Framebuffer dest) |
void |
addTarget(String name,
int width,
int height) |
void |
close() |
String |
getName() |
Framebuffer |
getSecondaryTarget(String name) |
private Framebuffer |
getTarget(String name) |
private void |
parseEffect(TextureManager textureManager,
Identifier location) |
private void |
parsePass(TextureManager textureManager,
JsonElement jsonPass) |
private void |
parseTarget(JsonElement jsonTarget) |
private void |
parseUniform(JsonElement jsonUniform) |
void |
render(float tickDelta) |
void |
setupDimensions(int targetsWidth,
int targetsHeight) |
private void |
setupProjectionMatrix() |
private final Framebuffer mainTarget
private final ResourceManager resourceManager
private final String name
private final List<PostProcessShader> passes
private final Map<String,Framebuffer> targetsByName
private final List<Framebuffer> defaultSizedTargets
private Matrix4f projectionMatrix
private int width
private int height
private float time
private float lastTickDelta
public ShaderEffect(TextureManager textureManager, ResourceManager resourceManager, Framebuffer framebuffer, Identifier location) throws IOException, JsonSyntaxException
IOException
JsonSyntaxException
private void parseEffect(TextureManager textureManager, Identifier location) throws IOException, JsonSyntaxException
IOException
JsonSyntaxException
private void parseTarget(JsonElement jsonTarget) throws ShaderParseException
ShaderParseException
private void parsePass(TextureManager textureManager, JsonElement jsonPass) throws IOException
IOException
private void parseUniform(JsonElement jsonUniform) throws ShaderParseException
ShaderParseException
public Framebuffer getSecondaryTarget(String name)
public void addTarget(String name, int width, int height)
public void close()
close
in interface AutoCloseable
public PostProcessShader addPass(String programName, Framebuffer source, Framebuffer dest) throws IOException
IOException
private void setupProjectionMatrix()
public void setupDimensions(int targetsWidth, int targetsHeight)
public void render(float tickDelta)
public final String getName()
private Framebuffer getTarget(String name)