BlenderPixie irradiance caching method (kind of)


(garbager) #1

Ho blenderheads,

I’m making tests with the fabulous BlenderPixie script.
But I run into a strange porblem.
When I start an irradiance pass, the render is very poor quality. Until that I didn’t care about it, cause I was intending to use it as a irradiance cache file and make another pass using this cache. But I discovered no way, using this script to enable the two passes, or even a second pass using the cache.

So I went to various places and gathered documentation.
And first I discovered something strange to me.
The irradiance rib file is definitely very aliased because pixelsamples and shading rate are very low, no matter the values I put into the script before export.

So the only way I was able to us this script was to re render the irradiance rib file by manually editing it.

Here is the workflow for thoses who could be interested.

  1. Before launching the script using Alt-P be sure to edit the line near the begining indicating the root dir : it should point to an existing folder that will contain your project.

  2. First, using the BlenderPixie script, be sure you’re in general tab

In the generate menu, select IRRADIANCE. Don’t try to tweak the sh rate and samples values, it just doesn’t work (or I didn’t get it).

  1. go to the scene settings and enable Global illumination
    Several buttons should appear just below.
    Select Occlusion. The samples can be tweaked here and have an effect.

  2. Be sure you have at least one light in your scene. IRRADIANCE doesn’t seem to work without one.

  3. Select the lamp and go to BlenderPixie’s object editor tab. Click Get selected. A menu should appear. Turn your lamp into Ray samples. Otherwise your render stay black.

  4. Ok everything is ready now for your first irradiance cache.
    Return in General tab. Next to the export button, you have the choice beetween Buffer or File.
    It seems that buffer only show you the render while file renders it to a tif file without visual feedback. You should select this at the send. that way you won’t have to manually edit the rib to make it save the render into a file.

everything is done in the blender side (save your scene, you never know).

  1. In your project folder you should find an irr_[name of your project].rib file
    Open it with a note pad.

  2. Not far from the start you should see two lines that looks like that.

PixelSamples 1 1
ShadingRate 4

these are the damn samples files that doesn’t change. Fix them, keeping in mind that you must stay into the range of the values that are indicated into BlenderPixie, to avoid crazy rendering times. Also While increasing Pixel samples make a better antialisasing, you must LOWER the shading rate to have a better result.

There’s one more line to fix

  1. find for this line :

    Attribute “irradiance” “filemode” “w”

and change the “w” into a “r”, that will read, instead of writing the irradiance cache file that was saved into your irradiance folder.

  1. Save the file and drag the file onto the Pixie executable renderer (rndr.exe, located into your pixie/bin directory.

Don’t close the window that opens. Nothing seems to happen but in fact Pixie render the image to a tif. When the render is finished, the window closes itself.

  1. Now go to your irradiance folder, and you should find your ambient occlusion file with nice settings. The render is also quite quick.

I also used the simple trick to render the irradiance 4 time the right size and reduce it to the normal size after render. Much simpler but it seems that it takes longer in fact.

BUT

All this is a quick hack to get the job done. And it’s not an answer to the questions I’m asking myself for some days now. IS there a way to make al this using only the script? Why the irradiance pass doesn’t take into account the render quality values? what is the exact workflow for this script when it was used for Friday belgium movie? There must be a way to make things more automatic…there must be…please…

If anyone has ideas about how to handle this script, including all the part I didn’t talk about (shaders, Read archive, the fact that my lamp stay deseperately a lamp and never turn into a spot, things like that), I would be very grateful to hear from you.

Hope all this is a bit useful, as nothing really is.


(garbager) #2

ok I just found the solution

In fact everything can be automatized with the plugin, I was just not using it well, so forget about the previous post

here is a good and quick method

  1. go to scene settings tab of the BlenderPixie script
    enable global illumination
    choose occlusion

  2. Go to World panel in Blender, change the ambient values to a mid grey, for example

  3. (optional) If you want a final render without shadow (to have a clean ambient occlusion pass for later compositing),select the lamp in the viewport, then go to objects panel in the blenderPixie script, , choose get selected and clock on the REN shadows button.

  4. in the general tab of BlenderPixie click both on Irradiance and Final, then click export.
    To see the render choose buffer in the render settings. If you want to save the file as a tif, just click file. You won’t see the render, but it will be saved on your hard drive.

The first pass, irradiance cache, is beeing rendered and is aliased, but you just don’t care. Close this window and a second render starts, mixing the irradiance cache with the final render.

Enjoy very quick ambient occlusion!!!