Interface ShaderEffectManager
- All Known Implementing Classes:
ReloadableShaderEffectManager
public interface ShaderEffectManager
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoiddispose(ManagedCoreShader shader) voiddispose(ManagedShaderEffect shader) Removes a shader from the global list of managed shaders, making it not respond to resource reloading and screen resizing.static ShaderEffectManagermanage(net.minecraft.resources.ResourceLocation location) Manages a post-processPostChainloaded from a json definition filemanage(net.minecraft.resources.ResourceLocation location, Consumer<ManagedShaderEffect> initCallback) Manages a post-processPostChainloaded from a json definition filemanageCoreShader(net.minecraft.resources.ResourceLocation location) Manages a coreShaderInstanceloaded from a json definition filemanageCoreShader(net.minecraft.resources.ResourceLocation location, com.mojang.blaze3d.vertex.VertexFormat vertexFormat) Manages a coreShaderInstanceloaded from a json definition filemanageCoreShader(net.minecraft.resources.ResourceLocation location, com.mojang.blaze3d.vertex.VertexFormat vertexFormat, Consumer<ManagedCoreShader> initCallback) Manages a coreShaderInstanceloaded from a json definition file
-
Method Details
-
getInstance
-
manage
@API(status=STABLE, since="1.0.0") ManagedShaderEffect manage(net.minecraft.resources.ResourceLocation location) Manages a post-processPostChainloaded from a json definition file- Parameters:
location- the location of the json within your mod's assets- Returns:
- a screen shader that will be automatically reloaded as needed
-
manage
@API(status=STABLE, since="1.0.0") ManagedShaderEffect manage(net.minecraft.resources.ResourceLocation location, Consumer<ManagedShaderEffect> initCallback) Manages a post-processPostChainloaded from a json definition file- Parameters:
location- the location of the json within your mod's assetsinitCallback- a block ran once the shader effect is initialized- Returns:
- a screen shader that will be automatically reloaded as needed
-
manageCoreShader
@API(status=EXPERIMENTAL, since="1.6.0") ManagedCoreShader manageCoreShader(net.minecraft.resources.ResourceLocation location) Manages a coreShaderInstanceloaded from a json definition fileThis overload forwards to
manageCoreShader(ResourceLocation, VertexFormat)withDefaultVertexFormat.NEW_ENTITY, the format used by entity renderingThe shader location must be in
assets/shaders/core. Eg. to get a shader located atmymod/assets/shaders/core/myshader.json:ShaderEffectManager.getInstance().manageCoreShader(Identifier.of("mymod", "myshader")- Parameters:
location- the location of the json within your mod's assets- Returns:
- a core render shader that will be reloaded as needed
-
manageCoreShader
@API(status=EXPERIMENTAL, since="1.6.0") ManagedCoreShader manageCoreShader(net.minecraft.resources.ResourceLocation location, com.mojang.blaze3d.vertex.VertexFormat vertexFormat) Manages a coreShaderInstanceloaded from a json definition fileThe shader location must be in
assets/shaders/core. Eg. to get a shader located atmymod/assets/shaders/core/myshader.json:ShaderEffectManager.getInstance().manageCoreShader(Identifier.of("mymod", "myshader")- Parameters:
location- the location of the json within your mod's assetsvertexFormat- the format expected by your shader- Returns:
- a core render shader that will be reloaded as needed
-
manageCoreShader
@API(status=EXPERIMENTAL, since="1.6.0") ManagedCoreShader manageCoreShader(net.minecraft.resources.ResourceLocation location, com.mojang.blaze3d.vertex.VertexFormat vertexFormat, Consumer<ManagedCoreShader> initCallback) Manages a coreShaderInstanceloaded from a json definition fileThe shader location must be in
assets/shaders/core. E.g. to get a shader located atmymod/assets/shaders/core/myshader.json:ShaderEffectManager.getInstance().manageCoreShader(Identifier.of("mymod", "myshader")- Parameters:
location- the location of the json within your mod's assetsvertexFormat- the format expected by your shaderinitCallback- a block ran once the shader effect is initialized- Returns:
- a core render shader that will be reloaded as needed
-
dispose
Removes a shader from the global list of managed shaders, making it not respond to resource reloading and screen resizing. This also callsManagedShaderEffect.release()to release the shader's resources. AManagedShaderEffectobject cannot be used after it has been disposed of.- Parameters:
shader- the shader to stop managing- See Also:
-
dispose
-