Iris Shaders

Iris Shaders

36M Downloads

[Feature Request] New standard for shader packs

marcospampi opened this issue ยท 2 comments

commented

Is your feature request related to a problem? Please describe.
Shader pack's configuration's a pain in the eyes, I bet it is worse for those who make them.

Describe the solution you'd like
I'd like to suggest a new community standard, which needs thinking and approval from the community.
My suggestion is the following:

  • A shader pack must contain a manifest file, which describes the author, the version of the shader, supported versions of Minecraft and required or optional OpenGL extensions used by the shader.
  • The manifest file should contain a section dedicated to presets, thus allowing the author to bundle one single pack per version.
  • A second file should describe the sets of parameters the shader shall use.
  • A third file should describe the GUI for tweaking it.

Describe alternatives you've considered
Stick with shader.properties.

Additional context
A manifest file could be like this:
( I made it in a hurry and it's just a very bogus draft )

{
    "name": "Potato shaders",
    "author": "marcospampi",
    "license": "WTFPL",

    "links": [ "awesomewebsite.github.io" ],
    
    "version": "1.234",
    "release_date": "2021-08-22T13:45:51.340Z",
    "engine_versions": {
        "min_version": "1.13.2",
        "max_version": "1.17.1"
    },

    "parameters": [
        "parameters.json",
        "parameters2.json"
    ],

    // one entry shader
    "entry": "shaders/entry.glsl",

    // or multiple entries shaders
    "entries": {
        "shadows": "shaders/shadows.glsl",
        "entities": "shaders/entity.glsl",
        "world": "shaders/world.glsl"
        // and many more ...
    },

    // exensions, I'm not into CG related programming, so I put some random
    "glsl_extensions": {
        "required": [
            "GL_ARB_shader_texture_lod"
        ],
        "optional": [
            "GL_EXT_gpu_shader4"
        ]
    },
    // gui file
    "options": "options.json",

    "presets": [
        {
            "name": "lite",
            "file": "presets/lite.json"
        },
        {
            "name": "medium",
            "file": "presets/medium.json"
        },
        {
            "name": "wreck my pc",
            "file": "presets/wreckmypc.json"
        }
    ]

}

A parameter file could be like this:

// shaders parameters file
{
    "dimension": "any",
    "parameters": {
        "SHOW_CLOUDS": {
            "type": "bool",
            "default": true
        },
        "BLOOM_RADIUS": {
            "type": "float",
            "default": 1.0
        },
        "SHADOW_SIZE": {
            "type": "int32",
            "default": 256
        }
        // and so on, very bland here
    }
}

A preset file could look like this

// presets file 
{
    "SHOW_CLOUDS": false,
    "BLOOM_RADIUS": 0
}

A gui file could be like, but that's still ugly:

{
    "entry": "main",
    "tabs": {
        "main": [
            {
                "type": "control",            
                "for": "SHOW_CLOUDS",
                "display": "toggle",
                "label": "Toggle clouds"
            },
            {
                "type": "control",
                "for": "BLOOM_RADIUS",
                "display": "slider",
                "bounds": [ 0.0 , 1.0 ],
                "label": "Bloom radius"
            },
            {
                "type": "link",
                "for": "shadow_settings",
                "label": "Shadow settings"
            }
        ],
        "shadow_settings": [
            {
                "type": "control",
                "for": "SHADOW_SIZE",
                "display": "select",
                "select": [
                    128, 256, 512, 1024, 2048, 4096, 8192
                ],
                "label": "Shadow render size",
            }
        ]
    }
}
commented

Iris is designed to support optifine style shader packs that follow the optifine standard. Maybe st some point in the future it may have support for an alternative format, but right now that is not on the cards

commented

There are some interesting ideas in this issue report that I'd like to think about, reopening.