On Tuesday, March 10th, NiranV Dean released version 126.96.36.199 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.
With the 188.8.131.52 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).
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.
With Black Dragon 184.108.40.206, 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 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 220.127.116.11, 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”.
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.