Cycles Spectral Rendering

what, if you make a blend file ,with some materials, that shows the strengths of spectral rendering.?

looking for test renderings

I havent yet created the functionality to be able to input spectral data, so Iā€™ll tackle that before setting up a comparison scene.

2 Likes

For anyone interested, thereā€™s now a Windows build on Graphicall which contains my experimental branch for spectral cycles.

Please give it a try (youā€™ll likely see the most difference with strongly coloured and/or very bright lights) and give me any feedback you might have.

No filmic just yet, unfortunately, and it might be a little bit of a teaser since thereā€™s not any new functionality yet, but instead it is just laying the groundwork for adding all the fancy things you think of when you think of spectral rendering.

In the current build you can expect to see more realistic interactions of lights and materials, more obvious the more saturated the lights and materials are, but it is pretty minor in most scenes.

15 Likes

just downloaded the last build and rendered the cycles wavelength node, as emission spectrum material .(From 350 nm to 750 nm)
spectral render


rgb render (latest beta 2.83.2)

setup with default settings

Thanks for that @pixelgrip. As you can see, they look almost identical right now. Looks like thereā€™s a tiny bit more red in the far blues in the RGB render. There will be some minor differences due to how Iā€™m converting RGB to spectral and back to RGB, but really the overall colours shouldnā€™t change too much.

I havenā€™t yet converted any of the nodes to actually output spectral data yet, it is just doing the actual light transport with every wavelength, by converting RGB to a spectrum before doing the math for finding out the brightness of a sample.

Thereā€™s one more large hurdle to get over before I can start converting nodes to output spectral data, but that is indeed the goal.

@smilebags Is there a fairly easy way to model material based on SD (from a graph or matrices) and then to render it out in spectral Cycles?

There isnā€™t any way of doing that yet, but thatā€™s my goal eventually.

1 Like

@smilebags Hello, smilebags! I have a suggestion, what about adding a switch for shifting between Classic Cycles and Spectral Cycles? Like adding an option for that in the render setting, it will be easier for doing comparison with that switch there.

That would indeed make it easier to compare them, but thereā€™s a surprising amount of work which would need to be done in order to have such a switch. Such a toggle might be added if needed before merging to master, but it adds a lot of complexity to the system.

1 Like

I have to admit that I donā€™t want to read these hundreds of replies to see if this has been asked or not, but Iā€™m using the spectral rendering build, and Iā€™m not seeing any new material nodes or anything that could be used to recreate the thin film, aberration and dispersion effects demonstrated in your first post. Are there any sample shaders available to offer some insight?

As it stands, the rendering quality looks great, but the performance is too far below vanilla cycles to be useful, unless there are some cool new shader tricks that can be used.

Just to note: Performance and optimizations always come last. Itā€™s not unusual for techniques in development to even take 100% more time than casual renderings.

Thin film, aberration or dispersion do not need renderer to be spectral. In general, no mainstream renderers are spectral exactly for this reason - that in vast majority of regular scenes, itā€™s impossible to tell the difference, and in the scenes specifically built to show off spectral renderer features (in other words, scenes you will pretty much never intentionally make) the difference is minor. Spectral rendering is in most cases a bad tradeoff: A performance loss with almost no quality benefit in return.

2 Likes

RGB energy loss is pretty noticeable, even in casual scenes. Pretty easy to spot it in indirects.

There shouldnā€™t be a performance trade off at all, as itā€™s using hero wavelength.

Show me some practical example of a non-synthetic scene where it makes more difference than just a few small areas being slightly brighter or darker. Theory and practice are usually very far apart in this case.

Regardless of noticeability, Iā€™d say itā€™s about pushing the bounds. We didnā€™t get where we are today in terms of CG quality and realism by ever saying ā€œthis method is good enoughā€. :slight_smile:

2 Likes

Itā€™s all about indirect. If you donā€™t care about smaller differences in energy, Iā€™m not going to convince you otherwise. WETA has some great papers done on the subject, as well as tremendous work extending the spectral rendering facets. There is also a tremendous difference in coloured illumination, of course.

Thereā€™s a good reason all current production rendering is chasing it. It just happens that WETA was well ahead of the curve.

4 Likes

To give my answer to some of the questions regarding features, performance and real world applications of this branch and spectral rendering in general:

Right now there are no new features in my build. Thatā€™s not the end goal. Thin film, dispersion and even rendering colours outside of sRGB (!!) cannot happen accurately in any RGB renderer. Sometimes you can fake thin film to sort of give the right feeling but it is just a hack on top of other hacks at that point, nothing based in reality which makes it incredibly hard to make anything look realistic with it, which the whole point of an offline renderer - more accurate and realistic renders with less effort, at the cost of render time. Rendering is cheap, most certainly cheaper than a professionalā€™s time. Anything that can be done to save time getting things looking right is a good thing.

The further out your primaries go, the more issues you come across in retaining accurate brightness and colour in reflected light. Renderers mostly fall into two groups: ones which blindly use RGB data and imply sRGB, resulting in images which look mostly okay most of the time, but are limited in their application, and spectral renderers which just do things right from the beginning.

I could go on and on about why spectral is the right thing to do but itā€™s pointless if talking about what is ā€˜good enoughā€™.

Performance will not be considered at all until the system is working correctly and new features have been built. It should end up being within a few percent of Cycles right now, and with that will be better noise resolving power and more control over the sampling than what exists now. Donā€™t worry, it isnā€™t 1980, spectral rendering doesnā€™t come at a 3x performance cost. I doubt you would be able to tell the difference between them in the end.

Side note: which mainstream renderer is spectral? If you knew already, cool, you know thereā€™s not much of a performance hit (if any) to render spectrally. If you didnā€™t, try to find out - it isnā€™t immediately obvious just by looking at render performance.

As for ā€˜I want dispersion!ā€™, sure, makes sense, it is something relatable and very obvious to see the difference with and without. It is coming. It isnā€™t too hard, and if you want you can try to fake it as is (which, as with the other hacks, looks sort of okay most of the time) or wait for the engine to be converted to spectral first. A lot of surgery has to happen before it is worth looking into spectral nodes and effects like that.

Ive been busy with work lately but I should be able to continue to work on the conversion more now.

7 Likes

can you please explain in noob-proof-nutshell what is hero wavelenght?

1 Like

Think of a path tracing beam as consisting of three fixed and unique coloured lights; one reddish, one blueish, one greenish. Thatā€™s the essential basics of an RGB model.

With hero wavelength, the three lights are randomized and always spectral, with one being a ā€œheroā€. Along with the hero are two (or three more ideally) supporting cast members. Each sample shuffles the actors.

It is essentially spectral ā€œinfinite wavelengthsā€ grafted on top of generic three channel.

2 Likes

Thank you for explaining