Render passes using DPFilter
From LightWiki
By Dodgy
First download DPkit and DPFilter plugins from Dennis Pontonnier's Web Page . Install them into LightWave. The DP filter plugin consists of a range of plugins including two Nodes, the Store Extra Buffer and Get Extra Buffer nodes, and the Image Filter Node Editor, which make this technique possible.
The Store Extra Buffer is used in your materials wherever you want to store a buffer to output. The Image Filter is used in the Image Filter Plugin in the Effects Panel>Processing Tab. The Get Extra Buffer is used to retrieve the data from Store buffer and save it to disk.
The Store buffer and Get buffer have 6 buffer channels which can be used. 3 are colour buffers, and 3 are greyscale (alpha) buffers.
The basic set up is this. Open the Processing Panel (ctrl+f8) and go to Add Image Filter at the bottom and select 'Node Image Filter' from the plugin list. Double click it in the list to open it. In the Node editor panel, go to Nodes> DPKit > Processing > Get Extra Buffer. It doesn't have to be connected to anything to work. Open its panel and you'll see a list of buffers you can enable, and the filename the buffer will be saved too. It has the colour buffers as 1,3 and 5, the greyscale buffers are 2,4,6. Enable the buffer number 2, and choose a filename for it, and set the filetype to 24 bit PNG.
Then in the Surface Editor, choose one of the surfaces you want to save into the buffer, and open the Node editor for that surface. Choose Nodes> DPKit > Process > Store Extra Buffer. This allows you to plug other nodes into the buffer. For example, by feeding a red colour into a colour buffer, everywhere the material is, red will appear in the image saved.
Note: This node does need to be connected to an input on the material. It doesn't output a value, but LightWave doesn't evaluate any nodes in materials unless they're connected to the Surface via some nodes or directly. For this reason I usually plug it into something I'm not going to use, like the Refraction Blur input.
Now go to Add Node > Shaders > Diffuse > Occlusion. We're going to connect it into the 2nd buffer, which is a Greyscale buffer. But first, something to note. Anywhere not covered by a material being fed into this buffer will be black by default. This means if you plug this node straight in, you'll get black occlusion on a white object on a black background. The most effective way to use it would be to invert the occlusion first, so we have white occlusion on a black object on a black background. Then in our comp, we just use subtract or invert and multiply to get the darkening. So add a Add Node > Math > Scalar > Invert node, and plug the Out of the Occlusion node into the In of the Invert, then the Out of the Invert into the Alpha Buffer 2 (since the Occlusion node jut gives a Black and white output, we can save colour buffers for something else).
Now hit F9. If you set up a save file in the Get Extra buffer node, the occlusion pass will be saved in the file. Open it and check the result. Lovely. You can input all sorts of things into these buffers, I recently output Reflection, Specular and Occlusion for various scenes using this method.
Antialiasing: With this method, using the AA method Adaptive Sampling causes the edges to become brighter in the buffers, so leave that off.







