custom showcase env

Upload: ssarac

Post on 05-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Custom Showcase Env

    1/27

    Making a Custom Environment in Showcase

    There are several tools in development for Showcase to help you create custom environments. This

    document outlines when to use these tools, and other tips and tricks for getting the job done. Thereare four steps involved in this process, each building on the last:

    1. Change the background image and lighting maps.2. Create a new environment with built in tools and standard geometry.3. Calibrate the environment.4. Edit the dome geometry

    This document also describes how to create custom dome geometry in Maya and hand edit the a3e

    file, and provides supplementary workflows and troubleshooting information.

    Changing the background image and lighting maps

    This section assumes that you can supply a background imageone with low dynamic range (jpg,

    png, and tiff) and in Latitude Longitude format.

    The first thing to do when customizing an environment is to change the background image and

    lighting maps.

    Replace the background image

    For example, suppose that the reflections and lighting of the Exhibit Hall environment look good

    with a model, but the background image needs to be changed to provide different context. You can

    do this with the Generic environment, which is editable.

    1. Switch to the Generic environment, then right-click on its preview icon and select Properties toopen the Environment Properties window.

    .

    Figure 1: RMB over the Generic environment to open the Environment Properties window

  • 7/31/2019 Custom Showcase Env

    2/27

    2. The background image is actually a property of a material assigned to an environment dome. Tochange the background image, edit the material properties for the environment dome

    geometry.

    Click the Wall Material button, and the Floor Material button to edit the material currently

    assigned to the wall and floor, respectively. This is usually an Image Map material with the only

    editable attributes being the image assigned to it, and the mapping it uses (parametric, planar

    etc.)

    Figure2: Change the background image by editing the material on the geometry dome.

    Changing the background image this way does not change reflections or lighting.

    Note: The Wall and Floor Transform buttons are not used in this particular workflow.

    Replace the Lighting Map Files (IBL)

    1. To change the reflections and other IBL maps, use the Lighting overrides to browse to new IBLmaps. For example, replace the Generic IBL maps with those from the Exhibit Hall.

  • 7/31/2019 Custom Showcase Env

    3/27

  • 7/31/2019 Custom Showcase Env

    4/27

    Right-click on the environment icon and select Save to Environment Library. The newenvironment appears in the Environment Overlay UI section of the library for later use.

    Notes on changing the IBL maps

    Most of the images that make up environments are HDR (High Dynamic Range). It is common to

    encounter HDR images in the following formats: .hdr, .tiff (32-bit per channel), .exr.The IBL maps are in the Showcase Library are currently in .exr format to save on disk space.

    Showcase supports:

    .hdr : both reading and writing .exr : reading only

    You can create replacement IBL maps using:

    Showcase HDRShop Photoshop CS3 extended, or ATIs CubeMapGen

    Refer to Showcase Help for resolution and aspect ratio requirements for IBL images.

    Figure 4: Example of IBL maps-: background, reflect, specular (highlight), and diffuse

    Creating a new environment with built-in tools and standard geometry

    Showcase has a built-in method for importing an HDR image and creating an environment from it.

    This method creates the necessary components of an environment:

    A3e file and a folder with: Background image 3 IBL maps Geometry dome Thumbnail preview

    Import an HDR panoramic image

    1. To import an HDR image to be used as a new environment for Showcase, right-click on theGeneric Environment icon and select Create Environment IBL.

  • 7/31/2019 Custom Showcase Env

    5/27

    Figure6: RMB over the Generic Environment to evoke the Create IBL command

    2. Browse to an HDR image. (You might be prompted to create a folder to save the newenvironment to.)

    The Create IBL button at the bottom of the window becomes enabled when an HDR image is

    specified. The image must have a:

    2:1 width to height ratio if its in latitude longitude layout. 3:4 width to height ratio if its in vertical cross layout. 1:1 width to height ratio if its in mirrored ball/spherical layout.HDR images are often very large (for example, 6000 x3000 pixels= 80MB). As such, the image

    may take a few seconds to read-in before the Create IBL button becomes enabled.

    3. Click the Create IBL button to create the new environment.

    Tweak the results of IBL creation

    The initial results achieved by the Create Environment IBL can vary greatly depending on the HDR

    image used

    If the Environment is a little too light or dark, use the built-in controls for adjusting the environment

    IBL maps. These are in the Environment Properties Window:

    Figure 7: The Environment Properties window Lighting Overrides

  • 7/31/2019 Custom Showcase Env

    6/27

    These Lighting overrides can adjust the whole environment. You can also adjust individual maps. For

    example, it is common to increase only the highlight map (specular map) value.

    Note: The attributes in the window are covered further on in this document.

    Room Transforms buttonRotates the IBL maps.The effect of rotating the IBL maps isonly visible in reflections. To rotate the visible background, you must rotate the dome

    itself.

    The IBL contrast slider will have no effect until the contrast midpoint is also changed.Environment too bright or overexposed

    If the resulting environment is obviously way too bright and overexposed, the original HDR image

    may need to be pre-processed in Photoshop or HDRShop.

    Important Note: All HDR images are not created equal and the results produced by Showcase

    will depend heavily on the light value range in the HDR image. For this reason it is strongly

    recommended that you set the images exposure in Photoshop:

    Figure8: Using Photoshop to correct overexposed images

  • 7/31/2019 Custom Showcase Env

    7/27

    Calibrating the environment

    After creating the Environment IBL maps, you need to calibrate them relative to the material library

    and other environments. To do this, it is helpful to import an object into the scene and evaluate how

    the new environment illuminates it. Showcase has a few materials to help with this task. These are

    found in the Miscellaneous tab of the Materials Library:

    IBL Diffuse Effect IBL Highlight Effect IBL Reflection Effect

    Calibrate relative to IBL Effect materials

    1. When applied to an object in the scene, these materials will reflect only one of the IBL maps,Diffuse, Highlight and Reflection respectively.

    a. Create a new scene.b. Import a sphere, and duplicate it twice.c. Translate the spheres so that all are visible.d. Bake ambient shadow on the spheres (select Scene > Create Ambient Shadows).

    2. Apply a different IBL Effect material to each sphere.

    Figure9: IBL Effect materials applied to spheres

    a. Switch from the new environment to any other (such as the Docks environment).b. Observe how much the materials appear to change.

    Figure 10: Switching to another environment reveals that the new environment (previous

    image) is too dark by comparison

  • 7/31/2019 Custom Showcase Env

    8/27

    3. Return to the new environment and adjust the IBL Lighting Overrides until the change inmaterials is appropriate to the background image. This is a subjective task. You are eyeballing

    it.

    Figure 11: Environment properties IBL lighting overrides

    Notes on using the lighting overrides

    Changes to the Environment Lighting Overrides are visible only when there is an object inthe scene.

    IBL changes are only visible in reflections.Calibrate against a similar environment

    Compare the new environment to several library environments, but weigh any decisions towards a

    similar lighting model if possible. That is:

    If the new environment is a daytime shot with trees, calibrate against the Country Road. If the new environment is a dark shot (nighttime or underground) with concrete structures,

    calibrate against Night Plaza.

    If the new environment is a daytime shot with bright sunlight in a wide open space, calibrateagainst the Sepulveda or Dry Lake bed environments.

    Typical edits to environment properties

    Increase overall IBL value (Brightness) Decrease saturation Change contrast levels:

    Set the contrast midpoint to either .5 or 2 Change the IBL contrast

    (Changing the contrast without changing the contrast midpoint will have zero effect.)

    After making global changes to all the maps, it is often necessary to further adjustindividual maps, for example:

  • 7/31/2019 Custom Showcase Env

    9/27

    reduce saturation on diffuse map to .5 increase IBL effect of diffuse map to 1.5 reduce saturation on highlight map to .5 increase IBL effect of highlight map to 2

    Figure 12: Before and after environment calibration

    Assign Yellow Car Paint to a sphere and confirm that it does not appear to have a green tint. If so, the Diffuse and Highlight maps are probably too saturated.

    (This is noticeable in environments with lots of bright blue sky).

    Assign White Car Paint to a sphere and confirm that it is not overexposed. If so try lowering the IBL Effect of the highlight map.

    Assign Black Car Paint to a sphere and confirm that it is not underexposed. If so, try increasing the IBL Effect of the diffuse map.

    Editing the dome geometry

    Positioning the dome geometry

    The Environment Properties window also provides controls for positioning the dome geometry.

    The Room, Wall, and Floor Transform buttons are for translating and scaling the dome geometry.

    This is necessary when:

    The environment looks way too big or small for the scene. The environment needs to be rotated to provide an optimal view. In this case, geometry

    rotations need to match the IBL map rotations (an option in the Environment Properties

    window).

  • 7/31/2019 Custom Showcase Env

    10/27

    Figure14: Room Transformations will allow the background to be rotated

    Note: The effect of rotating the Environment geometry does not affect reflections.

    Rotate the geometry first, and then rotate the IBL maps with the same values.Use the Room

    Transforms button in the Environment Properties window to rotate the geometry

    Switching the dome geometry

    Some HDR images may appear distorted when seen on the Generics default dome geometry.

    For example, tall buildings or trees can appear to curve as they near the top of the dome. For this

    reason, you can specify a different Dome geometry (apf) file in the Environment Properties window.

    Figure15: Changing the geometry to correct distortion.

    The following geometry can be interchanged fairly easily:

    Counrtyroad.apf Docks.apf

    Has straight sides which is good for buildings or scenes with trees. The Docks has a

    planar mapped ground. It is designed to have a separate image assigned to the floor. For

    example, a repeating tile pattern.

    DryLakeBed.apfVery large, useful for vast, open spaces.

    Generic.apf GreenRoom.apf:

  • 7/31/2019 Custom Showcase Env

    11/27

    Note: The GreenRoom has a third material for the ceiling which is not accessible via the

    Environment Properties window. The UV layout of this environment supports a single

    image mapped repeatedly onto all four walls.

    Sepulveda.apf

    Figure16: Relative sizes and shapes of existing dome geometry

    When the environments dome is switched, the material that was assigned to the previous apf file

    may not display correctly. This is because the new file may have differently named walls and floors

    and this can break the materials link to the object. This problem can be corrected by making sure

    that the correct Wall geometry is listed in the Walls pull down menu.

    Use the Wall Material and Floor Material buttons to edit the material currently assigned to the wall.

    This is usually an Image Map material with the only editable attributes being the image assigned to

    it, and the mapping it uses.

    Figure 17: Defining the correct wall geometry

    Creating custom dome geometry in Maya

    (The following procedure assumes a working knowledge of Maya)

    You may want to create custom environment geometry to match specific HDR images. An example

    of this is the Exhibit Hall environment. It uses a rectangular geometry instead of the usual

    hemisphere. This reduces the distortion which can be seen in the final result.

  • 7/31/2019 Custom Showcase Env

    12/27

    Load the apf plug-in

    To create custom geometry in Maya, the Autodesk packet file plug-in must be loaded. In Maya

    version 7 and up:

    1. Go to Window > Settings and Preferences > Plug-in manager2. Click the Load button.3. Browse to the appropriate Plug-in folder, located in

    C:\Program Files\Autodesk\Showcase2008\maya\

    (There is a separate folder for each version of Maya which contains the Plug-In).

    Create geometry domes

    1. Create a polygon object in the desired shape of the environment (for example, sphere withflattened bottom, cube with arched roof etc).

    2. Make the polygon object in two pieces: Dome and Ground, and name them accordingly. Note that Showcase relies on the naming of the Ground object to cast ground

    shadows.

    The average size of a Showcase environment is 2000cm (for automotive)2. Group the Ground and Dome together as Room.

    Figure 18: Required naming convention of geometry for use as Showcase environment.

    Figure 19: Examples of some useful shapes for environments

    3. Center the pivot point of the Room group to the center of the Ground object.4. Center the Room at the origin:

  • 7/31/2019 Custom Showcase Env

    13/27

    Figure 20: Room is at the origin and its pivot point is centered on the Ground.

    5. Modify > Freeze transformations on all the objects.6. Export the Room objects as an apf file.7. Flip all normals so that they face inward.

    To preview this in Maya, turn OFF double sided in the objects attribute editor (uncheckAttribute Editor > Render > Double Sided)

    The object representing the floor should be centered at the origin.8. The geometry must have an orderly UV layout, that is, no overlapping UVs.

    Figure 21: Orderly, non-overlapping UV layout is required for the projected Surface Shader

    workflow

  • 7/31/2019 Custom Showcase Env

    14/27

    Place the background image

    (The following workflow assumes that you have already used the built-in tools to create the IBL

    maps and background image.)

    There are several ways to change the position of the background image as it appears on the dome:

    Edit the Domes UVs Edit the Domes material in Showcase Edit the background image placed on the dome

    The third method is described here:

    1. A projected Surface Shader can be created in Maya to quickly provide a new background imagewhich will fit perfectly onto the new geometry. In this case, the shading map is used to place the

    image, and mental ray is used to render a new version of the image which will fit the UVs of the

    model.

    2. Assign a Surface Shader to all the surfaces in the geometry dome.a. Map the Surface Shaders Out Color to a file texture: select the As Projection option when

    doing so.

    b. Set the projection type to spherical.c. Browse to the background image (in latitude longitude format) and use it as the file texture

    for the out color.

    d. In Maya, press the 6 hotkey (texture shading ON) to see the placement of the image onthe geometry interactively. If the resolution of the image is not clear enough, increase it by

    switching to High Quality Rendering in the panel view options:

    Figure 22: Maya High Quality Rendering in the main view

    d. Use the Surface Shadersplace3dTextures handle to rotate and translate the image andalign it correctly with the geometry.

  • 7/31/2019 Custom Showcase Env

    15/27

    Figure 23: The Surface Shaders outColor is positioned with the place3dTexture handle

    Bake the new background image using mental ray

    1. Select all the dome geometry and then:a. Right-click on the dome geometry and select Baking > Edit attributes > texture.

    This opens the Bake Set window. Set the attributes as shown below:

  • 7/31/2019 Custom Showcase Env

    16/27

  • 7/31/2019 Custom Showcase Env

    17/27

    Figure 25: rendering the new background image via Lighting/Shading>BatchBake (Mental ray)

    d. Copy the image from \projects\default\renderData\mentalray\lightMap to the new environment folder.

    Figure 26: Original image and the newly rendered layout to support the custom geometry

  • 7/31/2019 Custom Showcase Env

    18/27

    Undocumented Maya export to apf tip

    When exporting an apf file from Maya, note the following:

    The apf file has materials imbedded in it. Any images associated with this file will be foundand displayed parametrically, if the images are in the same directory as the apf file.

    If a Shading Map effect is desired on the apf file, do the following:1. In Maya, assign a Phong material.2. Make all of its values the lowest possible values:

    (0 black, or move the slider to the left).

    3. Map an image to incandescence.The result will be an apf file which will automatically have the equivalent of:

    Shading map in Maya Image Map in Showcase

    Figure 27: This set up of a Phong will be interpreted by Showcase as an Image Map

    material.

  • 7/31/2019 Custom Showcase Env

    19/27

    Appendix A: Hand editing the a3e file

    Prerequisites: This portion of the workflow assumes that the user has:

    Some experience editing xml, or other scripting language. A basic environment as created by Showcases built in tools.

    This environment is named MyEnviro (for example).

    A custom geometry dome built in Maya A new background image rendered out of Maya which matches the custom geometrys UV

    layout.

    Note: Showcase scene files have an .a3s extension.

    Showcase environments have an .a3e extension.

    Edit the MyEnviro a3e file (which is xml format text) so that it references the new geometry. To do

    this, a sample file is useful for copying model and material statements from.

    Create a sample file with the new model and materials:

    1. Create a new Showcase scene.2. Import the custom dome geometry into the scene.3. Press the M key to display material library.4. Select the Ground object and assign an Image Map to it :

    a. Select Materials > Miscellaneous > Image Map.b. Source the new background image (previously rendered in Maya) and use it for the

    materials color.

    c. Rename the material Floor.5. Select the Dome object and assign an Image Map to it.

    a. Source the new background image (rendered in Maya) and use it for the materials color.b. Rename the material Walls.

    6. Save the scene. For example, name it TestEnviro.7. Open both TestEnviro.a3s and MyEnviro.a3e in WordPad and compare the models section at

    the top.

    Note: The MyEnviro.a3e file has an additional light statement in the models section (highlighted

    in red below, the models are highlighted in blue). Do not overwrite the lighting statement in the

    next step.

    Copy the models from the test file to the environment file

    The simplified syntax of the models section of the a3e file looks something like this:

  • 7/31/2019 Custom Showcase Env

    20/27

    Note that the section can be very long in the case of custom geometry with many

    polygon objects.

    a. Compare this to the MyEnviro.a3e models section:

  • 7/31/2019 Custom Showcase Env

    21/27

    3. Paste the models section from the TestEnviro.a3s (marked in blue) into MyEnviro.a3e.4. Save the edit s to myEnviro.a3e and test that the environment still loads in Showcase (the

    materials assignments will be lost at this point).

    Copy the materials and material assignments from the test file to the environment file

    Note: The material assigned to the ground must be of type Unlit to receive shadows.

    1. Here is an example of a materials section of an a3s file.

  • 7/31/2019 Custom Showcase Env

    22/27

    2. Copy paste the entire materials section from the test file and use it to overwrite the materialssection in the MyEnviro.a3e file.

    3. Do the same for the material assignments:

    Note that the material is assigned to the dome using its name, not its label; the label is what you

    would see as the material name within Showcase, but the under the hood name of the

    material is Miscellaneous::Image Map in this case. Its label is Walls.

    4. Save the edits to MyEnviro.a3e, and load the file into a new Showcase session to previewMyEnviro.

    5. Align the environment IBL to the custom geometry dome.6. In the process of creating and exporting a custom dome

    Set the default light direction for the new environment

    Showcase environments and materials can be affected by an environment light.

    When this control is ON, the light and shadow direction is read from the environment (unless you

    have specifically overridden it for your scene by changing the value in the aforementioned control).

    To get the appropriate positional values for the light in the MyEnviro.a3e file, you must:

    1. Create a new Showcase scene.2. Switch to MyEnviro.3. Import an object into the scene and assign a reflective material to it.

    (Materials > Miscellaneous > IBL Reflection Effect)

    4. Switch on scene shadows.(Scene > Environment Lights and Shadows > Illuminates and Casts Shadows)

    5. Position the light so that it matches the direction of your IBL images.6. Move the shadow until it looks right.7. Alternate method:

    a. Face the reflective object.

  • 7/31/2019 Custom Showcase Env

    23/27

    b. Find the reflection of the sun in the object. (That is, position the camera so that theenvironment light is behind you.)

    c. Ctl-click to place the highlight.8. Avoid making the light very close to the horizon, and thereby casting excessively long

    shadows.

    9. Save the scene as MyEnviro_lightPosition.a3s.10.Open the MyEnviro_lightPosition.a3s file in WordPad and look for the lightPosition

    statement (at the top of the file, at the end of the models section).

    a. Copy the following positional information (highlighted in red):

    b. Paste this positional information from MyEnviro_lightPosition.a3s into the samerespective location in MyEnviro.a3e .

    c. Save the file and test it in Showcase on a new scene. Turn on scene shadows and importan object to confirm that the shadows appear in the correct location for MyEnviro.

    Appendix B: Supplementary workflows

    Hand editing a copy of an existing environment

    One of the simplest ways to customize an environment is to start with a copy of another

    environment. This copy can be made from within Showcase by right-clicking on an environment and

    then selecting Save to Environment Library. For this example, assume that the generic environment

    was copied, and the IBL maps were also copied from the commonfolder. Alternately, the folder

    itself can be manually copied from an explorer window. In this latter case, the copied environment

    will need the following edits:

    1. Rename the environment folder: TestEnviro2. Rename the environment .a3e file inside this folder: TestEnviro.a3e3. Edit the TestEnviro .a3e file in WordPad and change the header name :

    Before:

  • 7/31/2019 Custom Showcase Env

    24/27

    After:

    Figure28: Generic environments folder contents. Note that the IBL maps for this

    environment are not located here. For this example, it is necessary to copy the IBL

    maps from the support\environments\common folder.

    Figure29: Typical contents of an environment folder (Night Plaza shown)

    Note that the .mayaSwatches folder contains pre-rendered material swatches. It is

    optional to include this or not.

    Changing the environments icon

    In Showcase you can set image for any custom environment. This is the simplest way to create a

    new icon. You may opt to edit the environments icon, in this case Generic.tif, in Photoshop (to add

    text or a logo). Be careful not to remove the icons transparency:

    1. Ctl-click the icons layer to select it.2. Open another image which represents the new environment (for example, a saved image of a

    sphere in the environment).

    3.

    Select the image and copy it to the clipboard.4. Ctl-Shift-V to paste the image into the Generic.tif.5. Ctl-T to transform the pasted image into place (make it smaller).6. Ctl-E to merge the pasted layer down.7. Save the image and rename it TestIcon.tifEditing the a3e file to source the new icon

    1. Open the testEnviro.a3e file in WordPad.

  • 7/31/2019 Custom Showcase Env

    25/27

    Before:

    After:

    2. Launch Showcase and verify that the copied environment can be displayed, and appears with itsnew name and icon.

    Changing the IBL maps

    At this point, the images that make up the environment can be safely edited.

    These images are HDR (High Dynamic Range). It is common to encounter HDR images in the

    following formats: .hdr, .tiff, .exr.

    Showcase supports:

    a. .hdr, both reading and writingb. and .exr, just readingc. .tiff (32-bit per channel) is unsupported

    A common edit is to switch all the IBL maps with new ones. These new maps may have been created

    by Showcase, HDRShop, Photoshop, or ATIs CubeMapGen. Refer to the help documentation for the

    specifics on optimal resolutions for these images.

    For the purposes of this example, assume that there are four new maps which are to replace the

    existing ones:

    NewTest_background.pngThis is a latitude longitude normal image such as a .jpeg. tiff(8-bit/channel) or .png

    Reflect_new.hdr vertical cross Diffuse_new.hdr vertical cross Specular_new.hdr vertical crossThe IBL maps are in the Library environments are currently in .exr format to save on disk space. If

    the new replacement maps are in a different format, the testEnviro.a3e will need to be edited

    accordingly:

    1. Scroll to the bottom of the .a3e file and look for:

  • 7/31/2019 Custom Showcase Env

    26/27

    2. Change to:

    Note: The ../Common/ was edited out. This is because the IBL maps were copied from the

    commonfolder to their current location with the TestEnviro folder.

    3. Test that the new files are showing up in Showcase.

    Changing the background image1. To change the background image, it is necessary to edit the material which is assigned to the

    dome geometry. Look for the materials section (at the bottom, just above the lighting) :

    And change it to (overlook the line wrap below):

    2. Test that the new background is showing up in Showcase by switching to another enviro andthen back.

    Appendix C: Troubleshooting

    It is important to test any changes to a hand edited environment every step of the way: asingle syntax error will break the file.

  • 7/31/2019 Custom Showcase Env

    27/27

    Showcase saves explicit paths to images and apf files. If you are planning to share your newenvironment with another user, you may want to edit out these explicit paths.

    Showcase will look in the current environment folder for any images/files regardless.

    In Showcase, make sure that the IBL reflections are aligned with the visible background:1. Import a sphere and assign an IBL Reflection Effect material.2. Press the Home key to get to the home view. This is the initial view seen when the

    environment is first seen.

    3. Rotate the environment geometry to get the best possible view.(Most Showcase environments are rotated so that the main light source appears to be

    just over (and slightly behind) the users right shoulder.)

    4. Save the changes to the environment.5. Switch to a birds eye view of the sphere. Rotate the Environment IBL to match the

    dome geometrys rotations (if any).

    6. When previewing edits as theyre made:a. Switch to another environment.b. Save any image edits done in Photoshop etcc. Reload the environment.

    Editing the a3e files may require a restart of Showcase for changes to be seen. Editing the dome geometry requires a restart of Showcase for changes to be seen. Be aware of the operating systems tendency for one application to put a lock on files so that

    another application may not overwrite it. In this case, error messages are not always apparent.