LIGHTING DESIGN - Radiance Materials

Using more Complex Radiance Materials

This is a short tutorial on how to use more complex RADIANCE materials from within ECOTECT. You should have already done the Exporting to Radiance tutorial to make sure that RADIANCE is set-up properly on your machine and that you can successfully export a scene file from your model.

  1. Open the  file from the Tutorial Files folder in your main ECOTECT Install directory.
    There are three zones in this model, one called Room, one called Box and the default Outside zone. It is a simple room with a camera and a large box box in the middle. Essentially the box is the object whose materials we are going to change. It should already be grouped so you only need to click one object to select them all.

Rendering the Base Model

  1. First off, export the model to Radiance to see what material the box is currently assigned.

    The box should be assigned the material 'LightBlue'. You can export to Radiance using either the Export Manager panel to the right of the main application window or the Export... item in the File menu.

    Either way you should be prompted for a filename to save the scene files - simply choose somewhere like C:\Temp\Test.rif, remebering the problems Radiance sometimes has with long file names.

    You should then see the see the Radiance Export dialog, in which you should ensure that an Overcast Sky is selected and that the action is set to Final Render, as shown below.

    This should produce an image similar to the following:

Defining a More Complex Material

  1. Make sure you have set the Default Export Material Directory in the Preferences Dialog.

    When ECOTECT exports any file, it can be set to look in both the local model directory and a global shared directory for matching material files. Simply select the User Preferences item in the File menu and ensure that you have the item highlighted below set to the Materials folder in your main ECOTECT install directory.

    You can create a your own export materials directory and redirect ECOTECT to there if you work with a lot of your own materials, however this tutorial uses the 'WoodGrain.rad' and 'BrickRough.rad' files which should already be installed in the default Materials folder. If you have changed this directory, simply copy these two files to the area you now use.
  2. Select the box and assign it the 'BrickRough' material.

    As mentioned previously, the box is grouped so you should only need to click on one object to select the whole box. Once it is selected, open the Material Assignments control panel on the right hand side of the main application window (the tab with the checkered material swab) and select the BrickRough material, as shown below.

  3. Once again export the model to Radiance as you did in the very first step, this time ensuring that the 'Check for Material.rad files' item is checked.

    This item can be found in the Radiance Export dialog in the Material Definition group.

    Checking this option instructs ECOTECT to check in either the same directory as the ECOTECT model or the Export Materials directory for any files with the same name as any materials in the model. We have assigned the box 'BrickRough', so ECOTECT will look for a file called 'BrickRough.rad'. It understands that .rad is the prefix for Radiance files whereas if you were exporting to VRML it would look for 'BrickRough.wrl', etc.

    You should end up with an image similar to the following:

    If you were to examine the Radiance scene file created by ECOTECT, you would find that it has substituted the following for the definition of the BrickRough material:
    # <== [C:\Program Files\Square One\Materials\BrickRough.rad] 
    void texfunc BrickRough_m1
    4 Xp Yp Zp
    6 .020 .040 .230 .115 -0.7 0.7
    BrickRough_m1 texfunc BrickRough_m2
    6 xwrink ywrink zwrink -s 0.1
    3 0.05 0.05 0.15
    BrickRough_m2 plastic BrickRough
    5 0.150 .075 .012 0 0.2
    # ==>

It has simply inserted the contents of the 'BrickRough.rad' file diectly into the scene file. You will notice that the material definition ends up defining it as 'BrickRough'. Thus, even though the file system will recognise a material called 'brickrough' as matching 'BrickRough', the Radiance render will fail as its material definitions are case-sensitive.

The code inside the file contains relatively straighforward Radiance instructions. For more information on what they mean if you wish to edit and customise them, see the file RadianceReferenceManual.pdf in the manuals folder in your Radiance directory.

Experimenting with Different Values

  1. As a short exercise to reiterate what we have done, try assigning the box as WoodGrain.

    Perform the same steps as above, this time choosing the 'WoodGrain' material, just to show how easy it is once you have a library of materials. You should end up with an image similar to the following:

  2. If you are feeling experimental, save the ECOTECT model into your own home directory (if you are on a lab or office machine) and copy the WoodGrain.rad file to the same directory as you saved the model.
  3. Open the local copy of the 'WoodGrain.rad' file in a text editor such as NotePad.

    The file should look like the following. The numbers that you can change without having to worry about anything are highlighted in red. For example, the number after the -s in the second line is simply the scale of the randomised dirt function. The numbers at the very bottom represent the red, green and blue colours of the base material colour followed by a specularity and roughness value.
    void brightfunc WoodGrain_b1
    4 dirt -s 0.008
    1 0.15
    WoodGrain_b1 brightfunc WoodGrain_b2
    4 zgrain -s 0.016
    1 0.55
    WoodGrain_b2 texfunc WoodGrain_tex
    6 xgrain_dx ygrain_dx zgrain_dx -s 0.01
    1 0.075
    WoodGrain_tex plastic WoodGrain
    5 0.35 0.3 0.15 0.005 0.025

The aim is simply to get a feel for how easy (or obscure depending on your perspective) it is to achieve different effects with the different parameters.

Don't worry if you mess up this file as you can always copy the original back over the top of it if you need to start over.