Setting up Reflections
This tutorial will show how to work with realtime reflections in LightUp to get the best quality and performance. Rendering reflections is a compute intensive activity so understanding your options in LightUp is important to getting a good result.
We will start with a lit room to which we'll mark-up some reflective materials. We've got a few IES downlights, some daylight coming in and a glass display case.
Before we start into setting up reflective materials, lets quickly review.
When you set a Material to be reflective, the rendering needs to show not just the effect of light falling on the surface, but also the light reflected from other surfaces in your model too. To achieve this, we have to calculate what could be seen if you were at the surface looking out - and we have to do this for every pixel on the display. This requires millions of calculations.
If you don't want realtime navigation, you can take hours to calculate these reflections like traditional Raytracers do. However, LightUp has just 1/30 of a second to calculate the reflections; so to make things fast, it treats reflections on some surfaces differently to others.
The simplest reflective material in LightUp is "Planar Reflections". These are reflections calculated in realtime, by GPU raytracing and are exact. However, they are limited to totally flat surfaces - Planar surfaces. If your SketchUp Material is just used on flat surfaces, and you edit Material Properites to have Specular/Fresnel, LightUp will use this technique.
Starting TourTool and clicking on the (flat) floor to edit its Material properites results in this:
Planar Reflections are very effective for large (flat) surfaces such as floors, mirrors, glazing etc. They show exact reflections for the viewpoint, but they are also expensive to calculate; a modern graphics card GPU can handle quite a few of these Planar Reflections in your model and still run at 30 frames per second, but if you start having geometry with hundreds of reflective facets, each of which can potentially reflect your entire model, any GPU will quickly be overwhelmed.
So if you make a Material reflective, and find your frame rate dropping dramatically, check carefully to see whether the Material you're editing is actually used in many other places you were not expecting. These will become reflective too and use valuable GPU resources.
We want to make the frame of the display cabinet a reflective metal material. We can just simply start Tourtool and click on the frame material to edit it and add Specularity and you can see the frame is precisely reflecting the entire room.
This may be just the look you're wanting. But examining the display cabinet frame geometry, we see it is painted inside and out with the reflective material. We're spending lots of time calculating the reflections of the pitch black inside of a window frame! Edit the inside materials to be the Default Material to increase performance.
TIP: Check the materials inside of objects for stray use of your reflective material.
Sometimes its vital to have exact raytraced reflections, but often times, its OK to have surfaces that give a sense of being reflective without being exact.
The second technique LightUp offers is very commonly used in high-end video games and involves placing in your model, a special Component called an "Irradiance Cache" ("IrrCache" for short). The way it works is to capture all light arriving at that point in your model. When a reflective surfaces needs to know what it should reflect, it uses the nearest IrrCache to create the reflections.
This technique is VERY fast but unlike Planar Reflections, has some distortion. There is no such thing as a free lunch! :-( For our display case window frame, where the faces are small, using an IrrCache is a much better solution as we're just want something that gives the sense of shiney, while keeping a smooth framerate.
IrrCache captures the light arriving at its position in your model. As you move away from this location, the reflections the IrrCache can generate get more distorted, so using an IrrCache from the other end of your model may result in unexpected reflections, so you'll want to place IrrCache around your model near to where they will be used.
LightUp searches your model for the nearest IrrCache to use. If it can find no IrrCache, it will use the Skybox you have set for your model. Using the nearest IrrCache is fine, but often times you want to limit the use of an IrrCache to just 1 object, not to anything nearby. LightUp handles this by applying an IrrCache only to geometry at the same or greater depth in your model hierarchy.
If we look at the Hierarchy of a Sketchup model made up of Group or Components, it might look like this. There is a top-level which contains geometry for the walls and floor and also a Group or Component which represents a Table, and that also has 3 children Groups or Components for each of the 3 Chairs.
If we wish to place an IrrCache that just influences the Chairs, we'll want to drill down the Group hierarchy to the Chair object and place our IrrCache there. LightUp makes use of where in the hierarchy you've placed the IrrCache to limit its use just to these Chairs and not, for example, to the Table that while closeby, is "higher" in the Hierarchy.
NB LightUp uses just the depth of the IrrCache in the hierarchy, so you may want to Group the other 2 Chairs into a higher Group to avoid them using the IrrCache too.
The workflow for using IrrCache successfully is to isolate the geometry needing reflections in a sub-Group, place the IrrCache nearby and Create Group with both the new IrrCache and the sub-Group you created. When you have many localized objects, for example a Component consisting of glazing bars and glass, you can embed an IrrCache a little in front of the glass to produce a great result with good performance.
Lets try this with the display case. I've opened the display case Group and put the glazing bars into a sub-Group so we can could treat the sepearately. An IrrCache has been placed INSIDE the top-level Group and just a little way in front so it gets a good "view" of the environment. Now close the group and we're ready.
Now we have our glazing using an IrrCache for maximum performance and little distortion is noticeable as we move around the environment.
Any questions, you can post on the LightUp forum or if you prefer, emailing LightUp directly.