1. Пользоваться форумом на планшетах и телефонах стало удобнее благодаря Tapatalk

Кастом шейдеры в при распределенном рендере

Тема в разделе "SoftImage", создана пользователем -, 14 апр 2003.

Модераторы: Григорий Чаленко
  1. Guest

    Для тех кому лень читать доки :
    Custom Shaders with Distributed Rendering

    If you have a renderfarm set up and your scene uses custom shaders, it is
    crucial that each machine in the renderfarm uses the same version of each
    custom shader.
    Although you can install custom shaders on every machine in your
    renderfarm, it is quicker and easier to install them into a workgroup path to
    which all render slaves are pointing.
    The procedure for installing custom shader varies depending on what kind of
    render slaves you’re using.
    • In an XSI interactive setup, where all of the render slaves have XSI
    installed, you can install your custom shaders as part of an add-on.
    • Render slaves using the mental ray standalone do not recognize XSI add-
    ons, so a few additional steps are required.
    Installing Custom Shaders to Workgroups (XSI Interactive Render
    Slave Installation)
    The best way to ensure that all of your renderfarm machines are using the same
    custom shaders is to copy the shaders to a shared workgroup location. The
    advantage to using a workgroup location is that the ray3rc file loads workgroup
    shaders last, so the render slaves will find and use the custom shaders.
    For this approach to work, the following requirements must be met:
    • Every render slave’s ray3xsi3_0server service must be logged in using the
    same user name and password (see below). Because the workgroup path is
    set for the user, every render slave will point to the same workgroup path.

    The best thing to do is create a user account specifically for rendering.
    This user must have administrative privileges and have access to the
    shared workgroup directory.
    • The custom shaders must be in a shared directory to which the render user
    has access. A good approach is to use a shared directory on a server. XSI
    does not have to be installed on the same machine as the shared directory.
    To run ray3xsi3_0server as a specific user (Windows systems)
    On each render slave where XSI is installed, do the following:
    1. Edit the ray3xsi3_0server service’s properties from the Windows
    Management Console.
    To open the console, right-click the My Computer icon and choose
    Manage from the menu. The management console opens, from which you
    can select Services and Applications > Services to display a list of services
    on your machine.
    2. Right-click the ray3xsi3_0server service and choose Properties from
    the menu.
    3. From the Log On tab, specify that the service should log on using a
    particular account.
    4. Enter the user name and password for the rendering user account.
    5. Close the management console. Log off the render slave and log back on
    using the render account’s username and password.
    6. Open an XSI command prompt and set the workgroup path using the
    following command.
    xsi -w workgrouppath
    Now, whenever the ray3xsi3_0server is called, it will render under the
    specified user and use the workgroup path set for that user.
    Make sure to start and exit XSI on each renderfarm machine. This
    allows XSI to detect that a new shader has been installed and needs
    to be registered. The easiest way is to create an empty “dummy”
    scene which you can load from the command line using:
    xsibatch -r -scene "dummy.scn".
    Alternatively, you can start an XSI interactive session to register the
    shader. XSI will prompt you to restart, which indicates that the
    shader was registered properly.ഊSetting Up For Distributed Rendering
    Setup & Licensing • 81
    To Maintain a Custom Shader Workgroup
    To keep your distributed rendering setup working smoothly, try using the
    following process to test, upload, and update your custom shaders.
    1. Create the custom shader locally.
    2. Install the shader locally under “user” and test that it works.
    3. If the shader works correctly, copy it to the workgroup directory using the
    following command:
    xsi -i myshader -dest workgroup
    4. Start and exit XSI on each renderfarm machine.
    This allows XSI to detect that a new shader has been installed and needs to
    be registered. The easiest way is to create an empty “dummy” scene which
    you can load from the command line using:
    xsibatch -r -scene "dummy.scn".
    Alternatively, you can start an XSI interactive session to register the
    shader. XSI will prompt you to restart, which indicates that the shader was
    registered properly.
    To Update Shaders in a Custom Shader Workgroup
    If you need to update your custom shaders, you can test the updates locally,
    backup the shader in the workgroup directory on the server, and promote the
    updated shader to the server.
    Then restart all machines that use the shared workgroup path twice:
    • The first restart registers the shaders.
    • The second restart allows the machines to continue to work.
    Important: If you are updating shaders in the workgroup directory, make sure
    that all of the render slaves have stopped rendering. Otherwise, the shaders
    may be locked by one of the slaves and the copy process will fail.
    Window systems allow you to run commands according to a
    schedule using the “at” command. Using this command with the
    “net start” and “net stop” commands lets you specify when the
    Ray3xsi3_0 Server service stops and restarts on each render slave.
    This makes it easy to create a window of time during which you can
    upload and register updated shaders.ഊ82 • SOFTIMAGE|XSI
    Chapter 6 • Setting Up For Distributed Rendering
    Installing Custom Shaders to Workgroups (mental ray Standalone
    Installation)
    For render slaves that need to interoperate with the workgroup, the work is
    fairly simple.
    1. Edit the ray3xsi3_0.bat file and add the following line just before the last
    line (the one that calls ray3.exe):
    set XSI_WORKGROUP_SHADERPLUGINS=\\SERVER\share\addons
    2. On each slave machine, make sure the ray3xsi3_0server .exe service runs
    as a user that has access to \\SERVER\share\addons directory
    To determine if the mental ray standalone can use a custom shader
    correctly, do the following:
    1. Open the shader .spdl file and copy the reference guid (bolded in
    the example below) at the beginning of the file:
    Reference = "{GUID}";
    2. Open an XSI command prompt on each machine and do the
    following:
    -Type: ray3 -verbose on <enter>
    This makes ray3 work in “stdin” mode, where you can type in
    the mi2 file directly
    -Type: $lookup "{GUID}" <enter>
    - Press Ctrl + z and then press Enter.
    If ray3 has loaded the shader’s .spdl and .dll properly, no errors or
    warnings will be reported.
    Note: to perform this test, you must have a ray3.exe license.&#3338;Setting Up For Distributed Rendering
    Installing Custom Shaders to the Local Factory Path (XSI
    Interactive)
    If you want to install a custom shader locally, it is recommended that you use
    add-ons.
    1. Install your custom shader on a machine using the following command
    from the XSI command prompt:
    xsi -i blah.spdl
    2. Repackage the shader as an add-on. For more information about creating
    add-ons, see Chapter 24: Plug-ins and Add-ons in the Fundamentals guide.
    3. Install the add-on on each of the machines in the distributed rendering
    network using the following command from the XSI command prompt:
    xsi -i blah.xsiaddon -dest factory
    This installs the add-on in the machine’s Factory path instead of its User path.
    4. Using a text editor, edit each machine’s ray3rc file to load factory shaders
    last. Locate the following entry and move it to the end of the ray3rc file:
    ################ load Factory shader plugins registry "{SHADER_PLUGIN_HOME}" value "{XSI_HOME}" end registry $lookup "{SHADER_PLUGIN_HOME}" registry "{LOAD_FACTORY_PLUGINS}" echo "Loading Factory shader plugins" mi "{XSI_HOME}/Addons/shader_plugins.mi" end registry $lookup "{LOAD_FACTORY_PLUGINS}"
     
Модераторы: Григорий Чаленко

Поделиться этой страницей