Unarelith / OpenMiner

Minecraft-like game engine written in C++17 with a client/server architecture and support for Lua modding
GNU Lesser General Public License v2.1
262 stars 34 forks source link

Sky Lua API #76

Open Unarelith opened 4 years ago

Unarelith commented 4 years ago

Those informations should be defined in Lua

For example:

mod:sky {
    id = "overworld",

    color = {
        day = {128, 255, 200},
        night = {28, 127, 50},
    },

    fog_color {
        day = {128, 255, 200},
        night = {28, 127, 50},
    },

    stars = {
        amount = 1000,
        size = 2,
        brightness = 1, -- ranges from 0 to 1
    },

    objects = {
        sun = {
            size = 20,
            speed = 1, -- 1 would be day length
            angle = 0, -- 0 would be default moon/sun plan
            texture = "sun.png",
            brightness = 1,
        }
    }
}

When dimensions will be implemented, they will use this API to know which sky to render. Done.

It should also be possible to change sky informations in-game. This could lead to more possibilities regarding sky, for example, it could be possible to change the sky when:

LordDeatHunter commented 4 years ago

Close-proximity stars, or "Suns". Example: Sun A does 48h rotations and Sun B does 24h rotations. When it's just Sun A, there's 65% light level on the surface, 80% for Sun B and 95% for both.