Dev talk:2.5/Source/Render/Cycles/Ideas

提供: wiki
移動先: 案内検索

path bias

(i'm sure i don't have to point this out, but example images should really be viewed at 1:1 pixel size to see what i'm talking about.)

Have you considered the possibility of some kind of path biasing system? One of the things I’ve noticed while using cycles is that depending on the surface material and the lighting setup certain parts of the image render better than others:

CyclesMonkeyExample.png


After 1000 passes the Golden monkey on the right is pretty good, but the ruby/red jello monkey on the left is still kinda rubbish. Not knowing much about the code behind cycles, I’m making the assumption that for each render pass it traces one path per pixel (so on a 1920x1080 image it will trace about 2million ray paths per pass), averaging them out as each pass is completed. If you were able to analyse the image and draw up a 16x16 pixel grid path distribution map based on which areas of the image are the grainiest:

CyclesMonkeyMapExample.png

This map would only need to be recalculated ever 10 or 20 frames as to prevent the individual render cycles from slowing down (perhaps even giving the user control over the recalculation period so if the image is going to be 2000, passes maybe only recalculate every 50 passes, as well as an upper and lower threshold input control for grain sampling) The renderer would then attribute a percentage bias to the 16x16 grid squares. Say 1% for solid colour and 99% for white noise (or whatever upper and lower threshold the user inputs). So based on that it would run maybe 3 paths per pixel for the red areas of the above figure. But only calculate a path for ever second or third pixel (perhaps randomly or perhaps using some kind of bayer pattern) in the blue area. That way it is still performing the same 2milion path traces per pass, but it would be focusing on the areas of the image that are the grainiest bringing the overall image to a more stable state in less passes.

I decided to run this ford mustang model I’ve recently been working on through cycles as a test and it might act as a more practical example of what I’m talking about

CyclesMustangTest.png

The main body of the mustang (and the overall image) had an acceptable grain level around pass 600 however even after the complete 1000 passes, the reflections of the little blue lights on the front bumper are still very grainy. After 2000 passes I suspect the blue light area would still have noticeable grain, whilst the rest of the image would remain largely unchanged to the naked eye.

Obviously it wouldn't be perfect for everything but by distributing the path calculations based on the graininess of the area, I think in most cases it would be possible to achieve images with a lower and more even grain overall, with less passes.

Murphy 15:43, 19 May 2011 (CEST)