Black Dragon 2.4.1.9: “volumetric lighting” and more

Blackdragon logoOn Tuesday, March 10th, NiranV Dean released version 2.4.1.9 of his Black Dragon viewer, which includes his recent work on volumetric lighting for Second Life, which I reported on at the start of March.

The update also includes a number of other fixes to some long standing rendering issues that Niran has been attempting to fix. Taken together, they are part of a larger update Niran has been planning, but as he comments in the release notes, he wanted to get these particular changes out to show people, and will save the rest for his upcoming version 2.4.2 release.

Graphics Memory Changes

The first of the changes Niran has made relates to the way in which graphics memory is used with textures. Generally, the viewer has one slider for setting a limit on the amount of texture memory, which encompasses everything you see in the viewer, including all of the UI elements.  The is generally set to 512 Mb by default.

Up until the 2.4.1.9 release, Black Dragon, like most viewers, offered a single slider for setting the amount of video memory which could be dedicated to texture processing by the viewer
Up until the 2.4.1.9 release, Black Dragon, like most viewers, offered a single slider for setting the amount of video memory which could be dedicated to texture processing by the viewer

With the 2.4.1.9 release of Black Dragon, Niran has split how graphics memory is used between “global” textures – which include all the UI elements, etc., and the graphics memory currently being used to render the current scene – what you are actually seeing in-world at any moment in time.

The idea here is to provide the scene textures with their own “pool” of graphics memory, so they are no longer competing for graphics memory with all the other textures obtained from the region and the viewer’s UI textures, and should thus result in fewer issues of visible textures being “thrashed” (e.g. constantly switching between blurry and clear as they are swapped into and out of memory due to lack of space).

With Black Dragon 2.4.1.9 , Niran has attempted to "split" how video memory is used  by the viewer into two adjustable "pools", one for global textures (which include UI elements), and one just for just the current scene textures
With Black Dragon 2.4.1.9 , Niran has attempted to “split” how video memory is used by the viewer into two adjustable “pools”, one for global textures (which include UI elements), and one just for just the current scene textures

As I’m not a graphics or viewer rendering expert, I can offer no opinion on this approach. However, do note Niran’s recommendation to set texture memory to 512 Mb (the default upper limit for SL viewers, set several years ago to avoid OpenGL issues which might occur when setting large memory allocations) and the scene memory to 256 Mb.

Horizon and Other Rendering Fixes

One of the visual irritants in Second Life when running the view with the Advanced Lighting Model option (which Niran still refers to by its more technical name of “deferred rendering”), those living at altitude in-world (or flying at a few hundred metres above sea level), is the way in which the line of the horizon between “sky” and “sea” forms a concave curve across the screen, rather than a flat line as one might expect.

The familiar concave horizon line between "sky" and "water" seen when running the viewer in "deferred" mode (ALM enabled) ...
The familiar concave horizon line between “sky” and “water” seen when running the viewer in “deferred” mode (ALM enabled) …

With Black Dragon 2.4.1.9, Niran has addressed this, and a few other horizon-related rendering issues so that – and again when running the viewer with Preferences > Display > Deferred Rendering (ALM) enabled, the horizon now appears as a horizontal line, as shown in the two images shown here, taken from Rebeca Bashly’s When Life Gives You Apples … Run.

Images of all the horizon rendering adjustments Niran has made can be found in his blog post on the release, linked to at the top and end of this article.

Niran's revised horizon line between "sky" and "sea", seen in Black Dragon 2.4.1.9 with deferred rendering (ALM) enabled
Niran’s revised horizon line between “sky” and “sea”, seen in Black Dragon 2.4.1.9 with deferred rendering (ALM) enabled

Volumetric Lighting

Niran’s work on bringing a form of volumetric lighting, as I’ve previously reported, builds on the Godrays capability Tofu Buzzard developed, to provide a more realistic look to how sunlight can look under certain circumstances, such as when being filtered through the branches of a tree or through the grid of a window frame, where the light rays might be broken-up into streams of sunbeams. While not true volumetric lighting in the strictest sense, it still provides a good graphical representation of the effects of objects on sunlight.

Prior to releasing Black Dragon 2.4.1.9, Niran produced a video demonstrating the effect. When watching it, be aware that while the camera is moving, everything else is static, other than the grating in scrolling across the ceiling of the room. When you’ve got that, note how the grating not only casts shadows on the floor but also breaks up light falling through it into individual patterns of sunbeams.

This work has required some major changes to the shaders used by the viewer for rendering, which may have an impact on whether or not the code is adopted by Linden Lab and / or other TPVs. However, the results in and of themselves are impressive. Niran notes that while the default Godrays value is set to 2.0, those with a good GPU might want to consider increasing this to 3.0 or 4.0, but doesn’t recommend going beyond 4.0 unless you are taking snapshots in which you want the effect to be enhanced – but do drop it back down when you have done so. He further notes that in order to see the effect:

  • You must be facing the sun
  • You are using a windlight that compliments Godrays
  • Deferred Rendering  and Volumetric Lighting are enabled in Preferences  > Display
  • Shadows are set to at least “Sun/Moon”.
Niran also have Godrays working underwater as a result of his volumetric lighting work (image courtesy of NiranV Dean)
Niran also have Godrays working underwater as a result of his volumetric lighting work (image courtesy of NiranV Dean)

There are still some issues still to be sorted out with the work – such as getting the lighting effects to work with depth of field enabled due to issues with how depth of field is handled by the viewer which really require input from the Lab to help sort out. Even so, as so far as I’m aware, Niran still plans to contribute the code to the Lab in the hope that their interest in it will translate to it being taken forward and possibly implemented within the official viewer in the future.

Related Links

9 thoughts on “Black Dragon 2.4.1.9: “volumetric lighting” and more

  1. Niran is doing great work. I’ve tried his viewer on and off over the years (years … lol, I am five this month) but when I discovered a few weeks ago that Black Dragon now has a greyscale slider, I have become a full-time convert. I use it for making all my images now.
    Can’t wait to get off work today and try out the new version and godrays at Photohunt tonight.

    Like

    1. Yet me know how you get on 🙂 . I can’t try-out the viewer properly until main PC comes back from the PC doctor; the standby machine I’m using would have a major coronary were I to try to run anything other than SL Go on it!

      Like

  2. Little correction here: I did not “try” to split Scene and Global Memory, i just did. Actually, they were separated all the time, the problem was that you had only one slider and according to that slider several available memory values were calculated, 512mb Texture Memory meant roughly 768mb Global and 300mb Scene Memory and a bit of FBO buffer + some other things. Now you can set global and scene separately so you don’t have to increase the “issue-causing” global texture memory to crazily high values just to have a decent amount of current scene memory. That of course is a lot more advanced and circumvents some minimum memory calculations, so if you are not carefull you might end up giving SL such a tiny amount of memory that it will continuously trash textures until you raise the available memory.

    The other thing: I recommend the Godray Brightness being set to 3.0-4.0 for normal usage and higher values for snapshots, Godray Resolution is still simply subject to your GPU performance which doesn’t need to be that fast, actually if you can run Deferred with Shadows at 30 FPS you shouldn’t loose more than 5 FPS if at all, given you keep the Godray Resolution at reasonable amounts (16-64) personally i recommend 32, its a good mix between superior quality and performance.

    Like

  3. I ended up having to tweak my video card a bit, but once I got all the settings to my satisfaction, i was amazed. It’s going to take some playing with to work into my toolbox, but it’s relatively easy to use and control. I don’t know if I can post links here but this is one of my experiments;
    Volumetric off – https://flic.kr/p/qDLi7X
    Volumetric on – https://flic.kr/p/rhe832
    Machinima – https://flic.kr/p/rhe7ZB (This is a first try at video, so please excuse any ineptness, etc.)

    Like

    1. Excellent work! I’m now even more impatient to get my (now overdue 😦 ) PC back from the computer hospital!

      Like

Comments are closed.