{"id":2176,"date":"2018-10-30T15:00:35","date_gmt":"2018-10-30T15:00:35","guid":{"rendered":"https:\/\/www.migenius.com\/?p=2176"},"modified":"2018-10-29T07:54:42","modified_gmt":"2018-10-29T07:54:42","slug":"lighting-configurators-with-compositing","status":"publish","type":"post","link":"https:\/\/www.migenius.com\/blog\/lighting-configurators-with-compositing","title":{"rendered":"Lighting Configurators with Compositing"},"content":{"rendered":"

In our last post we explored using the RealityServer compositing system to produce imagery for product configurators at scale. Check out that article<\/a> first if you haven’t already as it contains a great introduction to how the system works. In this follow up post we will explore the possibilities of using the same system to modify the lighting in a scene without having to re-render, allowing us to build a lighting configurator.<\/p>\n

<\/p>\n\"\"\n

Separating Lights with LPEs<\/h3>\n

For product configurators, the main changes users want to make are material changes namely colours and textures. Light Path Expressions (or LPEs for short) described in the previous post can do much more. They also allow for the separation of specific sources of light. This is actually quite a bit simpler than materials (unless combining both together of course, then it becomes even more complex). As an example, you can separate out a light sources contribution to the final image with an expression like this.<\/p>\n

\n<L['downlight']>.*E\n<\/pre>\n

This simple expression will render out only the contributions of the light source with the handle<\/em> String attribute downlight<\/em>. Here we are getting the combined contribution (both direct and indirect), you could also craft an expression to separate direct and indirect but typically with lighting configurators you want to change both at the same time in order to be maintain accuracy. Like material and object changes, the compositing system will hide the complexity of these expressions and you just need to specify either the instance names of the lights or the handle names. Let’s take a look at the type of application we can build using composited lighting.<\/p>\n

Demo<\/h3>\n

The video below shows a quick application we put together to show how you can use the compositing system with lights. There are six different light sources in the scene and a series of sliders so you can increase or decrease the contribution from the given light sources.<\/p>\n\t