Tutorial-LumeWorkbench

The LumeWorkbench set is made up of four individual shaders: WrapAround, Distortion, BumpCapture, and Adjustments. This tutorial will demonstrate how to use the first three; for information on the Adjustments shader, please go to the Reference section.

Part I: The Lens of the World

Part I of this tutorial will show you how to use the Wraparound shader to help cut down on the rendering times of large, complicated scenes.

Get the Scene

Open the scene. We've created the objects for you to work with.

Choose Get -> Scene. In the LumeTutorials database, get the scene called "WorkbenchScene1."

Preview! This will take a little while, as we've got a lot of geometry in this scene.

Choose Preview -> All. Remember these are mental ray shaders, so make sure that in your Preview -> Setup you've got the preview renderer set to "mental ray"

As you can see, we're in a sort of valley, surrounded by large mountains on every side. Notice how long it took to render the preview; once we're finished we'll be rendering this view much more quickly.

Add the WrapAround shader

Add the WrapAround shader. This will capture a 360 degree view of our scene.

Choose Camera -> Settings. In the lower left corner of the Camera Settings dialogue box, click on the Select button to choose a Lens Shader; go to the LumeTools database and select WrapAround. This shader has no parameters, so click OK to return to your scene.

Render! This step will take a little while, as we're going to render a very large .pic file.

Choose Render. Set the Rendering Type to mental ray, and make sure that Antialiasing is turned off. Under resolution, set the X value to 2000; check to see that the Y According Format radio button is selected.

Select a database in which to save the rendered image. Name the image something easy to remember... how about: "360Image." Click the Render sequence button to get it started.

This will take a couple of minutes, so while we've got the time let's point out when you might use this shader: any time that you've got a lot of complex geometry in the distance, that will not change perspective as you move through your scene, you might want to consider using the WrapAround shader to speed your renderings. This obviously is even more important when you start talking about animations of any considerable length, as the speed of each rendering becomes especially crucial.

In the next step, we're going to take the 360 degree image we've rendered and project it onto a giant, evenly shaded sphere, much like the way a planetarium works only in this case it's a full sphere. By doing this, we'll end up with the same background image, but with a much simpler scene and thereby a much shorter rendering time.

Build the background sphere

Get rid of the current objects. We don't need them anymore.

Choose Delete -> All.

Create the sphere.

Choose Get -> Primitive -> Sphere. Make it a Patch, B-Spline object to keep it smooth; set the Radius to 5000.0, and set both the Longitude and Latitude Steps to 12 . Click OK to create the sphere.

Add the texture.

With the sphere selected, choose Texture -> 2D Local. Then, click the Select button next to the Picture Filename box, and choose the image that we'd previously rendered, "360Image." Change the Mapping Method to "Spherical Coordinates," then click OK to accept the texture.

Now choose Material, and in the Material Editor dialogue box, under Shading Model, choose "Constant." This will give the sphere a constant brightness the sphere, which is what we want. Click OK to return to the scene.

Flip the sphere. Since we're inside the sphere, we need to flip the way the texture is being applied by the default spherical mapping.

With the sphere selected, change the ScaleX to -1.0.

Preview!

The same background, in a fraction of the rendering time! You can use this same method wherever you want to speed up those pesky complicated background renderings.

Part II: Last But Not Least...

Part II of this tutorial will show you how to use the Distortion and BumpCapture shaders.

A quick Distortion example

Open the scene. We've created the objects for you to work with.

Choose Get -> Scene. In the LumeTutorials database, get the scene called "WorkbenchScene2."

This scene contains a few primitive shapes, partially intersecting our tin roof from the Landscape tutorial. In a minute we're going to use these to demonstrate BumpCapture, but first let's quickly try out the Distortion shader.

Move the camera.

Translate the camera to x: 0.0, y: 10.0, z: 0.0, directly above the objects.

Preview!

Choose Preview -> All. Remember these are mental ray shaders, so make sure that in your Preview -> Setup you've got the preview renderer set to "mental ray"

Each of the objects are colored with a solid material, and the tin roof has the same textures on it from the earlier Landscape tutorial. Notice that the edges of the shot are straight, as is usual with our renderings...but unlike we see in photographs taken with wider angle lenses. What the Distortion shader does is simulate the distorting properties of those camera lenses... as we'll see now -

Add the Distortion shader.

Choose Camera -> Settings. In the lower left corner of the Camera Settings dialogue box, click on the Select button to choose a Lens Shader; go to the LumeTools database and select Distortion. Then click the Edit button, and in the Distortion dialogue box, change the Amount setting to 2.0.

Preview!

Notice how the image is now curved around the edges, distorted as if photographed with an extremely wide angle lens. By adjusting the Amount, you can set Distortion to mimic the distorting properties of any camera lens.

Now back to BumpCapture; the first thing we want to do is get rid of Distortion, so

Remove the Distortion shader.

Choose Camera -> Settings. Click on the Delete button to remove Distortion. Then click OK to return to the scene.

Create a bump map from geometry

The BumpCapture shader creates a greyscale image based upon a surface's distance from the camera, which you can in turn use as a bump map texture on a plane or other simple surface. While there are a wide variety of uses for this, in this tutorial we will again be using it to save rendering time, by substituting complex geometry with a simple texture.

Since the greyscale is based upon a surface's distance to the camera, in order to get an accurate bump map of our geometry, we want to keep it as flat and perpendicular to the camera as possible. To do this, you'd usually use the orthogonal view, as it is more flexible than the cardinal views. In this case, however, since our objects are all in a flat, horizontal plane, we can simple render from the top view. So

Set it to render from the top view.

Change the view to "Top." If necessary, zoom in so that the roof object - just barely - completely fills the screen.

In the upper left corner of the window, click on the window's ID letter, "B;" the window border will turn red, indicating that mental ray will render from this view.

Capture the bump.

Choose Render. Make sure that the Rendering Type is set to mental ray, and that Antialiasing is turned off. Next, select a database in which to save the rendered image. Name the image something easy to remember, say: "BumpImage."

Click Options, and in the Output Shaders box, click the Select button; go to the LumeTools database, and choose BumpCapture.

Click Accept, then click the Render sequence button to start the rendering.

You'll see the rendering finish, then once it's complete, the newly generated greyscale will flash on screen for a moment. Don't worry it's there, saved in the .pic file we named "BumpImage." Before we get that image, however, we're going to do one additional step.

Capture the color.

Select the cone. Choose Material. In the upper left corner of the Material Editor, change the Shading Model to "Constant." Click OK to accept the change.

Repeat the previous step with each of the other three models: the torus, the cylinder, and the tin roof.

Again, choose Render. We're creating a separate image this time, so again name it something easy to remember, say: "ColorImage."

Click Options, and in the Output Shaders box, click the Delete button to remove BumpCapture.

Click Accept, then click the Render sequence button to start the rendering.

What we've done in this last step is create a completely flat-shaded image of our scene, thereby registering only the color information. By combining this with the bump we captured in the previous step, we'll be able to produce an image which resembles the original objects, while greatly reducing the scene's geometry.

Now that the rendering is completed, let's get rid of the complex objects, and start over with a simple plane.

Delete the objects.

Delete -> Selection, to each of the four objects. Make sure to leave the light.

Create a grid.

Choose Get -> Primitive -> Grid. Keep the default Cell Sizes at 1.0, and the set the Cell Counts to 8.0. Click OK to create the grid.

Add the textures.

With the grid selected, choose Texture -> 2D Local.

Click the Select button next to the Picture Filename box, and choose the first image that we rendered, "BumpImage." Change the Mapping Method to "XZ Coordinates," and set the Roughness to 50.0. Then, under Tiling, click on the box to the furthest right (so that the texture will be oriented correctly when we project it back onto our grid). Click on the Next button to advance to a new texture.

Again, click the Select button next to the Picture Filename box, and this time choose the second image we created, "ColorImage." Change the Mapping Method to "XZ Coordinates," and again, under Tiling, click on the box to the furthest right. Click OK to accept the textures.

Preview!

Not too bad, considering that we're now only using a color texture and bump map to simulate the earlier objects. In general, BumpCapture is a shader that has a wide range of possible applications; it is for you to decide how you can best to put it to use.