[img]https://i.imgur.com/cvr9l4k.gif[/img] Hi-res: https://gfycat.com/similarwellmadearabianwildcat Hello! As many of you know, The Riftbreaker runs on the latest version of our game engine, The Schmetterling. The biggest difference between this version and the previous one is the implementation of physically based rendering, also known as PBR. It is a lighting model that tries to replicate the behavior between materials and light as it is in the real world. Making use of this technique opens up a lot of possibilities for us, one of which we are going to talk about today. Let’s take a look at the details behind the day and night cycle in The Riftbreaker. [img]https://i.imgur.com/RlHSrKs.gif[/img] Hi-res: https://gfycat.com/realisticcarefreeafricanaugurbuzzard In order to achieve the feeling of the realistic passage of time, we have decided to specify four distinct parts of every day - dawn, day, dusk and night. They are defined by a couple of parameters, such as the color and intensity of light, environment skybox, shadow intensity, fog parameters, wind power, and other weather effects. [img]https://i.imgur.com/yNM2Wwn.png[/img] [b][i]A look at our Scene Parameters control panel from the EXOR Level Editor.[/i][/b] Skybox is a set of textures in the form of a cube that tries to emulate your surroundings. What is important to note here is the fact that the skybox does not contain the light source but only the ambient part of the sky. It is a completely separate entity. To emulate sun behavior we use a directional light that is the main source of light for everything you see in The Riftbreaker. Its position and strength can be regulated independently of the skybox. What is important because we could not generate as many skyboxes which will represent every minute of the day. The two elements working together give us realistic lighting and almost infinite possibilities when it comes to setting up our time of day environment. By the way, checkmate, round-Earthers - the world is flat and the Sun goes around it! ;) [img]https://i.imgur.com/cS6XmOz.jpg[/img] [b][i]One of the skyboxes that was used for X-Morph: Defense.[/i][/b] Another aspect we can tinker with are the fog parameters. We can determine the exact distances at which the fog starts and stops being visible. Apart from that, we can also change the density of the fog. It is very useful for setting the mood of the scene. A delicate morning mist over grasslands feels a lot different than thick fog accompanied by heavy rain. With proper sound effects and wind strength, the feeling of immersion in the game world increases greatly. [img]https://i.imgur.com/MGIZHw2.jpg[/img] [b][i]Oh my, these mushrooms grow so fast![/i][/b] On top of that, with time passing, each part of the day is blending with each other depending on what time it is. The sun direction reflects the position of the sun in the sky, and the length of the shadow is accurate. And at the end of that, we are not limited to only one set of parameters - we can create any number of presets and change between them on the fly - the engine blends them with each other to give us a smooth transition. [img]https://i.imgur.com/NE34aAV.jpg[/img] [b][i]All weather effects can blend with any given time of day preset.[/i][/b] The fact that we can create multiple presets for each time of day means we can introduce variety into the cycle. Every night an algorithm randomly chooses the presets it is going to use for the following day, making it slightly different from the last one. This way some days are going to be sunnier than the other ones. We also control the weather effects, making the possibilities virtually infinite. Moreover, certain events in the game, such as tornadoes and acid rain, can trigger either local or global changes to the weather that additionally blend with the parameters of the lighting. [img]https://i.imgur.com/6gHvDKs.jpg[/img] [b][i]The Riftbreaker will feature multiple weather events, such as acid rain.[/i][/b] The last piece to this puzzle is making the night look interesting. It’s an alien planet, after all, and pitch-black won’t cut it. Therefore, we put our affector system to use here. We mentioned it briefly when we talked about bioluminance [url=https://steamcommunity.com/games/780310/announcements/detail/1619520660880069472]here[/url]. At night, our shaders change the way they behave and giving way for all the emissive lights on plants, stones, and wildlife to shine. Combined with the building lights, base lamps and spotlights mounted on Mr. Riggs and defensive towers, it creates a beautiful, rich atmosphere even in the dark of the night. [img]https://i.imgur.com/NfBuwwQ.gif[/img] [b][i]Other light sources take over when the Sun is not around.[/i][/b] Hi-res: https://gfycat.com/quarrelsomemelodicblackandtancoonhound And that is all we have for you today. If you have any questions or feedback, feel free to comment below or chat us up directly at www.discord.gg/exorstudios. Thanks for reading and see you next week! Other social media: www.facebook.com/exorstudios www.twitter.com/exorstudios www.mixer.com/exorstudios www.twitch.tv/exorstudios