Environment Shaders are a great procedural way to create a variety of atmospheric sky and ground FX for your animations. This tutorial will focus on implementing the Legacy Day shader. We'll use it to create an animatable dawn like setting for our scene.

Manipulating Environment Shaders in XSI

by Adam Sale

Environment Shaders are unique in XSI because they require no scene object or lighting to get them working, and since they are procedural fractal shaders, you'll seldom need to worry about the resolution of your sky, or whether or not you can see the seams where the ends of a traditional texture map meet. The shader is an infinitely stretching texture mapped sky, with an infinitely stretching texture mapped ground running parallel to it.

Setting up your environment

Environment Shaders are applied to a selected pass within your XSI project. For the purposes of this tutorial, you will be using the default pass given to you upon opening XSI. There are two methods you can use to attach the shader to a pass. They are outlined below:

1) Open up your explorer, make sure your scope is set to 'scene' and select the scene root. Turn your C viewport into a rendertree, and click update. The default scene material will show up with a phong material shader attached to it. From the render tree pulldown menu at the top of your window, click on nodes>environment>more. From the pop up window, navigate to the Soft3D folder:

C:\Softimage\XSI_1.5\Data\DSPresets\Shaders\Environment\soft3d)

and choose the Legacy Day shader.

Press OK

The shader node will appear in your rendertree viewport. Left click the red output dot on the legacy shader node, and drag the resulting arrow that appears on top of the orange 'scene material' node. When you release your mouse button, you will be prompted to choose an 'input' on the scene material node you wish to attach the shader to. Since you're dealing with an Environment shader, select the Environment option. The shader will now be attached to the scene.

The other method involves you attaching the legacy shader to a specific pass in your scene.

2) Press your '3' supra key to switch to the ''render' module. Click on pass>edit>current pass. In the pop up window that appears, name your pass SKY_PASS. Click on the Environment Shaders tab to bring up the environment shader stack page. You'll notice that the shader stack is currently empty. Click on the Add button to the right of the stack box, and from the pop up window navigate to the Environment/soft3D folder, and then choose the legacy day shader.

Press OK. In your B viewport, create a render region to see what the default shader looks like. It's pretty horrid looking. We'll definitely need to tweak this shader to get the look we're after.

Editing the Shader Highlight the Legacy Day shader that is currently sitting in your shader stack, and then press inspect to bring up the shaders property page. Lock the property page to keep it from refreshing if you accidentally select another object in your scene.

The Legacy Day property page contains three tabs that you can adjust parameters within. There is a sky, cloud and ground tab.

The downside to this shaders interface is that the only way to see your results is to uncheck the Sky mirror option when you think you have a respectable mixture down pat. Makes for a very unintuitive workflow Hopefully, this will change in a future upgrade.

Switch back to the Sky tab. Keeping in mind that we're trying to build a dawn type effect, the settings here will need to be changed. The two color sliders available to you in this tab are the Zenith and Horizon sliders.

The Zenith is the main overall color of the sky, while the horizon is the area of color above the edge of your ground plane. The sky should be a blue orange color, as the rising sun will tint the blue sky a little bit, creating the mix.

Drag the RGB sliders on the Zenith parameter to create a slightly desaturated blue

I chose RGB values: 0.341 , 0.520, 0.734.

Drag the Horizon parameter sliders to create a orange / red mixture that is also slightly desaturated.

I chose RGB values: 0.901 , 0.377 , 0.223.

While still in the Sky tab, you'll also want to adjust the blending between the Horizon and Zenith. This is precisely what the Horizon/Zenith Bias slider is for. Dragging the slider values towards 0 will result in a blending that is weighted more towards the color of the Horizon, while a value of 1 will weight the color mix more towards the color of the sky. In our example I would use a higher value to create a small area of sunlight that is just starting to peak over the horizon.

I chose a value of 0.959

The Y rotation slider allows you to rotate the sky around the zeniths center, which is the middle of the sky.

Your sky is looking pretty good, all that's left to create our image is to adjust the color and texture of the clouds. Click on the clouds tab to switch over to the clouds property editor. As the sun is rising in the morning sky, the clouds will absorb some of the color emitted from the sun, as well as inherit some of the color from the sky. A slightly pinkish tinge to the clouds should serve us well here.

For the clouds color, I chose RGB values of: 0.885 , 0.651 , 0.660.

The clouds look a little too intense at the moment. There are too many of them, and they don't look very soft and appealing. In fact they look like solid heavy objects rather than light fluffy clouds. In our scene, we want a very soft cloud cover, with an adequate falloff in opacity towards the edges.

Cloud fractal

The Cloud limit slider will first allow us to define a starting point for the clouds in the sky. A value of 0 would allow the clouds to extend all the way down to the horizon line, something we don't quite want. A value of 90 would give us clear blue sky for miles. I want it appear as though the sky was overcast during the night, and has the potential for clearing as the sun rises.

I chose a value of 4 for my limit. Note that these values are measured in degrees from the horizon line.

Cloud Diffusion is a setting that allows you to control the diffusion of clouds in the sky. Lower values create thick clouds while higher values create thin less visible clouds. A diffusion setting of around 0.4 will create a nice sky cloud color ratio. We definitely want some of the blue sky to be showing through the clouds.

The offset slider works in conjunction with the 2 previously mentioned parameters. The offset controls the spacing between clouds. Lower values will remove clouds from the sky, while higher values will add in clouds simulating the effect of an overcast sky. I used a value of 0.61 here.

The amplitude and iteration slider will work in conjunction with one another. The two basically control the complexity of the clouds. In our example scene, I set the values of the amplitude to 0.15 while I set the number of iterations at 4.685

If you're animating a still image, then you don't really need to worry about checking the animate box. However, if you plan on animating a sequence where your sky plays a part in the piece, you'll want to turn this feature on. Many people simply use a single sky image when building up their scenes, but this can tend to look too static if there are a lot of clouds in the sky. Up in the atmosphere, and troposphere, low pressure and high pressure systems continuously move against one another in an endless dance. Unless it is a still, stagnant day, you should see some cloud movement in your scenes, unless you're really styling your piece. If theirs time in your schedule and it matches your budget, it can be an inexpensive way to add a little more life to your work.

The animation speed slider is only activated when the animate option is turned on. The online manuals state that this slider controls the speed of the clouds, but I'm still not exactly sure how this works or if that is an accurate enough description. My first impression was to drag the slider to a value of say 1, and leave it there. Unfortunately, dragging the time slider and leaving it set to a number showed no noticeable change in cloud movement. Therefore, the only thing left to do was set keys for varying animation speeds. I wasn't too impressed with the results of the animate slider. The slider seems more like the random seed function you get in many other shaders, such as in the example of the lightning shader tutorial. The clouds don't really animate like a real cloud would, rather the slider seems to simply change the pattern of clouds in the sky when at different values. Perhaps, I still need to explore this slider a little more to reach further conclusions.

To animate the clouds in a convincing manner, I've found that the best way is to animate the diffusion, offset, amplitude and transformation sliders all together rather than settle for the animation speed slider alone.

You'll see that by experimenting a little with this shader, you could use it for more than just sky and clouds. I've managed to simulate an underwater effect quite nicely, as well as use the image as a starting point for dirt maps if rendered out as a single frame.

 

Manipulating Environment Shaders was written by Adam Sale. Adam is a Technical Director at Joncrow Entertainment as well as a fully certified Softimage Instructor who teaches at various institutions throughout Vancouver, BC. He can be reached at adam@joncrow.com

*****Authors Note: WHen using objects as environments as of Version 2.02, plug the environment nodes into a Materials Diffuse or Color Node to get the shader to operate properly. ******