0.56.0: Area light visualisation

In Gaffer 0.56, we’ve made significant improvements to the visualisation of area lights. This video dives into the details, and talks about the varying support for connected shader networks:

Read on for more details and tips on how to customise the default settings…

TL;DR

  • We now support drawing area lights as solid, textured lights.
  • The Viewer Draw Mode menu can be used to easily change the appearance of all lights.
  • Limited Arnold shader network support, full OSL support (P isn’t supported in either case).
  • Let us know if you need support for other Arnold shaders.

Overview

In Gaffer 0.56, we’ve added support for textured area lights in the Viewer along with numerous other enhancements. In order to make this more manageable, the new Lighting section in the Viewer Drawing menu allows the appearance of all lights to be easily changed. It defaults to Texture mode, but this can be changed as required, see below.

Individual lights can have their presentation adjusted in the Visualisation tab of their Node Editor, and the OpenGLAttributes node can be used to affect multiple lights in a scene, or any that are imported or procedurally generated.

Along with texture visualisation, we’ve also added a visualisation of area light spread for lights that support it.

We hope these changes make it a bit easier to understand what’s what in your scenes, let us know of any improvements we could make.

Shader network support

Behind the scenes we use OSL to generate the textures for the viewport. Arnold area lights support both Arnold and OSL shaders being connected to their color plug.

In Gaffer 0.56, if your network is made purely from OSL shaders, then the viewport preview should match almost exactly what you see at render time*. Arnold shaders on the other hand require us to write an OSL equivalent shader. As we don’t have the source code for the Arnold shaders, we have to approximate this.

As such, at release, we only have limited support for an approximation or a subset of shaders*: add, blackbody, color_correct, image and multiply. Let us know if you need support for a specific parameter or shader and we can look into making an OSL stand-in so it can be represented in the Viewer.*

warning

Neither Arnold or OSL network visualisation supports the effects of P. Eg: using P to drive a noise will appear as if P is (0, 0, 0) across the whole light.

Customising the default Viewer mode

As Gaffer views are actually just nodes, you can use the standard user defaults mechanism. The Viewer as actually a SceneView, and so you can register a different default light display mode (along with any other viewer options) like so:

import Gaffer
import GafferSceneUI

Gaffer.Metadata.registerValue(
    GafferSceneUI.SceneView,
    "drawingMode.light.drawingMode",
    "userDefault", "wireframe"
)

Leave a Reply