BlenderFlow! - Using Lightflow with Blender - It's not as hard as it seems
This explanation assumes that you are familiar with Blender, Python, exporting scenes in general, and (at least to a small degree) lightflow's .py files. Text editing will also be necessary, though the tools available make this chore rather easy.
  Two years ago, I discovered a great looking rendering program called lightflow. It's webpage was filled with stunning images produced from this FREE renderer. It had more features than anything else in the "free" world, and was a hell of a lot faster than BMRT. Naturally, I grabbed it quick. By now most of us know about lightflow, and a significant number hae downloaded it, and tried to make it work to no avail. Today I'm going to give you some tips as to how to make my favorite raytracer work with Blender.
The first step, of course, is gettting lightflow to work in the first place (This is no easy task - you will need two pythons installed at the same ime. I don't remember how I did it. for Noise.dat solution, search the python forum) . A good way to check if your installation is working is to render one of the test-files provided with the distribution. these are alos great places to research how the renderer works. If one of these test render files renderez in a way that's unexpected, you could learn a new trick about lightflow and how to get new effects or speed it up.
The next things you will need are the incredible MatSpiderLF and Eeshlo's + Montz's Second edition script at http://www.geocities.com/eeshlo/LFexport.zip. MatSpiderLF is pretty self explanatory, it's a visula material creator, like SLIM or Shaderman. The new modified export script makes it easy to manage many lightflow projects and neatly files them in folders.
BEFORE YOU EXPORT: it will be neccesary to change some setting within blender so that your scenes are lighflowed the way you wnat them to be. - Everything needs to be autosmoothed, even sharp objects. just set their AS's to 00. Set autosmooth by renaming the object (not mesh) like this: ObjectName_AS45 where objectname is your object name, and 45 is the angle you'd like to smooth at. Don't forget this step!
- add _PLIGHT to planes to make them area-lights. don't forget to orient the normal at the target. Area lights are inefficient, though, and lightflow's radiosity makes them rather obsolete.
- Remember to assign a material to every mesh. Or they won't show up!
- UV textures are supported! yay! and they don't require any tweaking once they are exported. wahoo!
- To make a lightdome, make a dome with inward pointhing normals and name the object and material like this: WhatEverYouCallIt_AMBI
- Remember what Lightflow's good at: GI, Caustics, Metals, Glass, and DoF
- Remeber what Lightflow is slow at: patch lights, raytraced point lights
- in eeshlo's modified script, you can use radiosity and savestuff switches. for simple scenes, I recommend re-exporting the meshes each time.
- Radiosity in lightflow does not mean the same thing as in blender! -Always- turn on radiosity in lightflow! i can't stress this enough! it actually makes things FASTER!
Export the thing! using the steps outlined, tweak your objects (in blender) and hit ALT-P in the script windows - this will make a new directory in the path you specified in the script, using the name of your .blend file to identify this particular lightflow scene. Now, open up the .py file in a text editor and look around. make sure that all the files have been exported, and are included in the scene. If it all looks decent, try rendering the file, and tweaking the lights' color values until you can see the scene. Sometimes you must set the color values for the light extremely high.
next come materials. MatSpiderLF is the ideal way to make these, but text-editing them isn't too difficult either, provided you start from a template. There are some sample materials from Jacopo's example files that should have come with your lightflow package. These provide some nice materials to start with. When you've got your materials all set and selected, paste them into your scene .py file and arrange the s.MaterialBegin() and s.MaterialEnd() that are around the code that bring the object into existence, like so:
s.materialBegin(YourMaterial)
s.transformBegin(transform().translation( vector3(-0.097738482058,0.0492451526225,1.10337281227 ) ))
s.transformBegin(transform().rotationAroundZ( 0.523599267006 ) )
s.transformBegin(transform().rotationAroundY( 1.49011597728e-007 ) )
s.transformBegin(transform().rotationAroundX( 1.04719829559 ) )
s.transformBegin(transform().scaling( vector3( 0.590798795223,0.590798854828,0.590798854828) ))
s.addObject( s.newObject( 'mesh', [ 'file', 'YourMesh_AS45.mesh', 0] ) )
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.transformEnd()
s.materialEnd()
I'm not going to deal with all the vagaries of selecting and writing materials, but you can find them yourself in both the Lightflow Class reference and your MatSpiderLF documnetation, which explains how that program can help you make materials easier.
Now that we know what's in our scene and how it should look, we have to decide what lightflow's going to need to calculate: If you leave on too many enchancing settings (Caustics, GI, Raysteps) that you don't need, rendering will slow to a crawl. the first place to check for settings that are set too high (or low, if quality is bad) is the s.NewInterface line:
s.newInterface( "default",["trace-depth", [RayTrace Depth],
"radiosity-depth", [GI Depth], [Caustics Depth],
"radiosity-samples", [Samples],"radiosity-threshold", 0.005,
"radiosity-reuse-distance", 4.0, 1.0, 0.1,
"photon-count", 300000,"photon-clustering-count", 2000, 100 ])
Note: the stuff in square brackets are really integers whose purposes I'm explaining next. This line is by far the most important in the scene, so don't skip this section!
- [Raytrace Depth] is an integer (default is 6) that states how far raytracing will go. if you have no shiny things in your scene, set it to zero!
- [GI Depth] is how many bounces the render calculates in its monte-carlo irradience calculations. If you want a "Arnold" like rendering, set this to 1. Otherwise, 6 is the default.
- [Caustics depth] is how many objects caustics are calculated through. this doesn't appear by default, so just add a comma and put an integer in there corresposnding to the maximum number of glass surfaces in your scene. a simple ball has two surfaces, entrance and exit. a glass has many more. a glass with water in it needs at least 6.
- [samples] is another integer value that tells Lightflow how many rays to calculate the irradience with. values of 300-400 are great for "Arnold"-like scenes, but in reflective scenes anything over 100 is almost overkill.
- "radiosity-threshold" is a decimal value that tell lightflow how much error it's allowed to make when calculating the GI. Change it and see the difference.
- "radiosity-reuse-distance" is rather difficult to explain. the first value should be about 1/5 of the distacnce covered by the camera, in the blender scene's units. the second should be an order of magnitude less, and the third an order of magnitude less that the secod.
- "radiosity-reuse-distance" is rather difficult to explain. the first value should be about 1/5 of the distacnce covered by the camera, in the blender scene's units. the second should be an order of magnitude less, and the third an order of magnitude less that the second.
I'm not an authority on any of these settings - Please tell me if you know something more accurate or if you find a new trick. I'd like to be as informative as possible.
here are some sample images and the .py files that created them.

water.py
Using Caustics and Raytracing. Rendertime on 1.1 GHZ Athlon: 5 Minutes

boxes.py
Using GI, Caustics, and Raytracing. Rendertime on 1.1 GHZ Athlon: 10 Minutes
|