Thoughts on making Cycles into a spectral renderer

A new build is available on GraphicAll. Changes:

  • Fixed vector to spectral socket conversion
  • Increased wavelength importance sampling resolution
  • Improved quality of the default CRF preset
  • Fixed “Subsurface Radius” socket not displaying as spectral in Blender UI
  • CUDA kernels are now compiled with CUDA v11.1
  • Updated Blender
9 Likes

You should apply the “CIE 1931 Standart Observer” preset as it has a much better resolution. The default one (when creating a new file) should have the same resolution now. For the old files, the preset should be applied.
I also increased the wavelength importance sampling table resolution from 1024 to 4096. Here’s a comparison:


5 Likes

Thanks for the update and that new test. Its interesting to see how the chart responded to the greater CDF resolution.

@smilebags I notice that sometimes when I open spectral cuve node,there is only black image behind the curve,is this a bug ?

Image 1
I am not very familiar with spectral cuve,if I pull the current selected point up,it’s always white.If I pull it a little bit down,it goes blue.Is this a problem?

I can’t reproduce this,maybe some addon have conflict with this.

I’ve seen this happen as well. Not entirely sure when it happens.
But if I go to the panel where I could, in principle, mess with the camera response function, that will also appear black for a moment but then reload the background image, and once it does that, so does the background in the nodes.

Where would I do that?

So if I get that right, while it’s way better, even now the extreme end of the red spectrum practically won’t ever be sampled. As long as that’s true, would widening the sampling spectrum even make a difference?

Not sure it actually matters in most cases of course. The far end of the spectrum is very dark to our eyes and will rarely appreciably contribute anyway. But effectively, the sampling isn’t actually what it’s supposed to be.

Maybe it would make sense to update the image of the spectral branch?
If it’s to be the exact same thing, then here is the same render but rendered with this latest build and without noise:


But perhaps it’d also make sense to use something else

I’ve been tossing up options for how we should tackle this and I think I have a solution that should work, but importance sampling may suffer a tiny bit.

Increase the ‘importance’ of all wavelengths by a constant amount, such that areas with very low importance (far blues and far reds) get a significant increase in importance, while green will not gain any noticeable increase. This will mean the darker wavelengths will be over-sampled according to their brightness, but should fix this issue. I’ll see whether I can implement this and verify that it works.

I’m also going to try to simultaneously fix the banding - right now we’re treating the importance sampling CDF as if it’s identical to the luminosity of each wavelength, hence the resolution causing visible bands. We must sample all wavelengths within the range occasionally, even if very rarely, which doesn’t seem to be happening now. If I succeed in what I intend to do, the brightness gradient should become smooth - we should only get bands of differing noise levels.

Once this is resolved, extending the sampling range should give us the marginal improvement that it was intended to. Right now you’re right, it wouldn’t do us much good, if any.

1 Like

If anyone wants to create/propose a new image for the branch I’m sure we can swap it out :smile:

@kram1032 do you have that spectrum in EXR? If so is there some way you could send it to me, or alternatively process it with regular Filmic and post what it looks like? I wonder how it’ll treat bright and out of gamut colours. I imagine it’ll be significantly better but still have some issues.

If you mean the spectrum pembem22 showed off, I think that’s a recreation? I can certainly redo it in the latest version.
If you mean my own render of it, from an earlier version of the branch, I already linked the exr in this reply:

Ah apologies, I must have missed that. Thanks

image

Thanks, I’ve updated the image.

Oh I never even messed with the CRFs. Figured the default was already the correct thing to use, unless I’d go for very particular looks.

That happens when the CRF curve is not initialized. You just need to click through each channel tab (XYZ) and it’ll show up.

I wonder if there is a way to make this more reliable though. 'cause it’s, in the grand scheme of things, not that big a deal, but for new users it’s gonna be weird and confusing, and the solution isn’t gonna be very discoverable

This will definitely be addressed in the future along with all the other bugs.

1 Like


As predicted, Filmic fixes some of the highlight issues but doesn’t solve the gamut problems, as is evident by the solid bands of colour. A ‘Spectral Filmic’ version should also solve this aspect.

This shows nicely the shortcomings of current Filmic for spectral rendering. Obviously, this is an extreme case, not at all reflective of most scenes, but I’d argue the white-out here, on top of the oversaturation banding (which is, of course, the real issue), actually makes it look worse.