Better Skyboxes

For people working on the C++ code.
User avatar
Jordach
Member
 
Posts: 4516
Joined: Mon Oct 03, 2011 17:58
Location: Blender Scene
GitHub: Jordach
IRC: Jordach
In-game: Jordach

Better Skyboxes

by Jordach » Wed Jan 24, 2018 19:27

I've been thinking of a way to improve the skyboxes we have now.

Introduction of skybox texture overlays:


Currently, we have:

Code: Select all
player:set_sky("#ffffff", "dynamic")


and

Code: Select all
player:set_sky("#ffffff", "skybox",
    {
        "texture_top.png",
        "texture_bottom.png",
        "texture_left.png",
        "texture_right.png",
        "texture_back.png",
        "texture_front.png"
    })


Note that "#ffffff" is ignored by the engine (as far as atmos is concerned, see https://github.com/Jordach/Solar_Plains ... t.lua#L168 ), unless "skybox" is used as the set_sky option.

The expansion I'm thinking of is:


Code: Select all
player:set_sky("#fog?", "dynamic", -- fog should be determined from the horizon tonemap
    { -- overlay skybox textures with transparency above the stars
        "top.png",
        "bottom.png",
        "left.png",
        "right.png",
        "back.png",
        "front.png"
    }
    { -- overlay skybox with transparency behind the stars (to show the dynamic skybox)
        "top.png",
        "bottom.png",
        "left.png",
        "right.png",
        "back.png",
        "front.png"
    }
    { -- control the tonemaps for the sky colours to blend.
        "tonemap_top.png", -- sets the sky colour when you look up
        "tonemap_bottom.png", -- the sky colour when you look down
        "tonemap_mid.png", -- the horizon sky colour
        "tonemap_star_brightness.png", -- how bright are the stars in the sky?
        "tonemap_star_colour.png", -- what colour are these stars? (use the existing 16x16 palette system for nodes)
        "tonemap_star_time.png" -- can we see these stars during the day (may not be used, see the first star option.)
        "tonemap_skybox_front.png" -- control the opacity of the first skybox table
        "tonemap_skybox_rear.png" -- control the opacity of the second skybox table
    })


The two expanded areas are overlays for the dynamic skybox to have their own rotating textured skyboxes.

The new part allows tonemap control of star colours, star brightness (and when they'll appear.), and sky colours.

I've made a few mockups to show what this would look like, these are not part of the engine:


Image Sunset with Sun tonemap enabled.

Image Winter dusk with stars.

Image Nebula on a cloudless night.

Uses:


A skybox where the skies have visible moons / planets may exist and obscure the dynamic starfield..

A nebulae that hangs in the background and is only visible at night.

Changing the skybox tonemaps to simulate seasonal changes.

Having astronomical events in the sky, etc.

Couple of notes:


The overlaid skyboxes must rotate with the dynamic sky, otherwise, it'll look pointless to have.

Supplying "" or nil to a tonemap will use the default dynamic skybox settings.

The format for these may have to change, but RBA's tonemap topic is a good start:

viewtopic.php?p=150727

To finish:


RBA implemented sun and moon tonemaps a while ago, why not extend them and their feature set to the rest of the skybox?

Edits: Jeez BBCode has crap formatting.
viewtopic.php?f=10&t=19056 Solar Plains Dev Server
 

Sires
Member
 
Posts: 168
Joined: Mon Jan 02, 2017 21:00
Location: Hue knows...
GitHub: Sires0
IRC: Sires
In-game: Sires

Re: Better Skyboxes

by Sires » Thu Jan 25, 2018 12:43

+1 but I suck at c++ ¯\_(ツ)_/¯
Nothing to declare

For the ones reading this, expect a new minetest game soon ;-)

Also, Sires is not pronouncied like Siri, it's from Sir, use he not she(also not it, I'm not a thing :P).

**SORY MAY BED ANGLISH**
 

User avatar
Inocudom
Member
 
Posts: 3014
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: Better Skyboxes

by Inocudom » Thu Jan 25, 2018 20:28

Agreed. Skyboxes are very static right now. Anything that can give them animations and color changes is a welcome edition.
Recovering from the abomination I am. Clocking time for Garry's Mod I am too.
 

User avatar
TumeniNodes
Member
 
Posts: 2507
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Better Skyboxes

by TumeniNodes » Thu Jan 25, 2018 20:38

Beautiful mock-ups Jordach

one of my thoughts has been to work out being able to use animated sun and moon textures, which could:
add animated rays, or aura around the sun, or even particles which could rotate around it

allow for moon phases, as well as potentially adding types of moons, depending on seasonal/atmospheric changes

I know, it all sounds whacky but, I can dream ; )

Did you make a PR? I wanna thumb it up!
I'm not your buddy, guy...
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Better Skyboxes

by Sokomine » Sun Jan 28, 2018 01:48

That's a beautiful sunset. Would love to see that implemented.
A list of my mods can be found here.
 

User avatar
Jordach
Member
 
Posts: 4516
Joined: Mon Oct 03, 2011 17:58
Location: Blender Scene
GitHub: Jordach
IRC: Jordach
In-game: Jordach

Re: Better Skyboxes

by Jordach » Thu Aug 16, 2018 22:44

Apologies for the bump, but I've gone and merged textured skyboxes with the sun, moon and stars.

Rubenwardy has suggested I expand the current skybox API into something more profound, with most of the features listed up in the first post.

Code: Select all
skybox = {
    skybox = { "texture_1.png", "texture_2.png", "texture_3.png", "texture_4.png", "texture_5.png", "texture_6.png",},
    clouds = true, -- clouds are enabled by default when not listed
    custom_fog = true, -- MT default fog (false) or custom fog (true)?

    sun = {
        visible = true,
        yaw = 90,
        tilt = 0,
        texture = "sun.png",
        sunrise_glow = true, -- Show the sunrise and set glow texture?
    },

    moon = {
        visible = true,
        yaw = 90,
        tilt = 0,
        texture = "moon.png",
    },

    stars = {
        visible = true,
        number = 200,
    },
}


Here's a visual demonstration that actually works.

Image

Image
viewtopic.php?f=10&t=19056 Solar Plains Dev Server
 


Return to Partly official engine development



Who is online

Users browsing this forum: No registered users and 0 guests