Thoughts on making Cycles into a spectral renderer

Here is what the entire scene looks like by the way

Is this build intentionally keeping the user from using fully saturated green when dragging the dot in the color wheel? Why is that?

That’s a @troy_s question but as far as I know it has to do with the OCIO profile. You can still type in colors to whatever you like.
That said, it does let me do this just fine so I’m not sure what you mean.

EDIT: wait no I see now. that is very odd. Right around here:


is the closest to the left side you can get. After that, if you drag further down, you only get to here:

Youc can’t get closer to the edge.
And then,

for a good region, you can’t reach the edge, until

you reach saturated red.
If you then go further to the right from there,

it’ll push you away again until roughly

here

The wheels are very problematic due to lacking properly managed controls.

I suspect what is being seen is the simple fact that post transform, the source values cannot be reached. IE the discrepancy between Illuminant E white and sRGB / BT.709’s D65; the chromatic adaptation shifts the underlying primaries.

1 Like

@pembem22 there is some sort of reroute bug right now:

with reroute (incorrect):

without reroute (correctly white):

As far as I can tell this seems to be specific to the Light Path wavelength output.

1 Like

I’m not sure that this is correct. But I think I have a working thin film shader now.

Here’s one with varying thickness:

And the blend file:

17 Likes

Frankly as a user I don’t much care what Brecht wants, I’m willing to trust he has got practical reasons but doesn’t change the fact that this is something I might want.

Though in this particular case I suspect the wavelength lightpath might be more useful for NPR uses than PBR ones(never say never though).

That bubble looks awesome. I’d love to see it against a lighter background, I think it looks perfectly photorealistic.

What’s with that? This twick of the white level is no longer needed, as the latest build has solved the problem from its root. So I disabled the “Use Curves” checkbox at post number 1498

Also that’s not what I’ve done to the light source, this is:

Ah, I missed that you had disabled it. But it could have explained some loss of overall image brightness.

Oh I see what you meant. But because I already disable it so it is definitely not the case. I wonder what the cause of the problem is.

Amazing!!! Can’t wait for it to become one single BSDF shader node!

1 Like

Made a grid of varying thicknesses (these go exponentially from 10 to 1000nm which apparently are roughly the thicknesses you might find actual bubbles in. that said, I didn’t really attempt to match the relevant IOR of actual bubbles)

EDIT: here is a chart of the effect.

This particular chart was created with thin film IOR of 1.4 and internal and external IOR of 1.
Thickness varies from 0 at the top to 2000nm at the bottom. Left to right is the angle dependence (-90° to 90°) so right in the center is the thing you usually see for these (at 0°) - perhaps you can roughly spot which bubble corresponds to which depth.

16 Likes

…It’s beautiful !

There’s also a new build for macOS :slight_smile:

4 Likes

One thing I’m not sure about is how absorption plays into thin films. As a result I can’t necessarily get everything to work as I’d hope. For instance, if I attempt to use silver’s refractive index as the bulk material, I get these strange results:


Because the IOR of silver comes out to be less than 1 for large parts of the spectrum.
I think the reason is, that silver also absorbs light, which is stored in the ks of silver, which I’m not accounting for right now.
@pixelgrip do you have insights into that? I’d love to rebuild the full-featured up-to-three-layer complex IOR thin film shader but that node setup is an inscrutable mess so it’s unclear to me how to easily translate it into a spectral setup.

You need the Fresnel Conductor equation for this then.
The easyest would be to left N0 for dielectric air,N1 dielectric for thin film fluids,glass and transparent plastics,and change the equation only for the substrate to Conductor.
There is a reason that (like this case you have posted with the silver) that some equation combinations (Dielectric-Conductor or Dieclectric-Dielectric exists).
(The Thinfilm eq with Conductor calc at substrate would add the k value to the calculation as you know.High absorptive mats like metal have mostly a k value over 1.You can guess that the reflection calculation have the right amount then(n+k²)

A thinfilm eq of conductor film makes only sence if the thickness is a few nm thick,otherwise its gets realy quick absorptive.
As sayed for the substrate is fine and makes the most sence.

IIRC i have changed the Thinfilm Fresnel parts with this equation,(mainly added the k²)
conductfres
Here another eq for the same result
fresneqcon

2 Likes

Been playing with Spectrum Curve, it is really interesting how different materials look like they have different colors despite using the same spectrum curve. The first one is diffuse material, the second one is glass (spectrum in volume absorption), third one is metal.

One thing though, the curve is kind of hard to control. It is hard to reconstruct a curve to be excatly the same as another curve I previously used, a little bit difference in curve makes a huge differece in the view.

3 Likes

I think that problem is gonna be much improved once the asset manager is fully in place. You could just simply have libraries of materials to reuse.
For now, you can also use the append feature to get a material or even copy and paste to get materials from one blend file to another.
These look lovely by the way. But you need to be careful to set the handles of all those points to Auto Clamped or something like that (you can do that by clicking on a handle and then on the down arrow and select the option) - right now I’m pretty sure you’re going beyond 1 and 0, yielding unphysical, overly bright results that are gonna break energy conservation and lead to stuff like the extreme amount of fireflies you’re seeing.

2 Likes