IrisShaders / Iris

A modern shaders mod for Minecraft compatible with existing OptiFine shader packs
https://irisshaders.dev
GNU Lesser General Public License v3.0
3.33k stars 631 forks source link

[Feature Request] New standard for shader packs #791

Open marcospampi opened 3 years ago

marcospampi commented 3 years ago

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:

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",
            }
        ]
    }
}
NoComment1105 commented 3 years ago

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

coderbot16 commented 2 years ago

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