tutorial4-12-q4b3-6h7m-10m

Chief Architect

Chief Architect X1 + POV-Ray 3.6.1, 2009

Some time ago, Chris Cason, the POV-Ray Team Coordinator, lend me a copy of Chief Architect X1, a professional home design software. This program uses POV-Ray as the internal raytracing engine, and also exports to POV format, but standard results don't seem to be showing off the best POV-Ray can do, so he was curious to see if I was able to create realistic images with it.

Of course, I needed first some months to learn the program, and then some more to get good results out of it... below you can see a selection of the test images I did with Chief Architect (CA from now on), some from the standard examples, and other created by me (mostly interiors with simple constructions, as my architectural skills are very limited). I mainly wanted to play with the POV-Ray side of things, using two-pass radiosity and enhanced textures and lighting to get better results, so there is zero modelling: I just used library objects from CA.

ana-ros-07-q3b3-7h-50m chimenea-05-q4b3-7h25m-35m curved-05 exterior-02 garage-01 innata-05 laufen-05 living-photo-05 marble-bath-06-q3b3-10h7m-40m prueba4-06-q3b3-fb-6h32m prueba5-06 red-bath-sample-03 red-bath-sample-04 tutorial4-12-q2b3-1h40m-8m tutorial4-12-q3b3-2h37m-8m tutorial4-12-q3b4-2h47m-10m tutorial4-13-q1b1-5m-6m tutorial4-13-q1b4-35m-3m tutorial4-14-q3b3-2h51m-9m tutorial4-14-q4b3-4h9m-13m tutorial4-15-q4b4-4h1m-8m tutorial4-15-q6b4-7h56m-19m tutorial4-15-q8b4-14h-37m ventanal-04 ventanal2-03 ventanal2-04

I'm very satisfied with the results obtained, but not so with the method used to obtain them... anyhow I wanted to share it with other CA users, so they can enhance their renderings and this way they will help to promote POV-Ray as a serious alternative for architectural rendering (something Hildur Kolbrun already demonstrated as possible).

There is below a quick tutorial about the work method I developed to set up the scene with CA, export it to POV-Ray format, and then enhance it manually before the final rendering. But before we start, let me present my impressions on CA use of POV-Ray, the problems I found, and how them influenced the method I've developed.


CA and POV

At first glance, CA and POV seem to be well integrated, but the problem is that POV is too much integrated into CA, making it impossible to get from POV-Ray everything it is capable of. This is understandable, as POV-Ray features are endless and can be used in infinite ways, so the internal interface has to be logically limited to some subset of features used in certain ways, but I find the current interface a bit too limited in this regard.

Anyhow, most of the time the average user just wants quick results, with shadows and some reflections. So, to get truly realistic images, it sounds logical to use CA export to POV-Ray, and then tweak it further within POV-Ray. But then you find that the current export format doesn't help at all for that task.

To be fair, I must say the rest of the program looks awesome to me, but I'm not an architect, so I can't truly evaluate how useful it can be for real construction work. For my usual "just one room" scenes it works very well, helping to easily create the room, populate it with objects and texture them at my will. It helps specially when placing the objects, to make them sit properly, and it's very useful to place the lights and camera. Another good point is that you can very easily incorporate your models (3ds format) into the library, acting then like any other bundled object.

Main problems

  • Internal render:

    Raytracing directly from CA using the Raytrace dialog is very handy for tests, or for making quick renderings for clients who don't care about realism. But it has some limitations and problems when you want photo-realistic images:

    • First and most important, you can only use a customized (and outdated) version of POV-Ray (3.5).
    • Uses light fading to control light intensity, when it should be using a fixed, realistic attenuation and adjusting the intensity with the light color.
    • Area lights don't use jitter, which helps greatly to make more realistic shadows.
    • Sunlight and daylight are way too dim for indoor scenes with incoming sunlight, which is fundamental to give more "life" to interior scenes.
    • Lack of variable reflection settings, which would help making reflective surfaces appear much more realistic.
    • Lack of a way to continue interrupted raytraces or to do partial image renders for tests.

    For all these reasons, I strongly suggest to export and render with POV-Ray 3.6.1, which is the latest stable version and has some advantages and extra features. You can also use MegaPOV 1.2.1, an unofficial patch with even more extra features like HDRI, glows, radiosity optimizations, etc...

  • POV-Ray export:

    Unfortunately, apart from inheriting some of the above problems, the export option has his own problems too:

    • Everything is exported in one file! It would be better for manual editing to have a main scene file with the camera and lights, and then separate include files for the geometry (objects) and materials (textures).
    • Textures and objects aren't declared with the names they have in the CA plan. With the current "one file" approach, this is a great obstacle to make adjustments after the export. The only solution I found is exporting to 3DS and then converting from 3DS to POV-Ray with Poseray, which gives you texture and object names based on the CA names.
    • It is also really difficult to identify the lights if you have lots of them: it would be ideal to have them identified by CA with the name of the object they are attached to... unfortunately, this has no easy workaround, as the export to 3DS doesn't includes the lights.
    • Indeed, exported lights are often too dim: seems the fade_distance is wrongly exported, being 1/10 of what it should be to match the internal rendering.
    • Only the current camera is exported. It would be very useful to have all the cameras exported, with all but the current one commented out, so you can render multiple views without having to export multiple times.
    • Mesh unions have an extra transparent texture with ambient, which doesn't seems to have any effect, except for a little extra rendering time (indeed, I can't see the point in using unions of meshes if the components never have transformations... perhaps a whole mesh2 for each object with would be more efficient, as Poseray does when you convert the exported 3DS).
    • Meshes have sometimes strange artifacts, perhaps due to degenerated triangles, which show as black patches on the objects. Exporting to 3DS and then to POV-Ray with Poseray doesn't shows these artifacts, so I guess it's something with CA export to POV-Ray, or simply that mesh2 is more efficient.

    To overcome most of these problems, I recommend to export both to POV-Ray and 3DS formats, and then convert the 3DS to POV-Ray with Poseray, a free conversion tool. Mixing parts of both exports we can setup a scene more suited for manual editing with POV-Ray.

    Here is a quick overview of the process:

    Chief Architect -> Poseray -> POV-Ray
    CA Plan -> Export to POV-Ray -> Camera -> Final scene
    -> Lights
    -> Export to 3DS -> Export to POV-Ray -> Geometry
    -> Materials

    The solution proposed may seem cumbersome (and it is so), but it is the best solution I can figure out, with the current export formats. And it's not so hard when you have done it a few times: the most difficult part is identifying each light to make adjustments to light color and fading (see the recommendations on the tutorial below).


Tutorial

The first thing you need is, of course, POV-Ray 3.6.1, if you don't have it already installed. You will need also Poseray 3.12, the free and amazing converter by FlyerX, to convert the 3DS export to POV-Ray format (it also does a lot more, so it is worth exploring the possibilities). Finally, to enhance the light sources as I propose in the example scene, you will need also to download Lightsys, a set of include files for POV-Ray.

Here follows an explanation of the solution proposed above, but to know all the exact details you will have to download the zip and study the example files, which you can use later as templates for your own scenes.

  • Chief Architect:

    Open your plan with Chief Architect and check that everything is correctly in place, as later it will be difficult (but not impossible) to re-place the objects and lights. Look specially for light data: I recommend using the option to see the light placement, as some library lamps have strange (unrealistic) light placements.

    Also, if you have many lights, you may want to give them different colors to help identifying individual lights on the exported POV-Ray scene. And better turn of any lights that will not contribute to the image.

    Regarding materials, don't worry too much about the finish properties, as they will be lost with the conversion via 3DS, and anyhow CA dialogs don't allow much customization either. But better use CA to assign any image maps, so you later can avoid messing around with folder paths within POV-Ray.

    Create a render (OpenGL) view from your favorite camera. You can adjust the radiosity settings on the raytracing dialog, but it's not necessary, as we will replace them with better, more adjustable settings.

    Export to POV-Ray format into a separate folder, using the checkbox to copy the textures. Now export it again to 3DS on the same folder, turning off the checkbox for truncating file names. Close CA and take a look at the folder: there is now there a bunch of image maps, a 3DS file, and a single .POV file.

  • Poseray

    Open Poseray and load the 3DS export: on the initial Input tab: click on "load->3D model" and select the 3DS file.

    First thing is to correct the ambient values on materials coming with the 3DS file, which we don't want for use with radiosity. Go to the Materials tab and change the first material ambient to black (0,0,0). To save some work, right click on the ambient box and select "Apply to all materials". To be realistic, only the bulbs and other glowing surfaces should have ambient, so if you feel comfortable with the Poseray material editor, you can now set the ambient of such materials, but you can also do it later on POV-Ray.

    Now, for better results on the geometry, go to the "Groups" tab, and push the button "weld vertices", then "recalculate normals" using the "unique normal sum" method.

    Finally, go to the "POV-Ray output" tab and select "break the mesh by groups and materials" and "only geometry & materials", then click on "Export->Save" (you can also break the mesh only by material, but then later it would be difficult to change the material of an object if it's used also by other objects). On the "Export options" dialog which appears next, select the export folder, but don't check the option to copy maps nor to fix maps names, as we wan to use the existing ones. Uncheck also "Include file paths..." as we have the image maps on the same folder.

    Once saved, close Poseray and look at the export folder again: you will see two new .inc files, one for the geometry and other for the materials, but not a new POV file. That's what we wanted: we will use the one exported by CA as our main scene file, after stripping the objects and materials.

  • POV-Ray:

    And here starts the real work: open POV-Ray 3.6.1, and load the .POV file generated by CA and the two .inc files exported from Poseray.

    On the .POV scene, delete all except the camera, the backdrop and the lights. The first two are easy to keep, as they are at the top of the file, but be careful with the light sources, as they are scattered within the file. If you have only a few lights, the most easy way is to search for the "light_source" statements and cut&paste them to the top of the file, before deleting the rest.

    But if you have lots of light sources, this can take very long and tedious. Better download WinGrep and use it to extract the lines containing the word "light_source" (fortunately, except the sunlight, all the light source statements are on a single line). Open WInGrep and press the search icon, then type the "light_source" string, select the quick search, use *.POV as file extension, select the folder containing the file, and press OK. The .POV file will appear, and if you click into it you will see the light_source lines: copy and paste them to the POV file (except for the first first line, which is the incomplete sunlight), just below the sunlight code (you could move them to another .inc file just for the lights, as I did on the example scene).

    Now, to use the geometry and materials generated by Poseray, include the _geom.inc file at the end the .POV file, and comment out the union of all the objects at the end of that file to gain some additional speed if you have many objects (see the example files). Note there is no need to include also the _mat file, as the geometry file will include it automatically.

    Finally, we have a scene that is easier to edit: there is a light-weight main .POV file with the camera, lights and backdrop coming from CA, and separate files for the objects and the materials coming from Poseray. Also, the quality of the meshes is better too, and we can start enhancing the lights and textures to make something more realistic. Anyhow, you can now press the "Run" button on POV-Ray to see if it works (perhaps some errors/typos were introduced when cutting and pasting the pieces together).

    From there on, you should download the example files and look at them for the exact details, or just to copy and paste the missing pieces to your scene. Here are some general notes about the enhancements I did on the example scene:

    Global Settings

    First thing is to lower the excessive max_trace_level to 6 or 7. You can try to increase it later if you see black pixels on reflections/refractions or radiosity artifacts, but for now it will render a bit faster.

    Also, we can change the radiosity settings to something faster but with decent quality, and implementing two-pass radiosity to accelerate successive renderings were only materials change. Look at the main .POV file for instructions on how to render the two passes. I also implemented a quality variable, so you don't have to mess with the actual radiosity parameters. There is an addittional variable to specify the radiosity light bounces: use 1 or 2 for outdoors scenes or interior with only artificial light, and >=3 for interiors with incoming outdoors light. Another variable allows to control the brightness of the radiosity effect: usually 1 is the correct value, but in some cases you may want to adjust it for better contrast.

    And finally assumed_gamma has to be set to 1.0 for realistic contrast. This is the only "real" problem on the POV-Ray side, because POV-Ray will apply this gamma correction to the image maps and thus they will look "washed out". My solution is to use an image manipulation program to apply the inverse gamma correction (1.0/2.0=0.5) to the image maps. You can leave assumed_gamma at 2.0 to avoid this step, but then the radiosity contribution will be much less visible, and you will have to raise the radiosity brightness to compensate, although it will not look as realistic.

    Lights

    The most difficult thing, if you have many lights, is identifying them on the exported file. The only way I found is to change the colors of the lights in CA, before exporting, to easily identifiable colors like red, green, blue, yellow, etc... then in the POV-Ray file you can identify them by their rgb sentence.

    Once identified, we can start by adjusting the lights to be more physically correct, and for that I recommend to use Lightsys. We will also use area_light for soft shadows, and for further enhancement, I recommend using spotlight settings on recessed lights.

    For the sunlight and sky, you can also use Lightsys: look at the example scene for the details on how to set it up, using the solar position of the original CA sunlight, as I did on the example.

    Just one additional note about lights: due to the export via 3DS of the lamp geometry, some lights will be blocked by an opaque texture on the bulb/screen/cover, specially on recessed lights. Remember to make these textures transparent, or just move a tiny bit the light_source to place it outside the lamp geometry (in the case of a recessed, just 1 unit below will do it).

    Materials (textures)

    Materials are easier to locate than lights, because the CA->Poseray->POV-Ray conversion retains (at least part of) the names of the materials,and all are located in the *_mat.inc file, so you can go there and identify them by their CA name. Also, you can always have CA open at the same time, using the material lookup tool to better identify the materials.

    As the materials converted by Poseray should have the correct colors and maps attached, but ugly finishes, we are going to leave the pigment{} statements as they are to preserve CA colors and maps, but we will replace the finish{} statements with better ones, and will add bump maps to some textures. My recommendations are illustrated and slightly commented on the _mat.inc example file.

    Further enhancements

    POV-Ray and MegaPOV can offer you a lot of features to further enhance your scene: focal blur, media, hdri, glows, etc... I illustrated some of these on my example scene, but are disabled by default (look at the comments on the code for how to enable these).

    Possible problems

    If you see clear spots on the corners on interior scenes, specially on the floor, take out the exterior terrain from CA, as perhaps some radiosity is incorrectly entering the room bounced trough the joints.

    Also, a low max_trace_level can be the cause of dark artifacts on corners, specially in rooms with reflecting walls.


Example files

To illustrate the process, I created a simple but nice test plan on CA, based on a real room photo from a magazine. It uses objects and materials from the standard CA libraries, so any CA user reading this tutorial can load the plan and follow the steps with this same scene. To do so, export it yourself, or download the original exported files without modifications, for comparison with the final scene files I created from them (note that although the last two contain images with the same names, these are not identical, as the ones contained on the final zip are gamma corrected for assumed_gamma 1).


Usage terms

You can use freely any suggestions, examples, and tools provided in this tutorial (or in this site) for your CA projects: I only ask you to advise about this tutorial to other CA users, as my main motivation doing this tutorial is to promote the use of POV-Ray for this kind of application.


Images from other CA users

Here are some images created by other CA users, while trying to follow the tutorial above.

Donald K. Allen Jr.:

Bedroom_Mod2 DiningRoom_Final FamilyRoomFinal LivingRoom_Final