Cycles: Add thin film iridescence to Principled BSDF #118477
|
@ -261,9 +261,13 @@ static void node_declare(NodeDeclarationBuilder &b)
|
|||
|
||||
/* Panel for Thin Film settings. */
|
||||
PanelDeclarationBuilder &film = b.add_panel("Thin Film").default_closed(true);
|
||||
film.add_input<decl::Float>("Thin Film Thickness").default_value(0.0).min(0.0f).max(100000.0f);
|
||||
film.add_input<decl::Float>("Thin Film Thickness")
|
||||
weizhen marked this conversation as resolved
Outdated
|
||||
.default_value(0.0)
|
||||
.min(0.0f)
|
||||
weizhen marked this conversation as resolved
Outdated
Weizhen Huang
commented
I think we could default to the IOR of water, which is 1.33. I think we could default to the IOR of water, which is 1.33.
|
||||
.max(100000.0f)
|
||||
.subtype(PROP_WAVELENGTH);
|
||||
#define SOCK_THIN_FILM_THICKNESS_ID 28
|
||||
film.add_input<decl::Float>("Thin Film IOR").default_value(1.3f).min(1.0f).max(1000.0f);
|
||||
film.add_input<decl::Float>("Thin Film IOR").default_value(1.33f).min(1.0f).max(1000.0f);
|
||||
#define SOCK_THIN_FILM_IOR_ID 29
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Specify the unit (nm).
Good point. If we're already handling units, might as well do it properly: I've created #120900 for this, depending on what PR gets merged first I'll just update the other to tag this input correctly.
Default value for float socket is
0.0f
by default, no reason to make this explicit.Max value also does looks like meaningless (what for such soft max?)
I think it's easier to understand the code with the default value explicit.
For soft max indeed
FLT_MAX
should generally be used if there is no real upper bound. But this can sometimes cause numerical precision problems, so not sure it works here.I mean, at some point such declaration can be cleaned due to the fact this is not really necessary.