Cycles - IOR attribute in camera
What about being able to tell the render engine that we're not in the air at normal pressure conditions and average temperature etc... ?
For example, rendering a scene underwater, being able to set an IOR on the camera (1.33) and seeing all shaders from our fishes, divers, submarines ... behave accordingly (the math on their own IOR would help achieve what we see in real life).
(not talking about caustics here, but reflections/speculars/refractions)
Is it a good idea ?
4 Comments
If you put a plane in front of the camera with a glass shader, full white color, zero roughness, and the IOR you need, I guess this gets the result you want:
Maybe I wasn't clear. Look at the kid's eyes on the pictures, the fresnel behaviour on his skin... Adding a piece of glass in front of the camera is not a solution, respectufully.
By the way cheating all shaders is not an option neither (tweaking IORs on each, etc) as we need to make them work in all situations, in the air, underwater etc. A camera shader would be ideal, this is a dev request I'm talking about.
There's always someone with a workaround instead, which doesn't help Blender improve in any way...
It does help. Because either you find out the feature you request is already there, or already requested (sometimes in a different and/or better way), or is already being developed or rejected by the devs, or it allows you to refine the feature request. Because the post might lack clarity, or not go deep enough to be understood correctly, or it doesn't take implications into account, ...
It's a community effort from start to finish, it's part of the process to push proposals to their limit and refine them 👍
Right now, it raises more questions to me, so I'd love to push the details on what that feature would cover and how it would work.
Because the way I understand it from laurent's answer, it goes way beyond just simple IOR/refraction effects, with more influence needs than just the camera, and I also suspect it could cover more scenarios than just underwater. So all in all, not just a couple checkboxes and buttons on the camera.
Effects
So far you mentioned IOR, fresnel, reflections, excluded caustics. And I guess it could include diffraction, if we ever get that in Cycles one day.
I am no expert, but to my limited knowledge, the fresnel of human skin (or other materials) doesn't change underwater. Unless you want to add a wide colored fresnel contour on your objects, but that would be in the realm of abstraction.
What changes is things like how light travels through water (refraction, but also diffraction, absorption, ... I bet some people would use a volume shader for this), and some things we don't always intuitively think about, I.E. how fine air pockets gets trapped on your skin's vellus and terminal hair and might give some weird "additional reflective surface" :
Regardless, it sounds to be a lot of parameters, and they might be changed differently from one object to another, and also from one pixel to another, so constant values on the whole camera view sounds limited.
In addition. Having a one-click "make this underwater" sounds cool, but it also sounds very niche and more like a good addon than an in-box feature.
There could be even more things people could want from such a feature. What if someone wants to do an under-oil render? Or in-fire? Or in a different atmospheric level? Or... Or a stylized render?
Influence
You mention it as a camera attribute.
If you made a render halfway underwater, or inside a submarine looking through a window, or a photo of an aquarium, then you need a way to limit the influence in the 3D space, so having a camera-level (or scene) override sounds limited. So maybe a way to do it would be to select an effected collection, or have a mesh that delimits an area of influence?
Proposal: Nodal Additive Materials
Aka stackable materials on crack.
Considering Geo Nodes are currently able to set a material on a given mesh data. And that the greater project of "Everything Nodes" is to be able to do everything with nodes.
If two new things could be added:
Let's imagine if we had a "Layer Material" node in geo nodes that take a selection input and a material input,
The Selection could be an object, or a collection of objects, or "whatever is inside the geometry of an object", or left empty to affect the whole render.
And the node would mix the input material onto whatever materials the selection have.
That would mean you are in total control of which effects are applied, where and how. Anyone can do whatever they want with it, it isn't limited to one specific scenario nor style nor the whole render.
Example: Let's say I want to render a bunch of suzannes with different materials in a pool with a stylized fresnel. Make a material with just a glass shader with IOR and no roughness (and diffraction if we had it, but we don't), and another one with a fresnel factoring a mix shader between an Emit and Transparent shader:
In geo nodes, add two Layer Material nodes. One with the fake fresnel and a collection with all the suzannes. Another with no influence (so it affects all) and the IOR shader.
Now you have this: