The Spotlight Story SDK supports multiple rendering passes allowing you to add post effects to a story. So, for example, you can add a depth pass, set up volume lighting, render different actors in different passes, or have one render feed into a subsequent render.
Essentially, any time you want to render with different settings for different areas on the screen, or if you want to apply an effect to the whole screen that doesn't lend itself to a simple change in the shader, that is a candidate for using post effects.
Here are the basics steps for using post effects in your story. More detail on each of these steps follows.
- Create a render graph file (.mfx) which describes the order of effects (or chain) to be applied in your render.
- In Maya, add a Post Effects node (spotlightPostEffects) to your scene that specifies the name of the render graph file.
- In the Story Editor, add a Set Active Render Graph command to the first clip of your story, specifying your chosen render graph.
When you build your story, the SDK will apply the render graph actions.
Creating a Render Graph File
Currently, the .mfx file must be created manually. We recommend that you start from a sample file on our web site.
Specifying the Render Graph in Maya
- In your Maya scene, on the SpotlightStories shelf, click on the Create Post Effects Chain icon. The spotlightPostEffects render node appears in your Outliner.
- Give your render node a name in the spotlightPostEffects field. This will be the name you refer to in the Story Editor.
- In the Attribute Editor, open the tab with your render node name. Load the path and file name of your .mfx file into the Post Effects File field. Once you load your .mfx file, the Render Views and Post Effects Chain appear.
Once you load your mfx file, you can make changes to the Render Views and Post Effects Chain fields, if you don't want to make the changes directly in the .mfx file. Under Render Views, you can click on the Actors button to toggle which actors appear in that Render View. Under Post Effects Chain, you can adjust parameters, or even add animation to them.
Tagging actors in the Maya scene
If you have a render graph with multiple render views (scene nodes), you can specify which actors are rendered into which views. You do this by adding View Tags with the names of the desired passes.
Add the string attribute “MoxieViewTags” to an actor. In this attribute, include a comma-separated list of the render view names in which you want the actor to be included. For example, imagine you have three render views: Color, Depth, and Normal. If you want an actor to be included in the Color and Normal render views only, you can set the MoxieViewTags attribute to “Color, Normal”.
There are also two special keywords, “all” and “none”, which you can include in the MoxieViewTags attribute. The “all” and “none” keywords will include your actor in all or none of the render views, and these keywords override any other render view names listed in the attribute. If you have both “all” and “none”, the “none” keyword takes precedence, and the actor will not be included in any render views.
If an actor has no moxieViewTags attribute, it will be included in all the render views.
Adding the Post Effects to the Story Editor
Once you have added the render node to your Maya scene, you need to tell the Story Editor where to find it and when to use it.
- In the Story Editor, be sure to reload your source files. Under the File menu, either have Auto Reload Sources checked, or click on Reload Source Files.
- Double-click on the first state in your story graph to open the Timeline.
- Right-click on the first frame in the state and choose Create Action. Under the "Util" category, click on the Set Active RenderGraph command.
- In the Properties window, enter the name of your Maya post effects render node. This is the name you entered in the "spotlightPostEffects" field in the Maya Attribute Editor.
Ordinarily, you will want your post effects render to start with the first state in your story. However, you can start the post effects later in the story, and the default render will run until it gets to your post effects command. Simply add the Set Active RenderGraph command later in the story graph.
You can also switch from one type of post effects render to another by using another post effect command and pointing it to a different render node in your Maya scene.
Remember that, when you use post effects which create multiple rendering passes, your rendering and compositing time will increase, sometimes significantly. In some cases using a local asset change, or altering a shader, might be enough to create the effect you want without increasing render times.
Once you have created the post effects for your story, you can see information about them in the Outliner window. They appear in the Sources section listed under their Maya source files.