Experimental 2.74 Cycles build with Adaptive, Tonemapping, Portals and Shadowcatcher!

I-need-a-mac-build :slight_smile:

Onto the Hilbert curve.

Basically, I can see this going into master right now, it is a much nicer pattern for visualization (due to it revealing entire sections of the image at once) and has a speed that’s competitive with the default ‘bottom to top’ method (slightly faster than ‘center’).

Good work on that part overall.

It still not as good as the existing center-out method though. It reveals one half of the image first, and starts in the corner. That’s the main reason it hasn’t gone in yet, IIRC.

@Lucas i noticed something like that too, a dark scene resolved extreme fast (something has improved there), but then it kept going and added some firefiles. And it only finished that tile when those fireflies had resampled again to a dark color, well thats how it looked. I was allready amazed how AS set to 10 with adaptive worked, for cave wall materials in my dark scene. The start seamsed realy good (i’m impressed), for the wall material (the water, is glass is complexer and thus requires more samples).
Perhaps prioritze areas with fireflies, some salt n pepper filter , or kirch?, to check for where the fireflies are and then prioritize resampling of those areas ?, just an idea; here is a link to my file if you like to see it : https://dl.dropboxusercontent.com/u/54767531/cave.blend

@Lucas: it does not seem to compile with mingw, but it did with msvc12.

SHADOW CATCHER test1:
samples for both shots are 100

this is lamp shadow and ambient shadow rendered in two layers and composited:
time: 1:54


this is the new shadow catcher -thank you- material on one layer:
time: 1:02


faster but noisier, can you @Lucas explain? or should i do crank up the samples, also waiting for the edges fix.

thank you again for this awesome batch.

Yeh - did my own test of this - portals is amazingly powerful for difficult scenes. Opens up a whole new world of rendering possibilities.

600x400, 1500 samples on GPU (GTX480) - Normal Path tracer with a volume scatter cube filling the interior of the room - render time 4 minutes 30 seconds.


Same scene just without the portals - render time 4 minutes 2 seconds:

@Lukas, the bug with Portals used in conjunction with other lamps in the scene is still there, even if other lamps has 0 strength emission.
The contribution of Environment light gets lower unlike if there are not Portals, and creates a visible “border” where portal is touching the wall mesh.

Couple of blends to test.

http://www.pasteall.org/blend/35407

http://www.pasteall.org/blend/35408

@moony,

man thats crazy!

Unfortunately environment MIS does not seem to work with this build. :frowning: I have HDRI with strong sharp sunlight, and it renders terrible without MIS (no sharp shadow). When i enable MIS, nothing changes.

In official 2.74, everything works fine.

MIS works fine in Lukas build but it doesn’t update on/off while viewport rendering. You need to restart viewport rendering for MIS to be computed… At least this is what i’m getting…2.74 official doesn’t have this problem

Ah, yes. That may very well be it. :slight_smile:

The problem here is that CMJ won’t be better with adaptive, because it needs to know in advance how many samples will be used. However, with adaptive sampling, we can’t tell for sure. Using it with a wrong sample count is possible, but won’t give you the same advantage.

Well, currently the sampler does exactly the opposite: Instead of throwing tons of samples onto the firefly, it tries to filter them out of the importance map. The reason for implementing it that way is that if, say, one out of 4 pixels has a lot of variance in a certain region, it’s quite likely that the whole region is noisy. This produces problems with fireflies, but helps a lot for the BMW headlight reflections, for example. Without this filtering, they look really weird because the spots around fireflies are sampled perfectly while the areas in between remain noisy.

I don’t really understand that one… Do you talk about the tile pattern (left-right, center etc.)? Or about the time per tile? Or something completely different?

Map update is how often the error is estimated (and possibly stopped). The tile is sampled for three intervals at startup. Confidence is essentially a quality slider (to be precise, it should be the probability that the remaining error when stopping is below the visible threshold). To see the sample amount, you can build with debug passes enabled, it’ll show a “Number of Samples” pass.

Well, most changes (except for the shadowcatcher) are already in review. I can’t really tell when they will be accepted, though.

Yep, correct. Up to now there was no reason to include alpha in the error estimate since you couldn’t really get a noisy alpha channel. With the ShadowCatcher, though, it makes sense to include it. I’ll do so in the next version.

Try adding “#include <math.h>” below “#include <string.h>” in intern/opencolorio/ocio_impl_glsl.cc.

I’m already working on it. Both are a bit tricky: The Hilbert one because I’m not too sure how to make it start at center, and the Light portals because of the background light syncing. But as I said, I’ve not abandoned them :smiley:

Hm, tricky. I assume you’re referring to the Ray Visibility settings? If yes, would it help to have per-layer control over these?

Are you applying the patch to the correct commit (by running “git checkout v2.74” before)?

There’s a simple reason fir that: If you have a simple background light (without MIS) and a sunlamp, only the sunlamp can be sampled, so with 100 samples, you’ll get 100 sun samples. Portals can also be sampled, however, so you get (roughly) 50 sun samples and 50 portal samples this way.

Yep, it’s quite noisy. It currently works by just sampling a lamp, so it’s just as noisy as “regular” shadows. I don’t really see a way to improve that, but once Adaptive Sampling works with alpha, that should help too.

Oops, I’ll have a look. That’s why it says Experimental in the thread title :wink:

MIS should work, both without and with portals, at least it works here. Viewport causing trouble is quite possible, though, since I always forget to test it :confused:

Well, currently the sampler does exactly the opposite: Instead of throwing tons of samples onto the firefly, it tries to filter them out of the importance map. The reason for implementing it that way is that if, say, one out of 4 pixels has a lot of variance in a certain region, it’s quite likely that the whole region is noisy. This produces problems with fireflies, but helps a lot for the BMW headlight reflections, for example. Without this filtering, they look really weird because the spots around fireflies are sampled perfectly while the areas in between remain noisy.

I’m not talking about a high amount of variance all across the tile, but cases where you only have like one or two bright pixels in a tile that might be 40x40 pixels in size (or an area of 1600 pixels square), so you have perhaps over 95 percent of the total calculated error being due to just one or two pixels.

The issue then is that the redirection of samples only occur over perhaps a 3x3 area, so the rest of the tile which has a very low error in comparison is still getting a lot of samples, which means the sampler wasting a lot of time in areas that don’t need more at the moment.

In addition to the engine becoming ‘stuck’ on certain tiles as a result, it also creates a situation where there’s a major discrepancy in the total amount of noise between it and its neighbors in a region of the image that typically should facilitate a much more uniform amount.

Hope I explained it better.


There’s a simple reason fir that: If you have a simple background light (without MIS) and a sunlamp, only the sunlamp can be sampled, so with 100 samples, you’ll get 100 sun samples. Portals can also be sampled, however, so you get (roughly) 50 sun samples and 50 portal samples this way.

Except that I did try to build the sun into the environmental texture and render with MIS turned on (so in theory I wouldn’t split the portal samples with a lamp, I got more or less the same result as using a sunlamp.

Ah, okay, I see. I’ll try to implement some firefly detector, thanks for the explanation.

That comes down to the same issue: If you have both MIS activated on the Background as well as Portals, it will split the samples between the two. In the end, you can only use one way to sample a new direction at a time. So, whenever there are multiple ways (Portals, Background MIS, Lamps etc.) available, each one gets fewer samples in total. There is some weighting going on behind the scenes to make the impact of this smaller, that’s what MIS actually means: Weighting the combination between multiple sampling strategies. However, the basic issue remains.

I have no idea how to do that…lol. As i said, i was following the online tutorial, and tried to apply your patch. Could you describe how to use git checkout, even if its for windows.?!

Thank you!!

Open a console window, navigate into the blender source folder (the folder should contain folders named intern, extern, source etc.), run the command “git stash” (to get rid of any changes), “git pull” followed by “git checkout v2.74”. Now the patch should apply without problems.

Could you write the exact command line?

Thank you.

Ok it worked…

Dude the Adaptive Sampling is great…
Just took an old scene nd rendered it out…

Without Adaptive Sampling - 16:44.47
With Adaptive Sampling - 06:48.68

I hope u make it to the master…
This would be really helpful…

lsscpp yes it would be nice to have
i think this is similar to maxwell Multilight
here examples









here how it work inside package

also some of this functionality are for vray (note - the year of placing video)