Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for referencing custom programs in post shaders (so mods can create their own /post shaders) #4140

Open
Sollace opened this issue Oct 4, 2024 · 0 comments

Comments

@Sollace
Copy link
Contributor

Sollace commented Oct 4, 2024

The basic request is to apply the ShaderProgram patch from here to the JsonEffectShaderProgram constructor here:

	public JsonEffectShaderProgram(ResourceFactory factory, String name) throws IOException {
		Identifier identifier = Identifier.ofVanilla("shaders/program/" + name + ".json");
		this.name = name;
		Resource resource = factory.getResourceOrThrow(identifier);

Doing so would allow post shaders like this one to function.

/assets/mymod/shaders/post/desaturate.json

{
    "targets": [
        "swap"
    ],
    "passes": [
        {
            "name": "mymod:color_convolve",
            "intarget": "minecraft:main",
            "outtarget": "swap",
            "uniforms": [
                {
                    "name": "Saturation",
                    "values": [ 0.2 ]
                }
            ]
        },
        {
            "name": "minecraft:blit",
            "intarget": "swap",
            "outtarget": "minecraft:main"
        }
    ]
}
@Sollace Sollace changed the title Allow for referencing modded render passes in post shaders (so mods can create their own /post shaders) Allow for referencing custom programs in post shaders (so mods can create their own /post shaders) Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant