Improving Graphics Rendering

Insane good post +1 for me

2 Likes

:scream:
noooo kidding!!! thats what it is! I knew there was something off about the terrain lighting at night time! I totally see it now.
and here I thought night lighting looked the best, but thats just because theres no white glare on everything :joy:

2 Likes

Thanks for this comprehensive write up. Articulates a lot of how I felt but I didn’t have the vocabulary or knowledge to do this. Good stuff, cheers!

3 Likes

That build was so cool, it was so colourful

(Without going into anything else, just about the HDR), it’s a conscious decision on our part to keep most of the rendering in LDR to reduce vram and bandwidth requirements on the gpu, we use an invertible tone mapping function so that in many cases we “undo” the HDR for compositing in post effects, but of course as you describe if things clip then you cant get back the detail.

2 Likes

Hey @WildCat-Actual.

Thanks for taking the time to analyse and share these details.

I agree with many of the points you’ve raised here. And you’ll be pleased to hear that we a few things in the pipeline that will hopefully improve things significantly.

(Roughly speaking) there is a stack of technology that delivers the final visual look in Boundless:

  1. Base Palette - Boundless contains a single master palette of 255 colours. This palette was procedurally generated to cover the colour space taking into account the eventual lighting and HDR that would be executed later in the rendering pipeline. The names of these colours were also generated so that there was a consistent relationship between colours and avoid any legal issues with naming standards. We use a single standard base palette so that we could add a tinting system to the game after release.

  2. Block Palettes - Each material type takes the base palette and uniquely customises it to create a palette of colour triples: highlight, mid tone and lowlight. These colours define the base colour of a block and the highlight and lowlight colours create variation in albedo. This results in a baked-in ambient occlusion with controllable colours rather then simply brighter and darker. The material block palettes are generated in the world builder and the current recipes are here.

  3. World Palettes - When a world is generated the configuration can manually select the colours per material, creature, plant, etc, or procedurally generate the colours. We created a set of recipes for selecting the colours per world. The recipes we currently use are available here. These colours then flow through the crafting system and almost everything is tinted by one of the colours gather from the world.

We can now generate a world and the procedurally selected block colours are burnt into the world. We could technically iterate any of the these steps but not without an adventurous live universe migration. The engine is fully data driven so in the future modders would be able to fully reboot the full colour technology we have here.

Everything so far is just to select the colours of the materials and it says nothing about in game rendering, which comes now:

  1. Material Rendering - The material rendering includes: colour maps, gradient maps, specular maps, normal maps, emissive maps, and tint maps. On top of this we’ll also rendering blends between voxel materials and decals for embedded resources.

COMING CHANGE - The material rendering is currently being changed to not destroy and blowout the colour on highly specular surfaces and generally improve the behaviour of ambient lighting and realism (in terms of energy conservation of lighting model). This will be a pretty big visual change and will make sure that blocks retain their base colour much better effectively so that things look ‘‘smoother’’ rather than like they’ve been covered in shiny white wax. This has been quite a bit of work and has required us to modify all the specular maps in the game. But it’ll definitely be worth it.

COMING CHANGE - We’re also updating the material rendering to have much better control over the metallic rendering by adding a metal map. This’ll mean that metallic surfaces should look more metallic in the same way that the pure metal voxel already do. This is a subtle effect generally, only changing how the coloration of the material by the lights works so that metals are more likely to retain their true colour, for example gold will never looks bright purple.

  1. Voxel Lighting - On top of the material rendering we apply all the voxel light sources. This itself is done in a few ways. There is faux ambient occlusion burnt into the voxel vertex lighting and then any block that act as light sources can also apply lighting to the voxel landscape. All the voxel lighting is also bundled up into a sparse array of spherical harmonic lighting that is applied to dynamic objects in addition to a fixed number of dynamic lights.

POSSIBLE - Whilst preparing for launch we did rebalance the held dynamic light sources and placed static light sources to try and be much closer. The idea was that placing a help torch into the world should try to maintain the lighting within the environment. This will have changed how the voxel light sources applied light to the worlds. Some of the images flagged as looking different where mainly a result of this change. We could consider reviewing this - but - any changes could have a fairly big effect on players builds. Basically environments will get darker as we soften the fall off.

  1. Day / Night Lighting - On top the voxel lighting we apply a range of ambient and directional lighting to simulate a day / night cycle.

COMING CHANGE - The day / night cycles need quite a bit of work. At the moment the simulated atmosphere colour (say red on a Burn world) can destroy the block lighting colours too much. We want to find a balance where the day / night cycle communicates what world you’re on but without destroying too many other colours.

COMING CHANGE - We also need to fix the ugly bright side light that we have during the night. We do need some lighting during the night or the game becomes impossible to play. But clearly this side light (then looks like it’s lighting the world from below - as you’ve pointed out) is very ugly and needs to be fixed.

  1. Weather and Fog - On top of the day / night cycle we apply weather a weather simulation that can darken areas based on the cloud cover. The distance based fog which softens the landscape as distance increases is an important part of presenting the landscape.

COMING CHANGE - As part of the day / night cycle changes we are also rebalancing the way distance fog is applied. Too many weather systems disable it and the fog’s absence then destroys the visual depth of the environment.

  1. HDR + Tone Mapping - Lighting is done in HDR with an invertible filmic tone-mapper approximation and histogram based dynamic adjustment of exposure. Some of the big changes before release were around HDR and a correct sRGB workflow; we previously (mistakingly) did lighting in sRGB space which caused screwed up lighting and a range of issues with HDR which were all fixed. So we think the HDR is good.

  2. Full screen effects - With regards to lighting, there are the god-rays/lens flare and bloom only really to discuss. The god-rays and lens flare have a large impact on the visual appearance of the sun/moon and sky, and as users have consistently complained about, the flare is currently far too bright - these are driven by the day/night cycle and would be fixed together with those.

COMING CHANGE - we also want to balance the full screen effects a little. As you point out the bloom is too low. The hardest part is balancing the full screen effects over the wider variety of environments that can be discovered and created in the universe. We’ll also tweak the lens flare.


In response to the areas you’ve highlighted:

Of the “colourful” and “warm” images shared they are likely using different block colours [[but also the day/night cycle did used to be much more ‘‘orange’’ and warm compared to the white lighting now]]. But the latest Boundless universe contains many more colours so will ultimately offer a much wider variety of compositions when used creatively. I think the biggest thing that will help is to soften the voxel lighting falloff which is currently steep to try and match the held lights (which were balanced for gameplay).

Of the “coherent colour palette” the pre-release worlds were coloured by hand. But this simply isn’t a scalable system so we needed to switch to the generated approach. Improving the procedural colour selection for world generation will help, and the introduction of Exoworlds will give is more shots at iterating this. Additionally the image also has a gentle fog that helps balance the fore and background, this will be improved in the updated day night cycle.

As above the Bloom needs a balance, but as Luca commented we don’t think this is specifically an LDR / HDR issue.

Fully agreed. As above we’re reworking the day/night cycles to remove this terrible side light.

I will need to look at the water rendering. It’s not something I’ve looked at recently.


-tl;dr-

  • Lighting - agreed.
  • Bloom - agreed.
  • Night lighting - agreed.
  • Water reflections - I’ll need to review this.
21 Likes

Please reconsider the rendering of glass underwater too, the affect of water running down the side is far more broken than the glass being see through as above water.

5 Likes

This is pretty much what stops me from bothering with underwater sections/builds :frowning:

4 Likes

Great to learn a lot of visual issues are on the agenda to be tweaked and fixed…looking forward to a bright (or maybe not quite sooo bright) future!

4 Likes

Would love to see it darker at night on let’s say Gyosha Ophin where my reapers build is then I can create a more creepy feel to the whole place.

Wait a minute!

I remember this from farming:

Does this mean that we can then actually have more than 256 colours for blocks???

That would be amazing!

The master palette is 255, so I assume you’d be able to take #100 and (maybe somehow) recolour it, or use it’s colour to alter another blocks colour.

I’d be surprised if another palette was created. Though I supose it’s possible…maybe?

That whole writeup kinda sounded like the base colour could be modified, ie. still the base colour with a tint on top. If the tinting replaces the base colour then it would simply be changing the colour number associated with a block and would not require any special code in the renderer wouldn’t it??

1 Like

The base block is already tinted to the current block colour, that’s what james probably means. The tint color can in the future be changed to another tint colour with farming.

Reading that you are on it, makes me really really happy.
This and same-face-syndrome are my biggest turn offs right now.

Yes please, that’s one of my worst offenders. (together with the blown out colors.) Lights can only really shine if there are dark corners.

Looking at my latest screenshots, everything seems to have about the same light level everywhere, it looks almost flat:


Looking at my old stuff:




Isn’t that a whole lot more intersting to look at?
(All screenshots are at night time)

So yes, please. Do it!

I guess that’s my fault. I loved it too much and took way to many screenshots of it.


4 Likes

Thanks so much for sharing those details, @james. I really appreciate gaining these insights into how the engine works.

I’ve also noticed the “shiny white wax” appearance on certain blocks. Would you say that Refined Metamorphic Rocks and Decorative Metamorphic Rocks are good examples of this? How about the leaf blocks of trees?

Actually, I’d like to go into a little more detail regarding trees and their leaf blocks because this has reminded me of another graphical issue that I didn’t include in my original post. I’m wondering if your comment above about this ‘coming change’ might address this.

Consider the following screenshots of a group of trees taken from various distances away:

In the close-up shot at the top, the foliage has additional detail geometry that’s added around the base block. Both this detail geometry and the underlying block have normal maps enabled, which breaks up the specular highlights.

In the medium-distance shot in the middle, the detail geometry is starting to disappear. Furthermore, the normal maps appear to have either been disabled or mipmapped into oblivion. Without the normal maps to break up the specular highlights, we are starting to see a very flat shine appearing on these leaf blocks.

In the long-distance shot at the bottom, all the detail geometry is gone and there is no hint of normal mapping. The specular highlight on the front face of these leaf blocks is totally flat and it strongly accentuates the ‘blockiness’ of the tree.

My questions:

  1. Does your comment (quoted above) about the ‘shiny white wax’ appearance refer to this effect that I’m describing here?
  2. Why is there such an aggressive fading out of the normal maps in Boundless?

@lucadeltodecso, Would you consider providing an option for HDR bloom in the graphics settings for PC? The options could be something like:

  • OFF
  • MEDIUM (LDR)
  • HIGH (HDR)

I recently bought a new graphics card that has 8GB of memory to take advantage of. :money_mouth_face:

I can imagine that it would be very challenging to balance the bloom across all the different lighting conditions available in Boundless. If you configure the bloom to look impressive while walking around a city at night, you might find that it looks overbearing during the day.

However, I’m relatively confident that part of the reason for it being hard is that it’s rendered using an LDR source. If you only have an LDR source to blur, you basically have no choice other than to set a high threshold and live with only minimal bloom. However, with an HDR source, a high threshold won’t necessarily mean minimal bloom because there is a vast range of colour/light intensity that exists above the LDR colour gamut.

The advantages of HDR bloom can be illustrated in Photoshop using the 32-bit colour mode and some gaussian blurs. In the image below, I’ve created a blue bar that uses a single hue of blue at varying intensity. On the left, the bloom is LDR and, on the right, the bloom is HDR. The settings for the blur radii are the same on both sides. I’ve provided two examples with different levels of exposure.

Notice how the colour of the LDR bloom varies unrealistically and how its brightness is limited. Then notice how the overexposed area really shines in the HDR bloom and it maintains the original blue hue.

Imagine if you took all the Gleam materials in Boundless and significantly increased their emissive power/intensity. This should cause them to appear much brighter than the other blocks around them. Then, combine this with an HDR bloom and you would find that those overexposed Gleam blocks would bloom beautifully while the rest of the blocks would not contribute because they’re not overexposed.

The following animation shows a Photoshopped example of a bloom effect that I think is only possible using HDR:

bloom-animation

3 Likes

Hey @WildCat-Actual.

Now that we finally (finally) released Release 225 with the updated lighting do you want to reevaluate the result?

I’d be interested to see how many of the items you listed we managed to improve.

There are still some outstanding rendering issues.

There are still quite a few tweaks I’d like to make … so opinions would be really useful now.

6 Likes

In my opinion there’s plenty of blocks looking good now, and some looking really weird and low quality, like iron ore for some reason look like a bad definition and White marble looks like a gray shiny uneven ugly block…

Sure thing!

Before getting into the details of the specific items I raised in my previous posts, I just want to share a few quick comments:

  • Firstly, great job! My overall impression is that the graphical quality of Boundless has vastly improved with these lighting changes.
  • Specular highlights look more plausible and aesthetically pleasing.
  • Materials appear to have more depth, especially in areas that are not lit by the sun. The ‘directionality’ of light interacting with surfaces is more noticeable. The effect of normal mapping appears to be more consistently visible than before.
  • Did you tweak the filmic tone-mapper? It seems better to me - like it’s a bit more filmic and less linear.
  • Metallic surfaces look better. The titanium tools, for example, look great (where previously, they didn’t look particularly metallic).
  • The availability of per-pixel lighting at all distances is a massive improvement.

Ok, on to the specific points (in the same order I raised them in my previous posts):

Bloom

The bloom is definitely better now. Previously, only the very brightest surfaces (white or nearly white) would cause any blooming. Now there is nice, colourful bloom coming from most bright surfaces. It’s nice to see a variety of gleam blocks glowing properly now, as well as bioluminescent plants creating a bloom effect at night.

With that said, it’s still not as good as I think it could be. One of the changes that I don’t like is that the radius of the blur appears to have been reduced. It was small before but now it’s really tiny. If I had to guess, it looks to me like the current bloom effect in Boundless is made by taking a single copy of the main-rendered image at one-third of its original width and height and applying the tiniest of blur operations (a small box blur, perhaps) before adding it over the main-rendered image.

I believe some people have complained about “blurriness” since the lighting update. When people complain about bloom effects having the side-effect of “blurring” the final image, I think that it’s often the result of:

  • using too small a radius on the bloom effect, and
  • using only a single linear blur or Gaussian blur.

Bloom may seem like a simple effect but I think there’s more finessing required to build a good bloom effect than just one quick-and-dirty blur. To make the effect feel natural and unobtrusive, you’ll need to try and simulate the way light scatters inside a lens. The way that light diffuses outwards from a hot spot in the image needs to have a particular ‘falloff’.

That falloff is not the same as a single linear or Gaussian blur. I don’t know the correct mathematical terminology (exponential? quadratic?) but my understanding is that a good bloom effect will diffuse light outwards from bright spots in a non-linear ‘decelerating’ way. The initial falloff will be fast but it will decelerate and continue to spread light quite far from the bright spot.

falloff

I don’t think that a quality bloom effect can be achieved with the single Gaussian blur operation. For example, the documentation for the Unreal Engine talks about combining several blurs:

…we combine multiple Gaussian blurs with different radius. For better performance, we do the very wide blurs in much lower resolution. In UE3, we had 3 Gaussian blurs in the resolution 1/4, 1/8, and 1/16. We now have multiple blurs name Blur1 to 5 in the resolution 1/2 (Blur1) to 1/32 (Blur5).

We can simulate this idea in Photoshop:

I think that the option with 3 different blurs is the only one that looks like a plausible, pleasing glow.

(By the way - due to the fact that these example images are quite dark, please click on them to view them at full size and with the dimmed surroundings. Also, make sure there isn’t too much light shining near your workstation. If your pupils are constricted because of the white forum background or other lights in your surroundings, then you won’t be able to see these images properly.)

Ok, moving on… The option with 3 blurs was made by blurring the original resolution image using very large blur radii. But, for performance reasons, you’d want to do the blurs at a lower resolution. So, I’ve recreated something similar to my previous example but this time simulating the image scaling steps. (I set Photoshop’s resampler to Bilinear for authenticity).

These are the logical steps for compositing the above image:

  1. Start with image called “render” (480x480)
  2. Divide render dimensions by 3 (160x160) → Save as image1
  3. Gaussian blur image1 with radius 2 (effective radius 6) → Save as image1-blur
  4. Divide image1 dimensions by 4 (40x40) → Save as image2
  5. Gaussian blur image2 with radius 2 (effective radius 24) → Save as image2-blur
  6. Divide image2 dimensions by 2 (20x20) → Save as image3
  7. Gaussian blur image3 with radius 3 (effective radius 72) → Save as image3-blur
  8. Combine colours from image1-blur, image2-blur, image3-blur giving each a one-third contribution → Save as image-combined
  9. Add image-combined to render with whatever opacity you think is tasteful. (The example is 100%.)

I’m sure all of this would require some significant ‘adapting’ before it could conceivably be used. Hopefully, it can at least serve as inspiration. I’d be interested to know your thoughts on these ideas.


Bloom (cont.)

I’m not done with bloom yet. :stuck_out_tongue: I think I actually preferred the bloom in the initial release of the lighting changes. In release 225.2, you implemented a change to the bloom:

I’ve noticed something that might be a side-effect of this change. There appears to be a subtle discolouration on the fringes of the bloom effect in certain cases. I’m wondering if the threshold may have been introduced at the wrong place within the chain of operations that produces the bloom effect. It looks to me as if the threshold might be applied onto the bloom after it’s been blurred when it really should be applied to the image before it gets blurred.

I’ve made an example image in Photoshop to try and illustrate this “discolouration” that I’m talking about. I’ve done this by applying a Levels filter onto a blurry glow. The shadow input level has been raised to 31 on the blurry glow on the right:

Notice how the hue of the glow is not uniform on the right. It fades towards red on the edges. I have seen something similar to this in the latest version of Boundless in certain places.

I’ve also occasionally noticed a very subtle distortion within the bloom that is similar to a ‘shadow blistering effect’, which is another reason why I suspect the threshold was applied after the blur operation.

I would be interested to see Boundless again without the threshold for comparison purposes.


Unfortunately, I have run out of time today. My comments on the other items will have to wait for another day (tomorrow probably).

10 Likes

tone-mapper was tweaked yes, mainly making the shoulder much longer to allow compressing 8 levels of luminance to LDR instead of just 2, but also making its linear section more accurate.

bloom; yes it would be better to have multiple blur passes; as it stands we only have a single (As you guessed, at 1/3rd resolution) blur pass, but it “is” a gaussian blur, rather than a box blur. When looking at the bloom for this release, it was a case of trying to improve it with as little work as possible, mainly in terms of combining the bloom with the screen contents; we no longer add to the screen, but blend with the bloom target instead as adding the bloom to the screen contents just makes everything brighter (eg, twice as bright for a solid area of bloomed blocks) which then screws with the scene luminance for tone mapping far too much (and means turning bloom on/off vastly changes the luminance of the scene, rather than just being a visual candy addition). The thresholding does happen before the blur though.

2 Likes